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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user