From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199802111938.UAA05294@stefan.sime.com> Date: Wed, 11 Feb 1998 20:38:05 +0100 From: Stefan Traby Subject: Re: Length of UID and GID in Alpha-Linux Hi Andreas ! > drwxr-xr-x 2 42949672 42949672 1536 Feb 11 14:01 worknotes > drwxr-xr-x 2 nobody nogroup 1536 Feb 11 14:01 worknotes > (nobody/nogroup is defined there as -2 in /etc/passwd and /etc/group) > I think 42949672 is a special creation from 4294967274, -2 witten as unsigned > integer with 32 bits. Since then I thought Unix is using 16 bit UIDs, but does Yes, the last two digits are cutted of because names are normally not longer than 8 characters and 10 characters would destroy the nice formatted output , but ... > Alpha-Linux uses 32 bits now? Maybe a workaround for better alignment? ... why did you ask ? simply compare /usr/src/linux/include/asm-i386/stat.h against /usr/src/linux/include/asm-alpha/stat.h You see "unsigned short st_uid" for i386 and "unsigned int st_uid" for alpha. Also note that uid_t is different on both systems, so getuid() and friends return "unsigned short" on i386 and "unsigned int" on alpha, but both systems return uid_t (the definition of uid_t may be different on different systems and POSIX says only that uid_t will be returned). Some systems may have signed and some unsigned UID's. On your system it looks like: i386 <-> VFS<->NFS<->VFS <-> alpha 16Bit-Short <-> sign extended to 32 Bit (!?!) <-> displayed as unsigned 32) The sign extension is wanted for negative numbers, but reduces the usable range for unsigned 16Bit UID-Systems because clean unsigned systems don't need to force a sign extension !! I think that for portability reasons it's not a good idea to use signed UID's at all. The unsigned numbers within signed 16 Bit range (0-32767) would be a great idea and UID -2 (nobody) GID -2 (no[group|body]) isn't hardcoded in todays programs (getpwnam/_r(...)). RH 5.0 uses 99:99 for nobody:nobody and it's a ok so. I think that you don't have a UID of -2 on your AXP-RedHat System, so if you add one, you problem is solved but not the portable way. The better way is of curse to change your i386-S.u.S.E system. NFS uses UID numbers and not "user names". You should have a correct mapping. Hal Stern (author of "Managing NFS and NIS") says that 65534 should be used for systems that only accept unsigned UID's (this is -2 if interpreted as a 16Bit two's complement number); but I think that he simply missed the portability point and he had only 16bit-UID systems in mind. BTW, i386 and alpha GNU-Linux-Systems have only 8-Bit minor/major numbers so you can expect problems if you make a NFS-root tree on a GNU-Linux machine for a system with 16-Bit minor/major numbers... -- ciao - Stefan Stefan Traby phone: +43-3133-6107-2 Mitterlasznitzstr. 13 fax: +43-3133-6107-9 8302 Nestelbach mailto://stefan@sime.com Austria -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com