From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,e7195b1f09081f9c X-Google-Attributes: gidfee84,public From: strange@zk3.dec.com (Steve Strange USG) Subject: Re: Problem with mode on symbolic links Date: 1996/01/28 Message-ID: #1/1 X-Deja-AN: 136779969 references: <3108CCD8.1546@spirit.com.au> organization: Digital Equipment Corp. newsgroups: comp.unix.osf.osf1 In article <3108CCD8.1546@spirit.com.au> Blair Phillips writes: > In the course of adding some entries to /sbin/rc3.d, I noticed that > any symbolic links I added had the protection rwxrwxrwx. > > chmod og-w or chmod 755 had no effect on this. I tried with umask 0 > as well as the normal umask 022, as I have a vague recollection that > umask affects chmod. > > I noted that most of the standard entries in rc3.d had rwxr-xr-x > protection, but some of them (e.g. nsr) had rwxrwxrwx. > > I'm not sure what security implication this has, but it doesn't do > anything for my peace of mind. > > Can anyone provide enlightenment?? It's the mode bits of the target of the symbolic link that are checked for file access, not the mode bits of the symlink itself. The symlink's mode bits are always ignored, so they are always created with mode 777. I'm not really sure why some of the symlinks in /sbin/rc3.d ended up with non-777 settings, but there is no reason for concern because the mode bits are never checked for file accesses anyway. I just checked a Digital UNIX T4.0 system, and all the symlinks in /sbin/rc3.d are 777, as they really should be. The only time the mode bits on a symlink would be potentially interesting is if you have a dangling symlink (target has been deleted), and you want to remove the symlink. In that case, you must be the owner of the symlink (or root) to be able to delete it. The one exception to symlink mode bits being ignored is DFS mount points. DFS mount are actually symlinks with a specific mode bit setting to distinguish them from regular symlinks. But they aren't used for file access checking in any case. Steve -- Steve Strange strange@zk3.dec.com Digital Equipment Corporation, Nashua, NH (603) 881-0595 Digital UNIX DCE DFS Development