bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Paul Eggert
On 11/14/11 11:12, Eric Blake wrote: > POSIX explicitly rejects (uid_t)(-1) as a valid UID. That depends on what one means by "valid". You're right about chown of course, but it's not clear that POSIX absolutely prohibits getuid from returning (uid_t) -1. And even if POSIX did prohibit that, GNU

bug#10045: Unix od command, reverses hex bytes in output

2011-11-14 Thread Bob Proulx
adad...@us.imshealth.com wrote: > On Red Hat, the od command reverses the hex bytes. > [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ cat a > 123456 > [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ od -cx a > 000 1 2 3 4 5 6 \n \0 > 3231 3433 3635 000a > > On HP-UX, it prints w

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Ludovic Courtès
Hi, Eric Blake skribis: > On 11/14/2011 11:54 AM, Paul Eggert wrote: [...] >>euid = geteuid (); >> - if (GETID_MAY_FAIL && euid == -1 && !use_real >> + if (euid < 0 && !use_real > > That is, how can this work? On systems where uid_t is signed, it makes > sense, but on system

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Roland McGrath
I think you can portably detect the failure case with the errno=0 method, rather than relying on #ifdef.

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Eric Blake
On 11/14/2011 11:54 AM, Paul Eggert wrote: >else > { > + /* On GNU hosts, getuid etc. can fail and return -1. On POSIX > + hosts, such failures are not allowed and (uid_t) -1 may be a > + valid UID if uid_t is unsigned. That doesn't read correctly. You are correct t

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Paul Eggert
On 11/14/11 00:52, Jim Meyering wrote: > I tested this on a gnu/linux system and found that I could indeed create a > user with a UID of 2^32-1 If we really want to support that, there would be a lot of other coreutils code that would need fixing, no? For example, the command chown 4294967295

bug#10045: Unix od command, reverses hex bytes in output

2011-11-14 Thread Eric Blake
tag 10045 notabug thanks On 11/14/2011 07:56 AM, adad...@us.imshealth.com wrote: > On Red Hat, the od command reverses the hex bytes. > [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ cat a > 123456 > [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ od -cx a > 000 1 2 3 4 5 6 \n \0 >

bug#10045: Unix od command, reverses hex bytes in output

2011-11-14 Thread ADAdamo
On Red Hat, the od command reverses the hex bytes. [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ cat a 123456 [lrxdusr@cdtslrx122d PatientLoadDataFiles]$ od -cx a 000 1 2 3 4 5 6 \n \0 3231 3433 3635 000a On HP-UX, it prints what you'd expect. plr02:lrxiusr:/plr02_users/lrx

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Jim Meyering
Ludovic Courtès wrote: ... >> However, with the patch below, it does this: >> >> $ ./id -u >> 4294967295 > > OK, good to know. Thank *you* for persevering! I'll take that as an ACK ;-) Pushed.

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Ludovic Courtès
Hi, "Alan Curry" skribis: > Ludovic =?UTF-8?Q?Court=C3=A8s?= writes: >> >> OTOH, on POSIX-conforming systems (which includes GNU/Linux, so it may >> be the majority of systems in use), -1 may well be a valid UID/GID. > > That's a bizarre statement. > > 3.428 User ID > > A non-negative integ

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Ludovic Courtès
Hi Jim, Jim Meyering skribis: > Ludovic Courtès wrote: > >> Hi Paul, >> >> Paul Eggert skribis: >> >>> On 11/12/11 13:48, Ludovic Courtès wrote: +#ifdef __GNU__ + if (euid == -1 && !use_real + && !just_group && !just_group_list && !just_context) +error

bug#10043: Re : bug#10043: ... md5sum ... : many thansk for a so quick answer ! :-)

2011-11-14 Thread Castet JR
Re : bug#10043: ... md5sum ... :   many thansk for a so quick answer ! :-) Have a nice day pc --- En date de : Lun 14.11.11, GNU bug Tracking System a écrit : De: GNU bug Tracking System Objet: bug#10043: closed (Re: bug#10043: md5sum improvment suggestion) À: "Castet JR" Date: Lundi 14

bug#10043: md5sum improvment suggestion

2011-11-14 Thread Pádraig Brady
tags 10043 notabug On 11/14/2011 08:56 AM, Castet JR wrote: > md5sum improvment suggestion > > Let assume this: > > find /lib -type f -name '*dll' |head -n5 >a0.a > > cat a0.a > > /lib/aspell-0.60/context-filter.dll > /lib/aspell-0.60/email-filter.dll > /lib/aspell-0.60/nroff-filter.dll >

bug#10043: md5sum improvment suggestion

2011-11-14 Thread Castet JR
md5sum improvment suggestion Let assume this:   find /lib -type f -name '*dll' |head -n5 >a0.a   cat a0.a /lib/aspell-0.60/context-filter.dll /lib/aspell-0.60/email-filter.dll /lib/aspell-0.60/nroff-filter.dll /lib/aspell-0.60/sgml-filter.dll /lib/aspell-0.60/tex-filter.dll md5sum checks file

bug#10021: [PATCH id] Add error-checking on GNU

2011-11-14 Thread Jim Meyering
Ludovic Courtès wrote: > Hi Paul, > > Paul Eggert skribis: > >> On 11/12/11 13:48, Ludovic Courtès wrote: >>> +#ifdef __GNU__ >>> + if (euid == -1 && !use_real >>> + && !just_group && !just_group_list && !just_context) >>> +error (EXIT_FAILURE, errno, _("cannot get effective