xbps-create: set root:root if e[gu]id == st.st_e[gu]id in package files.
The rational is that packages should have proper perms to be installed globally in a system as root, and fakeroot is useless when generating packages with xbps-create when it's statically build.
This commit is contained in:
		@@ -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));
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user