diff options
-rw-r--r-- | initscripts.spec | 1 | ||||
-rwxr-xr-x | rc.d/init.d/single | 13 | ||||
-rwxr-xr-x | rc.d/rc | 14 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 1 |
4 files changed, 16 insertions, 13 deletions
diff --git a/initscripts.spec b/initscripts.spec index ef9d8823..6103a611 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -249,6 +249,7 @@ rm -rf $RPM_BUILD_ROOT - change grep for ONBOOT= #63903 - allow building with a cross-compiler #64362,#64255 - faster check in network-functions:check_default_route() +- better checks for backup files * Fri Jul 05 2002 Florian La Roche <Florian.LaRoche@redhat.de> - rc.sysinit: do not load raid modules unless /etc/raidtab exists diff --git a/rc.d/init.d/single b/rc.d/init.d/single index df645e7e..64c6806d 100755 --- a/rc.d/init.d/single +++ b/rc.d/init.d/single @@ -29,15 +29,16 @@ fi # If they want to run something in single user mode, might as well run it... for i in /etc/rc1.d/S[0-9][0-9]* ; do # Check if the script is there. - [ -f "$i" ] || continue + [ -x "$i" ] || continue - # Don't run [KS]??foo.{rpmsave,rpmorig} scripts - [ "${i%.rpmsave}" != "$i" ] && continue - [ "${i%.rpmorig}" != "$i" ] && continue - [ "${i%.rpmnew}" != "$i" ] && continue + # Reject backup files and files generated by rpm. + case "$1" in + *.rpmsave|*.rpmorig|*.rpmnew|*~|*.orig) + continue;; + esac [ "$i" = "/etc/rc1.d/S00single" ] && continue $i start -done +done # Now go to the single user level. echo $"Telling INIT to go to single user mode." @@ -10,13 +10,15 @@ # check a file to be a correct runlevel script check_runlevel () { - # Check if the script is there. - [ -f "$1" ] || return 1 + # Check if the file exists at all. + [ -x "$1" ] || return 1 - # Don't run [KS]??foo.{rpmsave,rpmorig} scripts - [ "${1%.rpmsave}" != "$1" ] && return 1 - [ "${1%.rpmorig}" != "$1" ] && return 1 - [ "${1%.rpmnew}" != "$1" ] && return 1 + # Reject backup files and files generated by rpm. + case "$1" in + *.rpmsave|*.rpmorig|*.rpmnew|*~|*.orig) + return 1 + ;; + esac return 0 } diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 2cd1d7de..3f5b8f0d 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -59,7 +59,6 @@ if grep -q /initrd /proc/mounts && ! grep -q /initrd/loopfs /proc/mounts ; then fi # Configure kernel parameters - action $"Configuring kernel parameters: " sysctl -e -p /etc/sysctl.conf # Set the system clock. |