diff --git a/NEWS b/NEWS index 05145d44..1ef98133 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ xbps-0.42 (???): + * If removing a package and euid==0 do not check for file owner, being root + means that all files can be removed properly. This fixes package removal + when some files were not owned by root, rather by a system account. + * Fixed 65 issues found by Coverity scan. Defect density is now below 0.30 per 1000 lines of code. diff --git a/lib/package_remove.c b/lib/package_remove.c index 9c822785..5679fea9 100644 --- a/lib/package_remove.c +++ b/lib/package_remove.c @@ -65,7 +65,7 @@ check_remove_pkg_files(struct xbps_handle *xhp, * enough to ensure the user has write permissions * on the directory. */ - if (!lstat(path, &st) && euid == st.st_uid) { + if (euid == 0 || (!lstat(path, &st) && euid == st.st_uid)) { /* success */ continue; }