Package remove: disable file owner checks if euid==0.
All package files even not owned by root should be removed, so make sure that those checks return success while being root. This fixes package removal for polkit, that had /etc/polkit/rules.d files owned by the polkitd user.
This commit is contained in:
parent
b3d105cbc3
commit
1c20086896
4
NEWS
4
NEWS
@ -1,5 +1,9 @@
|
|||||||
xbps-0.42 (???):
|
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
|
* Fixed 65 issues found by Coverity scan. Defect density is now below 0.30
|
||||||
per 1000 lines of code.
|
per 1000 lines of code.
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ check_remove_pkg_files(struct xbps_handle *xhp,
|
|||||||
* enough to ensure the user has write permissions
|
* enough to ensure the user has write permissions
|
||||||
* on the directory.
|
* on the directory.
|
||||||
*/
|
*/
|
||||||
if (!lstat(path, &st) && euid == st.st_uid) {
|
if (euid == 0 || (!lstat(path, &st) && euid == st.st_uid)) {
|
||||||
/* success */
|
/* success */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user