#1134480 updatedb no longer working because of changes in su

Package:
locate
Source:
locate
Description:
maintain and query an index of a directory tree
Submitter:
Nicolas George
Date:
2026-04-21 09:23:02 UTC
Severity:
normal
Tags:
#1134480#5
Date:
2026-04-20 18:00:39 UTC
From:
To:
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

#1134480#10
Date:
2026-04-21 09:21:17 UTC
From:
To:
Nicolas George (HE12026-04-20):

Hi. I am seeing that a new version util-linux reverts the change in su.
That would fix this bug. I would still recommend to fix the order of the
arguments to adhere with standard options parsing.

Regards,

#1134480#15
Date:
2026-04-21 09:21:17 UTC
From:
To:
Nicolas George (HE12026-04-20):

Hi. I am seeing that a new version util-linux reverts the change in su.
That would fix this bug. I would still recommend to fix the order of the
arguments to adhere with standard options parsing.

Regards,