[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dpkg 1.4.0.22.1 bug



>>> Maybe libc has been hacked for "compatibility" on x86 [ ... ]
>>
>>No.  From chown(2):

The x86 libc knows nothing of the lchown() call (though it appears the
manpage does). This is actually part of the problem, since the day that
the x86 libc realizes that there is a lchown() call things will break on
x86 as the do on the alpha today (since then it will call chown() for
chown() and lchown() for lchown(). The change of syscall numbers was
just a quick fix so that all you applications that expected chown() not
to follow symlinks wouldn't need immediate fixing).

>>| NOTES
>>|        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.
>>
>>I'm still convinced that the alpha kernel is wrong for not doing what
>>the i386 & m68k kernels are doing.
>
>I don't understand the syscall number issue. Does this mean that a
>program that calls chown will in fact run lchown? This cannot be the
>case, otherwise the new chown will be unavailable...

Yes, that is exatly what it means. On x86, lchown() has syscall number 16,
chown() is now number 182 (it used to be 16). On the alpha, chown() is 16
and lchown() is 208. (Incidentally, the 16 for chown() seems rather universal,
Solaris and SunOS use it for chown() as well). The way it works is that
when an application wants to do a chown() it tells the kernel "I want to do
function number 16 with these parameters". The kernel then executes function
number 16 (neither really know what function number 16 is). And yes, the new
chown() is unavailable on x86 (until someone recompiles libc so that it knows
about the new chown() and lchown() - and then stuff will start breaking on
x86 just the same way as it does on the alpha today).

I'll write something up for linux-kernel and see if it generates any
interesting responses.

Regards,
/Anders

-- 
 -- Of course I'm crazy, but that doesn't mean I'm wrong.
Anders Hammarquist   |       Mud at Kingdoms        | iko@netg.se
NetGuide Scandinavia |   telnet kingdoms.se 1812    | Fax: +46 31 50 79 39
http://www.netg.se   |                              | Tel: +46 31 50 79 40


--
To UNSUBSCRIBE, email to debian-alpha-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: