From 6f9dd36990fca2f99fab104b4bc78044de05c07e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 22 Nov 2023 13:13:59 +0100 Subject: [PATCH] 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. --- src/home/homectl.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/home/homectl.c b/src/home/homectl.c index a6951c8562..9a433252c2 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;