Skip to content

Commit 74a4f89

Browse files
author
Paymon MARANDI
committed
krb5: improve reporting failure on reading keytab
also, s/has not entries/has no entries/ when keytab_file has actually no entries. Signed-off-by: Paymon MARANDI <paymon@encs.concordia.ca>
1 parent a6d0f0c commit 74a4f89

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/providers/krb5/krb5_keytab.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,16 @@ krb5_error_code copy_keytab_into_memory(TALLOC_CTX *mem_ctx, krb5_context kctx,
120120
return kerr;
121121
}
122122

123+
kerr = access(keytab_file, R_OK);
124+
if (kerr != 0) {
125+
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] is not readable by us.\n",
126+
keytab_file);
127+
goto done;
128+
}
129+
123130
kerr = sss_krb5_kt_have_content(kctx, keytab);
124131
if (kerr != 0) {
125-
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] has not entries.\n",
132+
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] has no entries.\n",
126133
keytab_file);
127134
goto done;
128135
}

0 commit comments

Comments
 (0)