Bug#333836: [Pkg-sysvinit-devel] Bug#333836: initscripts: mountvirtfs and checkroot.sh have SELinux issues

Thomas Hood jdthood at yahoo.co.uk
Fri Oct 14 08:20:55 UTC 2005


> Both mountvirtfs and checkroot.sh try to "touch" filesystem root nodes
> to verify that they are writeable.
[...]
> I mean, it's the question if we really NEED the touch at all.


checkroot.sh uses the function to tell whether or not /dev/shm is writable.
mountvirtfs uses the function to tell whether or not /dev is writable.
These tests could probably be eliminated or implemented in a different way.

Current code in checkroot.sh:

    if dir_writable /dev/shm ; then
        rm -f /dev/shm/root
        mknod /dev/shm/root
    else
        print error message
    fi

Possible alternative:

    if ! { rm -f /dev/shm/root && mknod /dev/shm/root ; } ; then
        print error message
    fi

Current code in mountvirtfs:

    if dir_writable /dev && [ ! -c /dev/ptmx ] ; then
        mknod /dev/ptmx
    fi

Possible alternative:

    if [ ! -c /dev/ptmx ] ; then
        mknod /dev/ptmx || :
    fi


-- 
Thomas Hood




More information about the Pkg-sysvinit-devel mailing list