mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-07-29 15:55:47 -05:00
trust-add: Catch correct exception when chown SSSD
Commit 72fb4e6 introduced a regression. SSSD_USER.chown() raises
ValueError instead of KeyError when SSSD user does not exist.
Fixes: https://pagure.io/freeipa/issue/8516
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
committed by
Alexander Bokovoy
parent
4cc9c942d1
commit
4e30a48d3c
@@ -97,7 +97,7 @@ def retrieve_keytab(api, ccache_name, oneway_keytab_name, oneway_principal):
|
|||||||
# Make sure SSSD is able to read the keytab
|
# Make sure SSSD is able to read the keytab
|
||||||
try:
|
try:
|
||||||
constants.SSSD_USER.chown(oneway_keytab_name)
|
constants.SSSD_USER.chown(oneway_keytab_name)
|
||||||
except KeyError:
|
except ValueError:
|
||||||
# If user 'sssd' does not exist, we don't need to chown from root to sssd
|
# If user 'sssd' does not exist, we don't need to chown from root to sssd
|
||||||
# because it means SSSD does not run as sssd user
|
# because it means SSSD does not run as sssd user
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user