Red Hat Bugzilla – Bug 15631
--setugids doesn't set gid on symlinks
Last modified: 2008-05-01 11:37:57 EDT
--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.
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