From 45a64d76c3fc6d7f295b791402a9f59983736c42 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Wed, 20 Nov 2024 20:11:10 +0100 Subject: [PATCH] UNIT TEST: fix krb5_utils-tests.c Raise back caps dropped from effective set by `sss_krb5_precreate_ccache()` --- src/tests/krb5_utils-tests.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tests/krb5_utils-tests.c b/src/tests/krb5_utils-tests.c index 76742922997..26f5afdb59a 100644 --- a/src/tests/krb5_utils-tests.c +++ b/src/tests/krb5_utils-tests.c @@ -143,6 +143,10 @@ START_TEST(test_private_ccache_dir_in_user_dir) ret = sss_krb5_precreate_ccache(filename, uid, gid); ck_assert_msg(ret == EOK, "sss_krb5_precreate_ccache failed."); + /* sss_krb5_precreate_ccache() drops those from effective set: */ + sss_set_cap_effective(CAP_DAC_OVERRIDE, true); + sss_set_cap_effective(CAP_CHOWN, true); + check_dir(dn3, uid, gid, 0700); RMDIR(dn3); check_dir(dn2, uid, gid, 0700); @@ -182,6 +186,10 @@ START_TEST(test_private_ccache_dir_in_wrong_user_dir) ck_assert_msg(ret == EINVAL, "Creating private ccache dir in wrong user " "dir does not failed with EINVAL."); + /* sss_krb5_precreate_ccache() drops those from effective set: */ + sss_set_cap_effective(CAP_DAC_OVERRIDE, true); + sss_set_cap_effective(CAP_CHOWN, true); + RMDIR(dirname); } END_TEST