Bug 14874 - uucp still won't build as non-root; last RH patch was wrong.
uucp still won't build as non-root; last RH patch was wrong.
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: uucp (Show other bugs)
1.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Eido Inoue
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-07-31 07:22 EDT by Michael Tokarev
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-06 18:33:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Michael Tokarev 2000-07-31 07:22:32 EDT
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@redhat.com>
- 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 05:30:47 EST
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 18:33:06 EST
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-09 23:18:20 EDT
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)

Note You need to log in before you can comment on or make changes to this bug.