Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 40344

Summary: src rpm won't build right for non-root
Product: [Retired] Red Hat Raw Hide Reporter: j. alan eldridge <alane>
Component: kdebaseAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED NOTABUG QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-12 09:33:31 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 j. alan eldridge 2001-05-12 09:33:28 UTC
Description of Problem:

There is a setuid and a setgid program. They are chmod'd in the %install, 
rather than using %attr to be set up at rpm install time.

[alane@wwweasel alane]$ cat misc/patches/kdebase.spec-non-root.patch
191,192c191,193
< chmod 4755 $RPM_BUILD_ROOT%{prefix}/bin/kcheckpass
< chmod 2755 $RPM_BUILD_ROOT%{prefix}/bin/kdesud
---
> # use %attr() below, this breaks on non-root build
> #chmod 4755 $RPM_BUILD_ROOT%{prefix}/bin/kcheckpass
> #chmod 2755 $RPM_BUILD_ROOT%{prefix}/bin/kdesud
271c272
<       cat $RPM_BUILD_DIR/file.list.%{pkg} |grep -v '/bin/kdesud$' |grep 
-v '/usr/share/config' |grep -v '/etc' |grep -v '/usr/bin$' |grep -v 
'/usr/lib$' |grep -v '/usr/share$' |grep -v '/usr$' |grep -v '/usr/sbin$' 
|grep -v '/usr/share$'
|grep -v '/usr/bin/konsole_grantpty$' >$RPM_BUILD_DIR/file.list.%{pkg}.tmp
---
>       cat $RPM_BUILD_DIR/file.list.%{pkg} |grep -v '/bin/kdesud$' |grep 
-v 'kcheckpass$' |grep -v '/usr/share/config' |grep -v '/etc' |grep -v 
'/usr/bin$' |grep -v '/usr/lib$' |grep -v '/usr/share$' |grep -v '/usr$' 
|grep -v '/usr/sbin$'
|grep -v '/usr/share$' |grep -v '/usr/bin/konsole_grantpty$' 
>$RPM_BUILD_DIR/file.list.%{pkg}.tmp
324a326
> %attr(4755,root,root) %{prefix}/bin/kcheckpass
[alane@wwweasel alane]$

Comment 1 Bernhard Rosenkraenzer 2001-05-13 09:10:44 UTC
It works the way things are. Our build system actually builds all packages as 
non-root.

Any user can make a file he owns setuid (to his own user ID), therefore the 
chmod commands are OK.

rpm takes care of switching the owner (and thereby the user the application 
runs as).

If you can't rebuild the package, chances are you're trying to build on a 
filesystem that was mounted with nosuid.