home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.wizards
- Path: sparky!uunet!krfiny!jeffj
- From: jeffj@krfiny.uucp (J. Jonas)
- Subject: correcton: restricting users
- Message-ID: <1992Aug27.180317.16677@krfiny.uucp>
- Summary: use group id to deny access
- Organization: Jeff's house of computer pieces
- Date: Thu, 27 Aug 1992 18:03:17 GMT
- Lines: 62
-
-
- In article <928@gofish.Stars.Reston.Unisys.COM> dymm@cards.com (David Dymm) writes:
- >I would like to set up a restricted directory tree
- >on my Sun 4 system. That is, certain users, when logging on,
- >would be placed into accounts that would be located in a
- >directory tree that would not have access to the rest of
- >the system directory structure. ...
-
- The way my college did this was to create the restricted users
- in the 'peon' group-id.
- >All restricted directories were owned by group peon but with NO permissions.
- Correction: no GROUP permissions
-
- That way, owner and all other have access but NOT peon.
- Although this is contradictory to the intent of permission GRANTING
- vs. permission denial, it works.
-
- ex: /bin2 had commands that were not for peon use (moved over from /bin)
- dr-x---r-x 2 bin peon 1664 Aug 26 16:14 /bin2
-
- Permission checking uses the logic
- if (effective UID == file UID)
- if (file's owner permissions allows access)
- ok
- else
- fail
- if (effective GID == file GID)
- if (file's group permissions allows access)
- ok
- else
- fail
- if (file's other permissions allows access)
- ok
- else
- fail
-
- This means that denying group access stops the peons cold, even though
- 'other' allows access.
- Had the logic been to 'or' all the lower permissions, then access
- denial would not be possible.
- But Unix says "if you're the owner, only the owner's permissions apply
- to you, even though others may have greater access priviledges".
-
- As already mentioned an other postings, using the restricted shell also helps.
- I'm not sure if it was fixed, but there was a bug in how the shell
- determined if it was restricted or not.
- The old code checked for an 'r' in argv[0]. Anywhere in argv[0].
- This bit me when a login for 'smart' (a teaching program) used
- a C program that used 'system' to do something.
- The subshell inherited the argv[0] of 'smart' and since it contained
- an 'r', it went into restricted shell mode.
- The workaround was to alter argv[0] to something without any 'r'.
-
- Set root is tricky becuase you need hard links for all things in /dev,
- /tmp and other things that are below the new root.
-
- - Jeffrey Jonas
- --
- --
- Jeffrey Jonas
-
- jeffj@synsys.uucp
-