Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!ames!hc!beta!cmcl2!brl-adm!adm!bzs@bu-cs.bu.EDU From: bzs@bu-cs.bu.EDU (Barry Shein) Newsgroups: comp.unix.wizards Subject: umask under 4.3 Message-ID: <7582@brl-adm.ARPA> Date: Fri, 29-May-87 12:31:05 EDT Article-I.D.: brl-adm.7582 Posted: Fri May 29 12:31:05 1987 Date-Received: Sun, 31-May-87 15:53:54 EDT Sender: news@brl-adm.ARPA Lines: 33 I always figured a good way to do these kinds of things (set the umask etc) would be to use a program other than the shell in a user's login entry and then use that to exec or fork (if there's post-processing desired, I used that once to produce summary session accounting records so I could shut off per-process accounting but still produce short summaries with minimal disk space, just write out the user's getrusage() structure when the shell fork returns) the user's shell. It's probably a tiny process that gets swapped right out if need be as it just sits in a wait() (if forked, if the shell is exec'd it's gone.) This doesn't require sources and seems much more flexible, just change a user's passwd entry to something like: johndoe::uid:gid:gecos:homedir:/bin/shell It could be setuid if need be and it would be easy to check argv[0] as a hook for which shell to start, /bin/cshell etc. You could re-work environment variables before starting the user's shell, limits, whatever, even install things like permissible login time windows or other security hooks (secondary password, secure ttys etc.) Might have to play with chsh but other than that I don't think there would be much problem. There are a number of details, some poorly documented (eg. args that need to be passed) but fairly easily determined heuristically (the first cut could dump argv and envp.) I dunno, seems like a nice and general hook. Could be a good net.sources contribution by someone all full of hooks for typical needs. -Barry Shein, Boston University