From: Lennart Poettering Date: Wed, 22 Nov 2023 12:13:59 +0000 (+0100) Subject: homectl: when taking a JSON user record as input, strip secttions we don't want rathe... X-Git-Tag: v256-rc1~1474^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6f9dd36990fca2f99fab104b4bc78044de05c07e;p=thirdparty%2Fsystemd.git homectl: when taking a JSON user record as input, strip secttions we don't want rather than complain about them This makes it easier to take a user record from one host and create an identical user on another. --- diff --git a/src/home/homectl.c b/src/home/homectl.c index a6951c8562a..9a433252c2a 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -1146,7 +1146,18 @@ static int acquire_new_home_record(UserRecord **ret) { if (!hr) return log_oom(); - r = user_record_load(hr, v, USER_RECORD_REQUIRE_REGULAR|USER_RECORD_ALLOW_SECRET|USER_RECORD_ALLOW_PRIVILEGED|USER_RECORD_ALLOW_PER_MACHINE|USER_RECORD_ALLOW_SIGNATURE|USER_RECORD_LOG|USER_RECORD_PERMISSIVE); + r = user_record_load( + hr, + v, + USER_RECORD_REQUIRE_REGULAR| + USER_RECORD_ALLOW_SECRET| + USER_RECORD_ALLOW_PRIVILEGED| + USER_RECORD_ALLOW_PER_MACHINE| + USER_RECORD_STRIP_BINDING| + USER_RECORD_STRIP_STATUS| + USER_RECORD_STRIP_SIGNATURE| + USER_RECORD_LOG| + USER_RECORD_PERMISSIVE); if (r < 0) return r;