[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#2996: Bug #2996: "su" and userid confusion in updatedb



This looks like a legitimate bug.  I'll try to take a look at it soon.
There are actually two occurrences of su in updatedb.  I would like to
get the opinion of the upstream maintainers on this problem as well as
others.

kevin



>>>>> "Miquel" == Miquel van Smoorenburg <miquels@cistron.nl> writes:

> Package: findutils
> Version: 4.1-10

> I wanted to let updatedb search a networked drive, so I changed the
> default /etc/cron.daily/find script to:

> su nobody -c "cd / && updatedb --localpaths='' --netpaths=/pub/"

> Unfortunately the script does a "su" to the "netuser" internally which
> is daemon, and ofcourse this wants a password..

> I've patched updatedb. Perhaps this should go back in the upstream version.

> --- updatedb.org	Tue May 14 23:25:40 1996
> +++ updatedb	Tue May 14 23:27:04 1996
> @@ -99,8 +99,12 @@
>  fi

>  if test -n "$NETPATHS"; then
> -  su $NETUSER -c \
> -  "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print"
> +  if [ "`whoami`" = root ]; then
> +    su $NETUSER -c \
> +    "$find $NETPATHS \\( -type d -regex \"$PRUNEREGEX\" -prune \\) -o -print"
> +  else
> +    $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print
> +  fi
>  fi
>  } | sort -f | $frcode > $LOCATE_DB.n

> Mike.
> --
>   Miquel van    | Cistron Internet Services   --    Alphen aan den Rijn.
>   Smoorenburg,  | mailto:info@cistron.nl          http://www.cistron.nl/
> miquels@het.net | Tel: +31-172-419445 (Voice) 430979 (Fax) 442580 (Data)


Reply to: