summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Dalley <kevin@seti.org>1998-09-15 10:18:35 +0000
committerKevin Dalley <kevin@seti.org>1998-09-15 10:18:35 +0000
commit41b4d5ea11406e8ae648be8c201df355b280bb87 (patch)
tree17bab239fc3bcac4f0a29aa3a91d8c82ae5a896d
parentdfbcb295fdb3ac774b164db9a9aa8518c21f9834 (diff)
downloadfindutils-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.sh20
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