diff options
author | Kevin Dalley <kevin@seti.org> | 1998-09-15 10:18:35 +0000 |
---|---|---|
committer | Kevin Dalley <kevin@seti.org> | 1998-09-15 10:18:35 +0000 |
commit | 41b4d5ea11406e8ae648be8c201df355b280bb87 (patch) | |
tree | 17bab239fc3bcac4f0a29aa3a91d8c82ae5a896d | |
parent | dfbcb295fdb3ac774b164db9a9aa8518c21f9834 (diff) | |
download | findutils-41b4d5ea11406e8ae648be8c201df355b280bb87.tar.gz |
* added "-s /bin/sh" to all instances of command su, which allows
updatedb to be easily used by users which have a different shell.
(fixes bug #20812)
-rw-r--r-- | locate/updatedb.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/locate/updatedb.sh b/locate/updatedb.sh index 5be474f7..0873530d 100644 --- a/locate/updatedb.sh +++ b/locate/updatedb.sh @@ -112,7 +112,7 @@ if test $old = no; then { if test -n "$SEARCHPATHS"; then if [ "$LOCALUSER" != "" ]; then - su $LOCALUSER -c \ + su -s /bin/sh $LOCALUSER -c \ "$find $SEARCHPATHS \ \\( $prunefs_exp \ -type d -regex \"$PRUNEREGEX\" \\) -prune -o -print" @@ -125,7 +125,7 @@ fi if test -n "$NETPATHS"; then if [ "`whoami`" = root ]; then - su $NETUSER -c \ + su -s /bin/sh $NETUSER -c \ "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print" else $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print @@ -146,8 +146,16 @@ fi else # old -bigrams=`tempfile -p updatedb` -filelist=`tempfile -p updatedb` +if ! bigrams=`tempfile -p updatedb`; then + echo tempfile failed + exit 1 +fi + +if ! filelist=`tempfile -p updatedb`; then + echo tempfile failed + exit 1 +fi + rm -f $LOCATE_DB.n trap 'rm -f $bigrams $filelist $LOCATE_DB.n; exit' 1 15 @@ -157,7 +165,7 @@ trap 'rm -f $bigrams $filelist $LOCATE_DB.n; exit' 1 15 { if test -n "$SEARCHPATHS"; then if [ "$LOCALUSER" != "" ]; then - su $LOCALUSER -c \ + su -s /bin/sh $LOCALUSER -c \ "$find $SEARCHPATHS \ \( $prunefs_exp \ -type d -regex "$PRUNEREGEX" \) -prune -o -print" @@ -170,7 +178,7 @@ fi if test -n "$NETPATHS"; then if [ "`whoami`" = root ]; then - su $NETUSER -c \ + su -s /bin/sh $NETUSER -c \ "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print" else $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print |