diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-04-23 16:14:57 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-04-23 23:22:37 +0200 |
commit | 7bdbafc261f807b68fd5622500c70bbf363ae7c0 (patch) | |
tree | 0274bf6c5058eb6f1c3de6f46d81466b655888cb /src/home | |
parent | ea086f0610030b12a04baee2b88fd81b661610b1 (diff) | |
download | systemd-7bdbafc261f807b68fd5622500c70bbf363ae7c0.tar.gz |
homectl: don't use password cache if we operate on other user
Diffstat (limited to 'src/home')
-rw-r--r-- | src/home/homectl.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/home/homectl.c b/src/home/homectl.c index 34363c4f70..3e2de319bf 100644 --- a/src/home/homectl.c +++ b/src/home/homectl.c @@ -220,6 +220,10 @@ static int acquire_existing_password( return 1; } + /* If this is not our own user, then don't use the password cache */ + if (is_this_me(user_name) <= 0) + SET_FLAG(flags, ASK_PASSWORD_ACCEPT_CACHED|ASK_PASSWORD_PUSH_CACHE, false); + if (asprintf(&question, emphasize_current ? "Please enter current password for user %s:" : "Please enter password for user %s:", @@ -269,6 +273,10 @@ static int acquire_token_pin( return 1; } + /* If this is not our own user, then don't use the password cache */ + if (is_this_me(user_name) <= 0) + SET_FLAG(flags, ASK_PASSWORD_ACCEPT_CACHED|ASK_PASSWORD_PUSH_CACHE, false); + if (asprintf(&question, "Please enter security token PIN for user %s:", user_name) < 0) return log_oom(); |