From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,fb0d8437c2534161 X-Google-Attributes: gidfee84,public From: mooney@dogbert.cc.ndsu.NoDak.edu (Tim Mooney) Subject: Re: Who sets perms on /dev/ttyp* files? Date: 1996/08/07 Message-ID: <4uamml$v11@dogbert.cc.ndsu.NoDak.edu>#1/1 X-Deja-AN: 172827967 references: <4u5fc9$3g3@solaris.cc.vt.edu> content-type: text/plain; charset=US-ASCII organization: North Dakota Higher Education Computing Network (NDHECN) mime-version: 1.0 newsgroups: comp.unix.osf.osf1 In article <4u5fc9$3g3@solaris.cc.vt.edu>, Randy Marchany wrote: > We're running Dec Unix 3.2c and have run across a little problem. Our > umask is set 7077 and we've noticed that when someone logs in, the perms > for their ttyp files are 620. Example: > > crw--w---- 1 marchany terminal 6, 1 Aug 5 14:22 ttyp1 > crw--w---- 1 william terminal 6, 2 Aug 5 14:21 ttyp2 > > Since we belong to the same group, I can delete his ttyp2 file and log > him out and he can do the same to me. Huh? 1) Being able to delete a file isn't controlled by the permissions on the file, it's controlled by the permissions on the directory the file resides in. If normal users are able to delete terminal files it's because of the permissions on /dev or /dev/pts, not because of permissions on the terminal files themselves. 2) Normal users should not be part of the `terminal' group. You seem to be implying that all your users belong to the terminal group. I hope that isn't the case. 3) Based on the listing you show above, you have another security problem on your system. If you have access to DEC support, get DEC's list of patches for 3.2c and scan for `security'. You'll find the patch I'm alluding to and installing it will circumvent another (probably bigger) security problem. > So, my question is: > who controls the umask setting for these files? My default umasks are > 7077 which should give me 0700 perms on the files. 1) You don't want a umask of 7077. 077 maybe, but not 7077. 2) umask only controls permissions on files you create. Since those /dev/ttyp? files already exist, the permissions on them are not affected by your umask. Permissions on the /dev/ttyp? file (and any files linked to it) are changed via chown() by some program (e.g. login) when you log in. 3) As I've explained, having `w' permission on a tty file isn't your problem, but if you want to turn that permission off, take a look at the man page for `mesg'. Adding mesg n to /etc/profile will remove `w' permission for all people that use a sh-like shell, unless they run mesg y in their shell init files. That's not going to fix the problem you're most concerned with though. > What part of the OS > set the group perms to write access? login, or a similar process (dtlogin uses Xstartup & Xreset, xdm uses GiveConsole and TakeConsole, etc). > This appears to be a default problem with DEC Unix. We've checked a > number of DEC boxes here and at other sites and this shows up on all of > them. Try installing the security patch I alluded to above and see if it fixes it. > Needless to say, my users have discovered this 'feature'. If rm /dev/ttyp1 works for a normal user then so does rm /dev/null or whatever. This means you have more problems than you think. Tim -- Tim Mooney mooney@toons.cc.ndsu.NoDak.edu Information Technology Services (701) 231-1076 (Voice) Room 242-J1, IACC Bldg. (701) 231-8541 (FAX) North Dakota State University, Fargo, ND 58105