lkml.org 
[lkml]   [1999]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectAugmenting the number of users
Following those discussions about extending uid and gid to 32 bits ...

The basic problem to extent the number of users beyond 65534 is the way
the unix perms are interpreted :
lets says perms are noted xxxyyyzzz
xxx apply if the calling process has the same uid
yyy apply if the calling process has the same gid
zzz apply otherwise.

Thus, if two users have the same uid and different gid, they could modify
each other file. Changing a bit the way those permissions are interpreted
would permit to augment the number of users :
-let say we need a number of special, or administrative UID and GID (man,
modem, video, sound, ...). 64 would be enough -> we have 10 bits left in
UID and GID

-now, interpret those perms a bit differently :
if (uid < 128 || gid < 128 ||euid < 128 || egid < 128)
apply_old_rules() /* avoid problems with suid/sgid programs */
else
if (uid == file_uid && gid == file_uid)
/* ^^^^^^^^^^^^^^^^^^ */
/* interpret the xxx part */
apply_xxx_rules()
else if (gid == file_gid)
/* interpret the yyy part */
apply_yyy_rules()
else
/* interpret the zzz part, EVEN IF UIDS are identical ! */
apply_zzz_rules()

This way, two users with same uid and different gid won't be allowed to
modify each others files : the zzz rule will apply. I think this is
coherent with the unix philosophy of having groups of users.
Advantage :
- an unique space of 2^20 users (10 bits uid, 10 bits gid)
- I'm not an unix gourou, but I suppose the kernel has the last word
about access permissions. Using the new strategy would imply kernel
modifications, nothing more
- Nothing else to modify for libs or applications, no compatibility probs
- would give a smooth transition to full 32 bit uid and gid

Security probs :
The sysadmin has to be carefull about which user can do a newgrp(). May be
all the groups should be password protected, to avoid malicious use.

Pascal A. Dupuis

--
linux : un noyau
windows : des pépins


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:49    [W:0.030 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site