]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
unshare: update shell selection documentation
authorKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2026 12:25:10 +0000 (14:25 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2026 12:29:28 +0000 (14:29 +0200)
Update DESCRIPTION and add ENVIRONMENT section with SHELL entry,
documenting that when $SHELL is not set, the shell from the user's
passwd(5) entry is used before falling back to /bin/sh.

Addresses: https://github.com/util-linux/util-linux/issues/4242
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/unshare.1.adoc

index e212820619fdacbfaaedefd79f4eb977bc18a425..d9806975cb89a323ec05f6bbe9a6874a6367e9c4 100644 (file)
@@ -16,7 +16,7 @@ unshare - run program in new namespaces
 
 == DESCRIPTION
 
-The *unshare* command creates new namespaces (as specified by the command-line options described below) and then executes the specified _program_. If _program_ is not given, then "${SHELL}" is run (default: _/bin/sh_).
+The *unshare* command creates new namespaces (as specified by the command-line options described below) and then executes the specified _program_. If _program_ is not given, then "${SHELL}" is run. If *SHELL* is not set, the shell from the user's passwd(5) entry is used. If no shell is defined there either, _/bin/sh_ is used as the fallback.
 
 By default, a new namespace persists only as long as it has member processes. A new namespace can be made persistent even when it has no member processes by bind mounting /proc/_pid_/ns/_type_ files to a filesystem path. A namespace that has been made persistent in this way can subsequently be entered with *nsenter*(1) even after the _program_ terminates (except PID namespaces where a permanently running init process is required). Once a persistent namespace is no longer needed, it can be unpersisted by using *umount*(8) to remove the bind mount. See the *EXAMPLES* section for more details.
 
@@ -172,6 +172,11 @@ Do not pass the environment variables of the calling process to the unshared pro
 
 include::man-common/help-version.adoc[]
 
+== ENVIRONMENT
+
+*SHELL*::
+The default shell to run when no _program_ is specified. If *SHELL* is not set, the shell from the user's passwd(5) entry is used. If no shell is defined there either, _/bin/sh_ is used as the fallback.
+
 == NOTES
 
 The proc and sysfs filesystems mounting as root in a user namespace have to be restricted so that a less privileged user cannot get more access to sensitive files that a more privileged user made unavailable. In short the rule for proc and sysfs is as close to a bind mount as possible.