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

Erich Schubert erich at debian.org
Fri Oct 14 01:39:12 UTC 2005


Hi,
Oh, sorry, I confused two bugs I have opened...

Come on, it's not that hard...

How about:

dir_writable () {
    if test -x /usr/sbin/selinuxenabled && /usr/sbin/selinuxenabled;
    then
        if [ -d "$1/" ] && [ -w "$1/" ]
        then
            return 0
        fi
        return 1
    fi
    if [ -d "$1/" ] && [ -w "$1/" ] && touch -a "$1/" 2>/dev/null
    then
        return 0
    fi
    return 1
}

Just use the code I posted in the original bug report to see if you are
on SELinux, then don't attempt the touch... I mean, it's the question if
we really NEED the touch at all. Maybe we could just use

dir_writable () {
    if [ -d "$1/" ] && [ -w "$1/" ]
    then
        return 0
    fi
    return 1
}

(which would work on SELinux just fine)
and rely on the administrator not having broken his system?

best regards,
Erich Schubert
-- 
   erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
       The best things in life are free: Friendship and Love.       //\
           Es ist besser, geliebt und verloren zu haben,            V_/_
                   als niemals geliebt zu haben.





More information about the Pkg-sysvinit-devel mailing list