Hi.
Since two days ago in Forky (according to journalctl), updatedb has
stopped working, creating an empty database and causing locate to not
find any file.
The cause is a change in the behavior of su: the -s option is no longer
accepted after the login:
$ sudo su -s /bin/sh nobody -c true
$ sudo su nobody -s /bin/sh -c true
nologin: invalid option -- 's'
Try 'nologin --help' for more information.
… on Forky, whereas on Trixie:
$ sudo su -s /bin/sh nobody -c true
$ sudo su nobody -s /bin/sh -c true
$
updatedb puts the -s option after the login, and therefore fails.
The fix is easy, see the diff at the end of this mail.
(I fixed this on my system the quick-and-dirty way, I figure the next
time the package is updated will be with the fix. reportbug added a
debsums warning, I removed it to avoid confusion.)
Thanks in advance.
Regards,
--- /usr/bin/updatedb.findutils.orig 2026-04-20 19:45:29.191206498 +0200
+++ /usr/bin/updatedb.findutils 2026-04-20 19:45:49.922716675 +0200
@@ -125,11 +125,11 @@
# figure out if su supports the -s option
select_shell() {
- if su "$1" -s $SHELL -c false < /dev/null ; then
+ if su -s $SHELL "$1" -c false < /dev/null ; then
# No.
echo ""
else
- if su "$1" -s $SHELL -c true < /dev/null ; then
+ if su -s $SHELL "$1" -c true < /dev/null ; then
# Yes.
echo "-s $SHELL"
else
@@ -293,7 +293,7 @@
if test -n "$SEARCHPATHS"; then
if [ "$LOCALUSER" != "" ]; then
# : A1
- su $LOCALUSER `select_shell $LOCALUSER` -c \
+ su `select_shell $LOCALUSER` $LOCALUSER -c \
"$find $SEARCHPATHS $FINDOPTIONS \
\\( $prunefs_exp \
-type d -regex '$PRUNEREGEX' \\) -prune -o $print_option"
@@ -309,7 +309,7 @@
myuid=`getuid`
if [ "$myuid" = 0 ]; then
# : A3
- su $NETUSER `select_shell $NETUSER` -c \
+ su `select_shell $NETUSER` $NETUSER -c \
"$find $NETPATHS $FINDOPTIONS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o $print_option" ||
exit $?
else