]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: support PrivateUsers=identity 23835/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Jun 2022 01:31:53 +0000 (10:31 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 27 Jun 2022 01:33:10 +0000 (10:33 +0900)
Follow-up for 33eac552ab22af58b303342b1fa912900fa42820.

Fixes #23825.

src/nspawn/nspawn-settings.c

index 3a5d72549a1a37779397e569ec87b9bb7c7cfa12..48daaa83e134d7ab9a24c7d692fe93a36bfc54f3 100644 (file)
@@ -623,6 +623,11 @@ int config_parse_private_users(
                 settings->userns_mode = USER_NAMESPACE_PICK;
                 settings->uid_shift = UID_INVALID;
                 settings->uid_range = UINT32_C(0x10000);
+        } else if (streq(rvalue, "identity")) {
+                /* identity: User namespacing on, UID range is 0:65536 */
+                settings->userns_mode = USER_NAMESPACE_FIXED;
+                settings->uid_shift = 0;
+                settings->uid_range = UINT32_C(0x10000);
         } else {
                 const char *range, *shift;
                 uid_t sh, rn;