Symlinks on read-only FS

Perry Hutchison perryh at pluto.rain.com
Tue Sep 19 18:02:16 PDT 2006


I've just noticed this, in ufs/ufs/ufs_vnops.c:ufs_access()

    /*
     * Disallow write attempts on read-only filesystems;
     * unless the file is a socket, fifo, or a block or
     * character device resident on the filesystem.
     */
    if (mode & VWRITE) {
            switch (vp->v_type) {
            case VDIR:
            case VLNK:
            case VREG:
                    if (vp->v_mount->mnt_flag & MNT_RDONLY)
                            return (EROFS);

Is the inclusion of VLNK here correct?  I would think that
only the target of the symlink should matter:  if it happens
to point onto a writable FS, the fact that the symlink itself
is on a ROFS should not matter.


More information about the freebsd-hackers mailing list