]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Rename uid0 to run0
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Mar 2024 10:14:55 +0000 (11:14 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 19 Mar 2024 15:37:22 +0000 (16:37 +0100)
Naming is always a matter of preference, and the old name would certainly work,
but I think the new one has the following advantages:
- A verb is better than a noun.
- The name more similar to "the competition", i.e. 'sudo', 'pkexec', 'runas',
  'doas', which generally include an action verb.
- The connection between 'systemd-run' and 'run0' is more obvious.

There has been no release yet with the old name, so we can rename without
caring for backwards compatibility.

NEWS
TODO
man/rules/meson.build
man/run0.xml [moved from man/uid0.xml with 93% similarity]
man/systemd-run.xml
src/run/meson.build
src/run/run.c
src/run/systemd-run0.in [moved from src/run/systemd-uid0.in with 96% similarity]
test/units/testsuite-74.run.sh

diff --git a/NEWS b/NEWS
index 1f71030ebfd82584bcd8fa9198d601309051154c..7014e7582af84316544143edf06381ae2ce76d4a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -329,7 +329,7 @@ CHANGES WITH 256 in spe:
 
         Command-line tools:
 
-        * systemd-run is now a multi-call binary. When invoked as 'uid0', it
+        * systemd-run is now a multi-call binary. When invoked as 'run0', it
           provides as interface similar to 'sudo', with all arguments starting
           at the first non-option parameter being treated the command to
           invoke as root. Unlike 'sudo' and similar tools, it does not make use
diff --git a/TODO b/TODO
index 3b76e98bdeb7906e8a43908ecdc666c61e5aa2bc..38b82b6a03f7868922ac305d527b5729077aac23 100644 (file)
--- a/TODO
+++ b/TODO
@@ -255,7 +255,7 @@ Features:
 
 * add a new ExecStart= flag that inserts the configured user's shell as first
   word in the command line. (maybe use character '.'). Usecase: tool such as
-  uid0 can use that to spawn the target user's default shell.
+  run0 can use that to spawn the target user's default shell.
 
 * varlink: figure out how to do docs for our varlink interfaces. Idea: install
   interface files augmented with docs in /usr/share/ somewhere. And have
index 465ea4e4b3ece15cf278a337f50607efd8e620b1..38a0749fc75276df59a798671ec9fcea6cabc18b 100644 (file)
@@ -75,6 +75,7 @@ manpages = [
  ['repart.d', '5', [], 'ENABLE_REPART'],
  ['resolvectl', '1', ['resolvconf'], 'ENABLE_RESOLVE'],
  ['resolved.conf', '5', ['resolved.conf.d'], 'ENABLE_RESOLVE'],
+ ['run0', '1', [], ''],
  ['runlevel', '8', [], 'HAVE_SYSV_COMPAT'],
  ['sd-bus-errors',
   '3',
@@ -1265,7 +1266,6 @@ manpages = [
   ''],
  ['udev_new', '3', ['udev_ref', 'udev_unref'], ''],
  ['udevadm', '8', [], ''],
- ['uid0', '1', [], ''],
  ['ukify', '1', [], 'ENABLE_UKIFY'],
  ['user@.service',
   '5',
similarity index 93%
rename from man/uid0.xml
rename to man/run0.xml
index f0bfa40b9d95c347c01d5ea5138f6e66f634dee5..09e5620cce5a39f8b79a968b32e67eeae130fb2f 100644 (file)
@@ -3,27 +3,27 @@
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
 
-<refentry id="uid0"
+<refentry id="run0"
           xmlns:xi="http://www.w3.org/2001/XInclude">
 
   <refentryinfo>
-    <title>uid0</title>
+    <title>run0</title>
     <productname>systemd</productname>
   </refentryinfo>
 
   <refmeta>
-    <refentrytitle>uid0</refentrytitle>
+    <refentrytitle>run0</refentrytitle>
     <manvolnum>1</manvolnum>
   </refmeta>
 
   <refnamediv>
-    <refname>uid0</refname>
+    <refname>run0</refname>
     <refpurpose>Elevate privileges</refpurpose>
   </refnamediv>
 
   <refsynopsisdiv>
     <cmdsynopsis>
-      <command>uid0</command>
+      <command>run0</command>
       <arg choice="opt" rep="repeat">OPTIONS</arg>
       <arg choice="opt" rep="repeat">COMMAND</arg>
     </cmdsynopsis>
@@ -32,7 +32,7 @@
   <refsect1>
     <title>Description</title>
 
-    <para><command>uid0</command> may be used to temporarily and interactively acquire elevated or different
+    <para><command>run0</command> may be used to temporarily and interactively acquire elevated or different
     privileges. It serves a similar purpose as <citerefentry
     project='man-pages'><refentrytitle>sudo</refentrytitle><manvolnum>8</manvolnum></citerefentry>, but
     operates differently in a couple of key areas:</para>
     setting the <varname>NoNewPrivileges=</varname> variable in
     <citerefentry><refentrytitle>systemd-system.conf</refentrytitle><manvolnum>5</manvolnum></citerefentry>).</para>
 
-    <para>Any session invoked via <command>uid0</command> will run through the
-    <literal>systemd-uid0</literal> PAM stack.</para>
+    <para>Any session invoked via <command>run0</command> will run through the
+    <literal>systemd-run0</literal> PAM stack.</para>
 
-    <para>Note that <command>uid0</command> is implemented as an alternative multi-call invocation of
+    <para>Note that <command>run0</command> is implemented as an alternative multi-call invocation of
     <citerefentry><refentrytitle>systemd-run</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
   </refsect1>
 
         <term><option>--slice-inherit</option></term>
 
         <listitem><para>Make the new <filename>.service</filename> unit part of the slice the
-        <command>uid0</command> itself has been invoked in. This option may be combined with
+        <command>run0</command> itself has been invoked in. This option may be combined with
         <option>--slice=</option>, in which case the slice specified via <option>--slice=</option> is placed
-        within the slice the <command>uid0</command> command is invoked in.</para>
+        within the slice the <command>run0</command> command is invoked in.</para>
 
-        <para>Example: consider <command>uid0</command> being invoked in the slice
+        <para>Example: consider <command>run0</command> being invoked in the slice
         <filename>foo.slice</filename>, and the <option>--slice=</option> argument is
         <filename>bar</filename>. The unit will then be placed under
         <filename>foo-bar.slice</filename>.</para>
   <refsect1>
     <title>Exit status</title>
 
-    <para>On success, 0 is returned. If <command>uid0</command> failed to start the session or the specified command fails, a
+    <para>On success, 0 is returned. If <command>run0</command> failed to start the session or the specified command fails, a
     non-zero return value will be returned.</para>
   </refsect1>
 
index e891920c630e57b90d13741fe9405c811d832149..c6fd4ac20c137fd5dad6471e7d636b82f1ca7649 100644 (file)
@@ -706,7 +706,7 @@ $ systemd-run --user --wait -p SuccessExitStatus=SIGUSR1 --expand-environment=no
       <member><citerefentry><refentrytitle>systemd.timer</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>systemd-mount</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
       <member><citerefentry><refentrytitle>machinectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
-      <member><citerefentry><refentrytitle>uid0</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
+      <member><citerefentry><refentrytitle>run0</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
     </simplelist></para>
   </refsect1>
 
index 95336b86fe5a7143ec1ead09b56317f853e313a9..221b441fac82df4770447ee037044b95c1b70897 100644 (file)
@@ -12,12 +12,12 @@ install_emptydir(bindir)
 
 meson.add_install_script(sh, '-c',
                              ln_s.format(bindir / 'systemd-run',
-                                         bindir / 'uid0'))
+                                         bindir / 'run0'))
 
 custom_target(
-        'systemd-uid0',
-        input : 'systemd-uid0.in',
-        output : 'systemd-uid0',
+        'systemd-run0',
+        input : 'systemd-run0.in',
+        output : 'systemd-run0',
         command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
         install : pamconfdir != 'no',
         install_dir : pamconfdir)
index c0c65b2ea1fa12eb5faf8129a7a3f550a9c57003..e8dc3388c05e9650c9ad9a456b66a85b27c08a27 100644 (file)
@@ -159,7 +159,7 @@ static int help_sudo_mode(void) {
         _cleanup_free_ char *link = NULL;
         int r;
 
-        r = terminal_urlify_man("uid0", "1", &link);
+        r = terminal_urlify_man("run0", "1", &link);
         if (r < 0)
                 return log_oom();
 
@@ -743,7 +743,7 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) {
                 ARG_BACKGROUND,
         };
 
-        /* If invoked as "uid0" binary, let's expose a more sudo-like interface. We add various extensions
+        /* If invoked as "run0" binary, let's expose a more sudo-like interface. We add various extensions
          * though (but limit the extension to long options). */
 
         static const struct option options[] = {
@@ -943,7 +943,7 @@ static int parse_argv_sudo_mode(int argc, char *argv[]) {
         if (strv_extendf(&arg_property, "LogExtraFields=ELEVATED_USER=%s", un) < 0)
                 return log_oom();
 
-        if (strv_extend(&arg_property, "PAMName=systemd-uid0") < 0)
+        if (strv_extend(&arg_property, "PAMName=systemd-run0") < 0)
                 return log_oom();
 
         if (!arg_background && arg_stdio == ARG_STDIO_PTY) {
@@ -2262,7 +2262,7 @@ static int run(int argc, char* argv[]) {
         log_parse_environment();
         log_open();
 
-        if (invoked_as(argv, "uid0"))
+        if (invoked_as(argv, "run0"))
                 r = parse_argv_sudo_mode(argc, argv);
         else
                 r = parse_argv(argc, argv);
similarity index 96%
rename from src/run/systemd-uid0.in
rename to src/run/systemd-run0.in
index 57bd5e38b92a97b53b1a0dcba8ca8a14affb368d..11f830b7b08fa6cc948c5412dd549d6c84e3a2af 100644 (file)
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 # This file is part of systemd.
 #
-# Used by uid0 sessions
+# Used by run0 sessions
 
 {% if ENABLE_HOMED %}
 -account sufficient pam_systemd_home.so
index a94776eadd1f6fb9541546b9f07e6f96f04044c4..4f3c967e2cf249617f1b5b6d995e1f1f3c6bf00f 100755 (executable)
@@ -231,15 +231,15 @@ assert_eq "$KVER" "$UNIT_KVER"
 umount /proc/version
 rm -f "$TMP_KVER"
 
-# Check that invoking the tool under the uid0 alias name works
-uid0 ls /
-assert_eq "$(uid0 echo foo)" "foo"
+# Check that invoking the tool under the run0 alias name works
+run0 ls /
+assert_eq "$(run0 echo foo)" "foo"
 # Check if we set some expected environment variables
 for arg in "" "--user=root" "--user=testuser"; do
-    assert_eq "$(uid0 ${arg:+"$arg"} bash -c 'echo $SUDO_USER')" "$USER"
-    assert_eq "$(uid0 ${arg:+"$arg"} bash -c 'echo $SUDO_UID')" "$(id -u "$USER")"
-    assert_eq "$(uid0 ${arg:+"$arg"} bash -c 'echo $SUDO_GID')" "$(id -u "$USER")"
+    assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_USER')" "$USER"
+    assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_UID')" "$(id -u "$USER")"
+    assert_eq "$(run0 ${arg:+"$arg"} bash -c 'echo $SUDO_GID')" "$(id -u "$USER")"
 done
-# Let's chain a couple of uid0 calls together, for fun
-readarray -t cmdline < <(printf "%.0suid0\n" {0..31})
+# Let's chain a couple of run0 calls together, for fun
+readarray -t cmdline < <(printf "%.0srun0\n" {0..31})
 assert_eq "$("${cmdline[@]}" bash -c 'echo $SUDO_USER')" "$USER"