]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: Add specifiers to allow running as user instance
authorayekat <takeya@bluewin.ch>
Fri, 24 Nov 2017 11:44:08 +0000 (12:44 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 6 Dec 2017 09:19:22 +0000 (10:19 +0100)
This commit adds specifiers %U, %u and %h for the user UID, name and
home directory, respectively.

[zj: drop untrue copy-pasted comments and move the next text
     to the new "Specifiers" section.
     Now that #7444 has been merged, also drop the specifier functions.]

man/tmpfiles.d.xml
src/tmpfiles/tmpfiles.c

index 642a124eac13f06bf60fcf58bf965e7cd5df62b3..5278c7e7cc99affa08b35911930fd979253364aa 100644 (file)
@@ -630,6 +630,21 @@ r! /tmp/.X[0-9]*-lock</programlisting>
               <entry>Kernel release</entry>
               <entry>Identical to <command>uname -r</command> output.</entry>
             </row>
+            <row>
+              <entry><literal>%U</literal></entry>
+              <entry>User UID</entry>
+              <entry>This is the numeric UID of the user running the service manager instance. In case of the system manager this resolves to <constant>0</constant>.</entry>
+            </row>
+            <row>
+              <entry><literal>%u</literal></entry>
+              <entry>User name</entry>
+              <entry>This is the name of the user running the service manager instance. In case of the system manager this resolves to <literal>root</literal>.</entry>
+            </row>
+            <row>
+              <entry><literal>%h</literal></entry>
+              <entry>User home directory</entry>
+              <entry>This is the home directory of the user running the service manager instance. In case of the system manager this resolves to <literal>/root</literal>.</entry>
+            </row>
             <row>
               <entry><literal>%%</literal></entry>
               <entry>Escaped %</entry>
index c49c208078c466d1f29f202e755f695c9b2664ee..4a9c55462f7a5031649a3ae5a12d19c7174914f2 100644 (file)
@@ -174,6 +174,10 @@ static const Specifier specifier_table[] = {
         { 'b', specifier_boot_id, NULL },
         { 'H', specifier_host_name, NULL },
         { 'v', specifier_kernel_release, NULL },
+
+        { 'U', specifier_user_id, NULL },
+        { 'u', specifier_user_name, NULL },
+        { 'h', specifier_user_home, NULL },
         {}
 };