Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site bu-cs.UUCP Path: utzoo!linus!decvax!genrad!panda!talcott!harvard!bu-cs!bzs From: bzs@bu-cs.UUCP (Barry Shein) Newsgroups: net.unix-wizards Subject: Re: Question about uid check in csh's source command Message-ID: <832@bu-cs.UUCP> Date: Tue, 31-Dec-85 15:43:56 EST Article-I.D.: bu-cs.832 Posted: Tue Dec 31 15:43:56 1985 Date-Received: Wed, 1-Jan-86 05:15:18 EST References: <2098@phri.UUCP> Organization: Boston Univ Comp. Sci. Lines: 38 > I am trying to figure out a way to make csh read a system-wide >.login file before reading $HOME/.login. Looking at the source for csh >(/usr/src/bin/csh/sh.c) it seems all you have to do is just add one line >to the startup code. Where it says: > > if (loginsh) { > srccat(value("home"), "/.login"); > } > >I guess I should just be able to add another call to srccat to read in >/usr/lib/csh.login or something like that. Reading a bit further into the >code you find out that srccat won't source a file unless it has the same >uid or gid as you do. This I don't understand; why should it care? >-- >Roy Smith I added exactly that as: (/usr/src/bin/csh/sh.c, same place as he mentions) /* BZS - srcunit/open does enuf access checking. Source a global .login file if it exists. Cannot use srccat et al cause they demand we be the owner. */ -> srcunit(dmove(open("/usr/lib/.login",0),-1),0,0) ; /* end BZS */ srccat(value("home"), "/.login"); a while ago, so guess I ran into the same trubble (tho this works exactly as you wish I believe.) I assume the owner check is to prevent imposter .login scripts from being eaten, reasonable I guess (tho if they managed to write into your home directory...oh well, go figger.) -Barry Shein, Boston University