aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorFlorian La Roche <laroche@redhat.com>2002-07-10 08:58:44 +0000
committerFlorian La Roche <laroche@redhat.com>2002-07-10 08:58:44 +0000
commit78fd012ed58636caa076fa35b50c1001bb211b14 (patch)
tree88a047ed80881a968eaac176e5307599f3c217bf /rc.d
parent95ef94bed21f6812e2d879d354604c46b51b4016 (diff)
downloadinitscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.gz
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.bz2
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.tar.xz
initscripts-78fd012ed58636caa076fa35b50c1001bb211b14.zip
- better checks for backup files
Diffstat (limited to 'rc.d')
-rwxr-xr-xrc.d/init.d/single13
-rwxr-xr-xrc.d/rc14
-rwxr-xr-xrc.d/rc.sysinit1
3 files changed, 15 insertions, 13 deletions
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."
diff --git a/rc.d/rc b/rc.d/rc
index 40cf3188..33b6ed71 100755
--- a/rc.d/rc
+++ b/rc.d/rc
@@ -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.