aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2005-07-14 04:00:56 +0000
committerFrederic Lepied <flepied@mandriva.com>2005-07-14 04:00:56 +0000
commit7e63b05d51c7e51208fa61578e9b2000558443d9 (patch)
tree51019c1019bffdf40639e490bc04c6d4257826a0
parent1fe017ba39175b54efe5d7f00dcd2fa8347a6dcb (diff)
downloadmsec-7e63b05d51c7e51208fa61578e9b2000558443d9.tar
msec-7e63b05d51c7e51208fa61578e9b2000558443d9.tar.gz
msec-7e63b05d51c7e51208fa61578e9b2000558443d9.tar.bz2
msec-7e63b05d51c7e51208fa61578e9b2000558443d9.tar.xz
msec-7e63b05d51c7e51208fa61578e9b2000558443d9.zip
shell variable protection (Frederic Marmond).
-rwxr-xr-xcron-sh/security_check.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/cron-sh/security_check.sh b/cron-sh/security_check.sh
index faadc53..ec6bbeb 100755
--- a/cron-sh/security_check.sh
+++ b/cron-sh/security_check.sh
@@ -64,7 +64,7 @@ list=".netrc .rhosts .shosts .Xauthority .gnupg/secring.gpg \
.pgp/secring.pgp .ssh/identity .ssh/id_dsa .ssh/id_rsa .ssh/random_seed"
getent passwd | awk -F: '/^[^+-]/ { print $1 " " $3 " " $6 }' |
while read username uid homedir; do
- if ! expr $homedir : $FILTER > /dev/null; then
+ if ! expr "$homedir" : "$FILTER" > /dev/null; then
for f in ${list} ; do
file="${homedir}/${f}"
if [[ -f ${file} ]] ; then
@@ -95,7 +95,7 @@ list=".bashrc .bash_profile .bash_login .bash_logout .cshrc .emacs .exrc \
.ssh/known_hosts .ssh/rc .twmrc .xsession .xinitrc .Xdefaults"
getent passwd | awk -F: '/^[^+-]/ { print $1 " " $3 " " $6 }' | \
while read username uid homedir; do
- if ! expr $homedir : $FILTER > /dev/null; then
+ if ! expr "$homedir" : "$FILTER" > /dev/null; then
for f in ${list} ; do
file=${homedir}/${f}
if [[ -f ${file} ]] ; then
@@ -118,7 +118,7 @@ fi
### Check home directories. Directories should not be owned by someone else or writable.
getent passwd | awk -F: '/^[^+-]/ { print $1 " " $3 " " $6 }' | \
while read username uid homedir; do
- if ! expr $homedir : $FILTER > /dev/null; then
+ if ! expr "$homedir" : "$FILTER" > /dev/null; then
if [[ -d ${homedir} ]] ; then
realuid=`ls -LldGn ${homedir}| awk '{ print $3 }'`
realuser=`ls -LldG ${homedir}| awk '{ print $3 }'`
@@ -213,7 +213,7 @@ done > ${TMP}
getent passwd | awk -F: '{print $1" "$6}' |
while read username homedir; do
- if ! expr $homedir : $FILTER > /dev/null; then
+ if ! expr "$homedir" : "$FILTER" > /dev/null; then
for file in .rhosts .shosts; do
if [[ -s ${homedir}/${file} ]] ; then
awk '{