diff --git a/NEWS b/NEWS index 4d683dd0..046babac 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ xbps-0.22 (???): + * xbps-create(8): if effective user/group is the same than files being + packaged in a package, set user/group to root:root. This way we don't + have to depend in an external tool to assume proper permissions (fakeroot). + * xbps-query(8): fix segfault when showing unexistent package files. * When checking for obsolete files in upgrades, ignore unexistent files in diff --git a/bin/xbps-create/main.c b/bin/xbps-create/main.c index 913f63be..fad76fd4 100644 --- a/bin/xbps-create/main.c +++ b/bin/xbps-create/main.c @@ -431,6 +431,10 @@ process_entry_file(struct archive *ar, archive_entry_set_pathname(entry, xe->file); archive_entry_copy_stat(entry, &st); archive_entry_copy_sourcepath(entry, p); + if (st.st_uid == geteuid()) + archive_entry_set_uname(entry, "root"); + if (st.st_gid == getegid()) + archive_entry_set_gname(entry, "root"); if (S_ISLNK(st.st_mode)) { len = readlink(p, buf, sizeof(buf));