[Pkg-sysvinit-devel] Bug#333836: Eliminating dir_writable

Thomas Hood jdthood at yahoo.co.uk
Mon Nov 21 15:49:16 UTC 2005


I have checked in the following change, which eliminates use of dir_writable.
Will selinux be any happier with the new code?

--- checkroot.sh        (revision 203)
+++ checkroot.sh        (working copy)
@@ -144,13 +143,16 @@
                        if [ "`mountpoint -qx /dev/root`" = "4:0" ]
                        then
                                rootdev=/dev/root
-                       elif dir_writable /dev/shm
-                       then
-                               rm -f /dev/shm/root
-                               mknod -m 600 /dev/shm/root b ${rdev%:*} ${rdev#*:}
-                               rootdev=/dev/shm/root
                        else
-                               rootfatal=yes
+                               if \
+                                       rm -f /dev/shm/root \
+                                       && mknod -m 600 /dev/shm/root b ${rdev%:*} ${rdev#*:} \
+                                       && [ -e /dev/shm/root ]
+                               then
+                                       rootdev=/dev/shm/root
+                               else
+                                       rootfatal=yes
+                               fi
                        fi
                fi
        fi
Index: mountvirtfs
===================================================================
--- mountvirtfs (revision 203)
+++ mountvirtfs (working copy)
@@ -177,9 +177,14 @@
                fi
                if [ -d /dev/pts ]
                then
-                       if dir_writable /dev && [ ! -c /dev/ptmx ]
+                       if [ ! -c /dev/ptmx ]
                        then
                                mknod --mode=666 /dev/ptmx c 5 2
+                               ES=$?
+                               if [ "$ES" != 0 ]
+                               then
+                                       log_warning_msg "Failed making node /dev/ptmx with error code ${ES}."
+                               fi
                        fi
                        domount devpts "" /dev/pts -ogid=$TTYGRP,mode=$TTYMODE
                fi




More information about the Pkg-sysvinit-devel mailing list