Mail Archives: djgpp-workers/2001/05/13/06:59:04
On Sun, 13 May 2001, Richard Dawe 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.
Sorry, I'm not following: are you describing changes in the mainline
Fileutils code (probably not) or your modifications? Also, when you say
``Beta 2 would set etc.'', do you mean those are changes that you
introduced now and which were not in the beta for which I reported the
problem, or do you mean these changes are already in the beta I've seen?
> 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.
I'm not sure this is the best plan. The files in lib/ are used by other
GNU packages, so any changes to them might break something else.
So I suggest to discuss the details: what exactly do you think is
wrong in lib/, and why?
- Raw text -