Bug 14874

Summary: uucp still won't build as non-root; last RH patch was wrong.
Product: [Retired] Red Hat Raw Hide Reporter: Michael Tokarev <mjt>
Component: uucpAssignee: Eido Inoue <havill>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0CC: jbj
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: 2001-01-06 23:33:10 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 Michael Tokarev 2000-07-31 11:22:32 UTC
uucp-1.06.1-25 release.
This release (actually -24, -25 is autorebuild) introduced changes
related to building as non-root.  Those changes are plain wrong.

From changelog:
* Fri Jun  2 2000 Jeff Johnson <jbj>
- FHS packaging.
- map perms/owners into %%files to build as non-root.

Ok, Jeff added `owner=$(id -un)' option to make for both
make all and make install (the first was wrong -- uucp
expect their files owned by building user, not uucp
as it should after this change).   But Makefile attempts
to do chown ${owner}.${owner} (i.e. changing the group also),
so if building user have no corresponding "user group" (as in
my case), chown will fail in the same way as without this
addition parameter.

I will not attach a patch (it is trivial), but suggest
removing back owner= parameter and adding this two lines
to .spec after configure or at the end of %prep (in latter
case Makefile should be changed to Makefile.in):

  sed 's|chown |echo chown |' Makefile > Makefile.tmp
  mv -f Makefile.tmp Makefile

This will just strip away chown calls.  (Just adding a comment
before chown will not cure the problem but will cause syntax errors).
The proper way to this is to replace chown (and chmod etc) with
$CHOWN (and $CHMOD etc) variables in Makefile(.in) and adding
parameter CHOWN=: to make command line...

Comment 1 Jeff Johnson 2001-01-06 10:30:47 UTC
Fixed by building with
	owner=uucp
but installing with
	owner=$(id -u)
and insuring that %files has the correct owners.

Package is uucp-1.06.1-26.

Comment 2 Michael Tokarev 2001-01-06 23:33:06 UTC
Hm... :)  Here it is, at my system:

 mjt$ id
 uid=101(mjt) gid=100(users) groups=100(users),56(bckp),60(dba),101(ekisadm)
 mjt$ getent group mjt
 mjt$ _

there is no such group named `mjt', while my uid *is* mjt.  Yes, by default
redhat creates personal group for each user, but I don't like this policy.
With this, uucp install will again fali, since it will try to
  chown mjt.mjt FILE,
with
  chown: mjt:mjt: invalid group
error message.

I again recommend those two lines that already has been recommended... :)


Comment 3 Eido Inoue 2001-08-10 03:18:20 UTC
understood. in addition to doing a owner=$(id -un), we'll create a group=$(id
-gn) and have the chowns use the new shell variable for the group and not $(owner)