Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!ll-xn!mit-eddie!gatech!ulysses!ggs From: ggs@ulysses.UUCP Newsgroups: comp.unix.wizards Subject: Re: umask under 4.3 BSD Message-ID: <2625@ulysses.homer.nj.att.com> Date: Mon, 1-Jun-87 21:02:01 EDT Article-I.D.: ulysses.2625 Posted: Mon Jun 1 21:02:01 1987 Date-Received: Thu, 4-Jun-87 01:16:18 EDT References: <7554@brl-adm.ARPA> Organization: AT&T Bell Laboratories, Murray Hill Lines: 33 Summary: it's in /sys/sys/init_main.c In article <7554@brl-adm.ARPA>, eichelbe@nadc.arpa writes: > I am running 4.3 BSD on a VAX 11/780. Does anyone know how I could > change the system-wide "umask" so when I person does something like > echo "stuff" > x > > x will have the file permission 0600 and not 0644? I have source code > for the system. > > Thanks. > Jon Eichelberger > eichelbe@NADC.ARPA Just in case you wanted a straight answer instead of a lot of philosophy: The system-wide default for the umask is set in /sys/sys/init_main.c, line 33, from a parameter, CMASK, that is set in /sys/h/param.h. To change the global value, either change the value in the header file and re-build the kernel or use adb to patch the variable "cmask" in the bootable kernel. In either case, you have to re-boot to have the change take effect. To patch the value to 0066 with adb: adb -w /vmunix - cmask?W 0o066 Doing the change here has the added benefit that files created by rsh'ed commands also get the desired umask; unfortunately, some of the daemons do not set good defaults. One could probably also fix the problem by setting the default in "init". -- Griff Smith AT&T (Bell Laboratories), Murray Hill Phone: 1-201-582-7736 UUCP: {allegra|ihnp4}!ulysses!ggs Internet: ggs@ulysses.uucp