From 1c20086896215fd6eb8e8ff59a6f98a86024ec20 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 17 Oct 2014 09:17:07 +0200 Subject: [PATCH 01/13] 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. --- NEWS | 4 ++++ lib/package_remove.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/package_remove.c b/lib/package_remove.c index 9c82278..5679fea 100644 --- lib/package_remove.c +++ 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; } -- 2.1.2