Bug 15631

Summary: --setugids doesn't set gid on symlinks
Product: [Retired] Red Hat Linux Reporter: bac
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-08-07 12:15:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description bac 2000-08-07 12:15:31 UTC
--setugids is provided by a popt alias in /usr/lib/rpm/rpmpopt, and calls
chown and chgrp through the shell.  However, it does not pass the -h option
to chgrp (the docs only say that this is the default for chown) and so the
gid is not correctly set on symbolic links.

Fix: add -h option for chgrp.

Also, a quick inspection of rpm 4.0 suggests it has the same problem.

Comment 1 Jeff Johnson 2001-05-24 13:49:49 UTC
Yup, there are similar problems with the chgrp -R run at the end of
a %prep during build.

I don't believe the problem is worth fixing because:
	1) Do you really care about the gid of symlinks? If so,
	copy the line from /usr/lib/rpm/rpmpopt-* to either
	/etc/popt or ~/.popt and be happy.
	2) -h is not universally supported, and there's
	a lot of pain in trying to factor the right flags
	everywhere under all possible uglixes.
	3) Early versions of linux dinna support lchown(2)
	correctly, so it's excruciatingly painful to get a
	dynamic runtime test to detect whether lchown(2)
	is functional into the popt magic glue that
	performs --setugids.