aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc
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/rc
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/rc')
-rwxr-xr-xrc.d/rc14
1 files changed, 8 insertions, 6 deletions
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
}