* Length of UID and GID in Alpha-Linux
@ 1998-02-11 14:45 Dr. Andreas S. Tomiak
0 siblings, 0 replies; 4+ messages in thread
From: Dr. Andreas S. Tomiak @ 1998-02-11 14:45 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 806 bytes --]
Hi,
I think it´s a little off topic, but:
I´ve mounted a nfs filesystem which has files with UID=-2 and GID=-2. If I do a
ls -l on RedHat 5.0 with kernel 2.1.82 on my Sable I get:
drwxr-xr-x 2 42949672 42949672 1536 Feb 11 14:01 worknotes
on an SuSE 5.1-Linux system (Intel based)
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
Alpha-Linux uses 32 bits now? Maybe a workaround for better alignment?
Andreas
--
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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Length of UID and GID in Alpha-Linux
@ 1998-02-11 19:38 Stefan Traby
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Traby @ 1998-02-11 19:38 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <980211154552.ZM17254@dixtat.hmi.de>]
[parent not found: <stefan@sime.com>]
* Re: Length of UID and GID in Alpha-Linux
[not found] <stefan@sime.com>
@ 1998-02-12 9:24 ` Dr. Andreas S. Tomiak
0 siblings, 0 replies; 4+ messages in thread
From: Dr. Andreas S. Tomiak @ 1998-02-12 9:24 UTC (permalink / raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1412 bytes --]
Hi Folks,
I´ve no problem to use unsigned numbers for UIDs and GIDs because we enforce a
uniform name space in our whole net. SuSE is using -2, but also the UCX NFS
server under VMS uses this sort of Nobody UID. The best is to use UIDs/GIDs in
the range from 0 to 32767 only. In my opinion 99/99 for nobody/nogroup is not
the best:
I´ve created as root on a Solaris 2.6 machine a file on a non-root exported
filesystem from a RedHat-Linux Alpha. Root squashing occurs and I´ve read:
#touch xxx
# ls -l
total 4
drwxrwxrwx 2 dat hmiduser 1024 Feb 12 1998 .
drwxr-xr-x 3 dat hmiduser 1024 Feb 12 1998 ..
-rw-r--r-- 1 99 other 0 Feb 12 09:04 xxx
#
In /etc/group on the Sun:
other::1:
nogroup::65534:
On the Alpha directly:
dat@dalph1.hmi.de-116>ls -l /chmi/dalph1/hmiduser/dat/nfstest/
total 0
-rw-r--r-- 1 nobody bin 0 Feb 12 09:04 xxx
On a SuSE 5.1 system over NFS:
dat@dixtat-78>ls -l /chmi/dalph1/hmiduser/dat/nfstest/
total 0
-rw-r--r-- 1 99 bin 0 Feb 12 09:04 xxx
dat@dixtat-79>
Very confusing.
The NFS server will use a name (nobody) but not a number for root_squashing,
but uses numbers only over the net. Using the number 65534 for nobody would be
the best here, I think.
Andreas
--
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~1998-02-12 9:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-02-11 14:45 Length of UID and GID in Alpha-Linux Dr. Andreas S. Tomiak
-- strict thread matches above, loose matches on Subject: below --
1998-02-11 19:38 Stefan Traby
[not found] <980211154552.ZM17254@dixtat.hmi.de>
1998-02-11 19:39 ` Richard Henderson
[not found] <stefan@sime.com>
1998-02-12 9:24 ` Dr. Andreas S. Tomiak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox