Skip to content

Commit fa4a69d

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 fa4a69d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/providers/krb5/krb5_keytab.c

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

123+
if (access(keytab_file, R_OK)) {
124+
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] is not readable by us.\n",
125+
keytab_file);
126+
goto done;
127+
}
128+
123129
kerr = sss_krb5_kt_have_content(kctx, keytab);
124130
if (kerr != 0) {
125-
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] has not entries.\n",
131+
DEBUG(SSSDBG_CRIT_FAILURE, "keytab [%s] has no entries.\n",
126132
keytab_file);
127133
goto done;
128134
}

0 commit comments

Comments
 (0)