[OpenAFS] Solaris unlink removes AFS mount points

Renata Maria Dart Renata Maria Dart <renata@SLAC.Stanford.EDU>
Tue, 16 Mar 2004 15:32:31 -0800 (PST)


We just discovered that the unlink system call in Solaris will remove AFS 
mount points (i.e., unmount the AFS volume).  This can be demonstrated with
the unlink command.

    $ uname -a
    SunOS shire03 5.8 Generic_108528-27 sun4u sparc SUNW,Sun-Fire
    $ pwd
    /afs/slac.stanford.edu/u/sf/ljm/tmp/unlink_bug
    $ fs mkmount test_mount rzc.test.test
    $ fs lsmount test_mount
    'test_mount' is a mount point for volume '#rzc.test.test'
    $ unlink test_mount
    $ fs lsmount test_mount
    fs: File 'test_mount' doesn't exist
    Exit 1
    $ ls -ld test_mount
    test_mount: No such file or directory
    Exit 2

Note that the above example was executed by an ordinary user
account without root privileges.

We are running OpenAFS 1.2.10 on this particular solaris 8 system.
It should be noted that Solaris supports the POSIX option that
permits unlink to remove directories under some circumstances,
as described in the unlink(2) man page:

     The path argument must not name a directory unless the  pro-
     cess  has appropriate privileges and the implementation sup-
     ports using unlink() on directories.

For an ordinary filesystem, the root account has the "appropriate
privileges" to unlink directories.  However, root should have no
special privileges in AFS filesystems.  So we don't think that AFS 
should permit the unlink system call to remove AFS mount points either
for root or non-root users.

-Renata


 Renata Dart                         | renata@SLAC.Stanford.edu  
 Stanford Linear Accelerator Center  |    
 2575 Sand Hill Road, MS 97          | (650) 926-2848 (office)
 Stanford, California   94025        | (650) 926-3329 (fax)