[PATCH 0/3] Consistent shell resolution across util-linux

Alessandro Ratti <[email protected]> Sun, 23 Nov 2025 16:32:43 +0100
Newsgroups org.kernel.vger.util-linux
Message-ID <[email protected]>
This patch series addresses inconsistent default shell handling across
util-linux tools, which caused user-reported data loss when script(1)
defaulted to /bin/sh without respecting the user's configured shell.

The series:
1. Introduces ul_default_shell() for consistent shell resolution
2. Updates interactive tools to use the new function
3. Standardizes _PATH_BSHELL usage in security-sensitive tools

This implements the solution discussed in:
https://github.com/util-linux/util-linux/issues/3865

Alessandro Ratti (3):
  lib: introduce ul_default_shell() for consistent shell resolution
  *: use ul_default_shell() for interactive shell spawning
  login-utils, sys-utils: use _PATH_BSHELL consistently

 include/shells.h        |  6 ++++++
 lib/Makemodule.am       |  1 +
 lib/exec_shell.c        |  8 ++------
 lib/shells.c            | 26 ++++++++++++++++++++++++++
 login-utils/su-common.c |  5 +----
 login-utils/sulogin.c   |  9 +++++----
 sys-utils/flock.c       |  8 +++++---
 sys-utils/setpriv.c     |  6 ++----
 term-utils/script.c     |  5 ++---
 term-utils/scriptlive.c |  5 ++---
 text-utils/more.c       |  4 ++--
 11 files changed, 54 insertions(+), 29 deletions(-)

-- 
2.51.1