Skip to content

Commit

Permalink
UNIT TEST: fix krb5_utils-tests.c
Browse files Browse the repository at this point in the history
Raise back caps dropped from effective set by `sss_krb5_precreate_ccache()`
  • Loading branch information
alexey-tikhonov committed Nov 20, 2024
1 parent fed1901 commit 45a64d7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests/krb5_utils-tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 45a64d7

Please sign in to comment.