]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
units: drop "-p" flag from agetty's login options
authorRonan Pigott <ronan@rjp.ie>
Wed, 14 Aug 2024 18:42:03 +0000 (11:42 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 15 Aug 2024 07:49:02 +0000 (16:49 +0900)
This flag was added in db6aedab9292 with the justification that locale
environment variables should be preserved by the user session. However,
the companion patch to drop the UnsetEnvironment= directive blocking
these variables was never merged, so the intended change was never
effected.

While the patch was ineffective toward its stated goal, the "-p" option
does have material negative consequences for the user session in
systemd — environment variables to support the use of
credentials and memory pressure directives, such as
$CREDENTIALS_DIRECTORY and $MEMORY_PRESSURE_WATCH, which are now
directly used by agetty and login, get leaked into the user session
potentially breaking applications that rely on these values.

E.g. systemd-ask-password fails from the tty when $CREDENTIALS_DIRECTORY
has been leaked from agetty, because it expects to be able to access
credentials in $CREDENTIALS_DIRECTORY.

This effectively reverts db6aedab9292.

References: db6aedab9292 (units: Tell login to preserve environment (#6023), 2017-05-24)

units/console-getty.service.in
units/container-getty@.service.in
units/getty@.service.in
units/serial-getty@.service.in

index 841c4496f02346afd398b1f15edf9fff234babf7..575a7770c9dbdbe6147cd926f2f3826606c81c6d 100644 (file)
@@ -20,10 +20,9 @@ Before=getty.target
 ConditionPathExists=/dev/console
 
 [Service]
-# The '-o' option value tells agetty to replace 'login' arguments with an
-# option to preserve environment (-p), followed by '--' for safety, and then
-# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM}
+# The '-o' option value tells agetty to replace 'login' arguments with '--' for
+# safety, and then the entered username.
+ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM}
 Type=idle
 Restart=always
 UtmpIdentifier=cons
index 1f633836419069f2b0380d410816260febc613b6..6bee309bf5a5a76113bb667e29a9231c8285ab7b 100644 (file)
@@ -25,10 +25,9 @@ Conflicts=rescue.service
 Before=rescue.service
 
 [Service]
-# The '-o' option value tells agetty to replace 'login' arguments with an
-# option to preserve environment (-p), followed by '--' for safety, and then
-# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noreset --noclear - ${TERM}
+# The '-o' option value tells agetty to replace 'login' arguments with '--' for
+# safety, and then the entered username.
+ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear - ${TERM}
 Type=idle
 Restart=always
 RestartSec=0
index 983f6dba494fa17d46133396948c36d40e2ddb91..3ea95e1ee4fd0dc1562dbd97f9b3bdea379e3e95 100644 (file)
@@ -34,10 +34,9 @@ Before=rescue.service
 ConditionPathExists=/dev/tty0
 
 [Service]
-# The '-o' option value tells agetty to replace 'login' arguments with an
-# option to preserve environment (-p), followed by '--' for safety, and then
-# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noreset --noclear - ${TERM}
+# The '-o' option value tells agetty to replace 'login' arguments with '--' for
+# safety, and then the entered username.
+ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear - ${TERM}
 Type=idle
 Restart=always
 RestartSec=0
index afb8ad06a774f47bbfd07afd374fa2155d63b08c..a071241ef90d6df8c488bba4f73fd5917003b633 100644 (file)
@@ -30,10 +30,9 @@ Conflicts=rescue.service
 Before=rescue.service
 
 [Service]
-# The '-o' option value tells agetty to replace 'login' arguments with an
-# option to preserve environment (-p), followed by '--' for safety, and then
-# the entered username.
-ExecStart=-/sbin/agetty -o '-p -- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM}
+# The '-o' option value tells agetty to replace 'login' arguments with '--' for
+# safety, and then the entered username.
+ExecStart=-/sbin/agetty -o '-- \\u' --noreset --noclear --keep-baud 115200,57600,38400,9600 - ${TERM}
 Type=idle
 Restart=always
 UtmpIdentifier=%I