This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [PATCHES] glibc 2.1, Linux, and chown



Philip Blundell <philb@gnu.org> writes:

> >So, here are diffs to port the powerpc solution to sparc32, m68k, and 
> >alpha (the Debian glibc maintainer has received various requests to 
> >add chown patches (usually derivitives of the i386 kluge :() for each 
> >of those architectures. I agree that the patches are needed, and I'd 
> >prefer not to diverge from the upstream sources if at all possible). 
> 
> Something like this might be appropriate for ARM as well, I guess.  My grasp 
> of the issues that are actually involved here is a bit limited though.  Jim, 
> do you have any suggestions?

I'm not entirely clear on the issues.  I'll repeat my limited
understanding here, and ask for corrections, because I almost
certainly have some facts wrong.

There was a huge debate about this stuff on linux-kernel in the
spring, most of which I didn't read.

Here's what the chown (2) manpage says:

     In versions of Linux prior to 2.1.81  (and  distinct  from
     2.1.46), chown did not follow symbolic links.  Since Linux
     2.1.81, chown does follow symbolic links, and there  is  a
     new  system  call  lchown  that  does  not follow symbolic
     links.  Since Linux 2.1.86, this new call  (that  has  the
     same  semantics as the old chown) has got the same syscall
     number, and chown got the newly introduced number.

There were differences of opinion on how this was to be handled
between the various architectures.  It was never settled
satisfactorily.

Programs which relied on the old behaviour of chown break with the new
behaviour.  Very few programs relied on the old behaviour - dpkg is
one of the few that did.  This is a big problem for Debian.  I don't
believe it's a big problem for RPM-based distributions.

The problem can be fixed in either the kernel (revert chown syscall
behaviour), glibc (varying approaches), or userspace (fix applications
to not rely on old behaviour).

There is a lot of finger pointing going on (as you can see).  It
varies by architecture (yuck).

For i386, I believe compatibility has not been broken, and there must
be some "kluge" that Joel referred to that enables Debian users to use
2.0.x and 2.1.x kernels without breaking dpkg.  I'm not clear on the
details.

Alpha is different.  Debian's dpkg doesn't work right on 2.1.x kernels
because of it (unless it's been fixed recently).  It could have been
fixed a long time ago in dpkg, but the dpkg maintainers must feel that
it is a glibc issue.  The glibc maintainer for Alpha obviously feels
otherwise, and wants to break compatibility.

The argument for breaking compatibility is based on the reasoning that
the old chown behaviour with symlinks was really a bug, and userspace
programs should be patched to workaround that (rather than carrying
forward a buggy behaviour).

The argument for not breaking compatibility is that the old chown
behaviour was valid (it's undefined in the specs), and we shouldn't be
breaking userspace applications.

Both are valid viewpoints, so there's a really messy impasse.

Because dpkg is affected, it gets pretty messy for Debian.  It is
possible to patch dpkg.  But if a user decides to upgrade their
kernel, and doesn't get the fixed dpkg first, they might lose their
ability to upgrade their system.  That's one reason the dpkg
maintainers prefer not breaking compatibility.

It sounds like Debian has patched the other architectures to work with
2.1.x as well.  Joel wants these merged in.  This is where it gets
interesting, I think.

For teh Debian ARM port, I don't think anybody has tried dpkg with a
2.1.x kernel, so the issue hasn't reared it's ugly head (yet).  We're
probably affected as well.

Hopefully, everybody can agree on a single solution to the problem -
either fix the problem in the kernel, glibc, or userspace (dpkg).
Hopefully, this can be done before Linux 2.2 and glibc 2.1 are
released.  Somebody is probably going to have to back down.

Cheers,

 - Jim



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]