Bug 14874 - uucp still won't build as non-root; last RH patch was wrong.
Summary: uucp still won't build as non-root; last RH patch was wrong.
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: uucp
Version: 1.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Eido Inoue
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-07-31 11:22 UTC by Michael Tokarev
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Clone Of:
Last Closed: 2001-01-06 23:33:10 UTC

Attachments (Terms of Use)

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@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 10:30:47 UTC
Fixed by building with
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,
  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)

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