delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/05/13/06:48:18

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3AFE663D.9CA00263@phekda.freeserve.co.uk>
Date: Sun, 13 May 2001 11:47:25 +0100
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.17 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: ANNOUNCE: Fileutils 4.0 beta 2
References: <200104241623 DOT MAA11598 AT delorie DOT com> <8011-Thu26Apr2001140530+0300-eliz AT is DOT elta DOT co DOT il> <3AE8902F DOT 79F65B0E AT phekda DOT freeserve DOT co DOT uk> <9003-Fri27Apr2001094924+0300-eliz AT is DOT elta DOT co DOT il>
Reply-To: djgpp-workers AT delorie DOT com

Hello.

Eli Zaretskii wrote:
> 
> Richard Dawe wrote:
>
> > Eli Zaretskii wrote:
> >
> > >     - The messages printed by chown and chgrp are different from
> > >       those printed by v3.16: the previous port pretended that the
> > >       owner/group _did_ change, while this port's message says the
> > >       owner/group were retained, but cites the new owner/group. 
> > >       This is misleading, IMHO.  What is the reason for this change?
> >
> > Actually, I made them behave like this, after we discussed some things
> > in a thread entitled "Porting Fileutils 4.0: chgrp, chown, df",
> > starting on 2000-01-10. chown() always succeeds. Before carrying out
> > the modification operation, chgrp sets $GROUP to the desired group;
> > afterwards it sets it back. In other words, the user is considered to
> > own everything and belongs to every group.
[snip]
> The trick to set GROUP etc. was meant to avoid patching chgrp's and
> chown's code where they set the owner and the group.  I do think it is
> better to say the ownership was changed, not that it was retained.
> Perhaps removing GROUP from the environment right after the call to
> chgrp library function will do that?

The code in chown, chgrp uses uids and gids, to determine whether the file
ownership has changed. Beta 2 would set the user and group names in
advance, so that all users and groups would appear to have the same uids,
gids. So modifying the environment after calling chown() would not have
helped, since the uid, gid would always be the same.

Anyway, I have fixed it: chown, chgrp now work like they did in Fileutils
3.16. Things were complicated by the fact Fileutils 4.0 did have some
DJGPP-specific code in lib/*.c. It just seems to do the wrong thing for
Fileutils. I removed that code and my patches to src/chown.c, src/chgrp.c.
I reinstated some of your fixes to lib/userspec.c - the ones that return
the uid, gid as 2*current uid, gid when parsing the user specification.
src/chgrp.c needed an additional patch.

Thanks, bye, Rich =]

-- 
Richard Dawe
http://www.phekda.freeserve.co.uk/richdawe/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019