mirror of
https://github.com/samba-team/samba.git
synced 2025-01-17 02:05:21 +03:00
kerberos: add smb_krb5_keytab_name().
Guenther (This used to be commit c273ce8798062d1b55100411f3e92a01bdbf611c)
This commit is contained in:
parent
0ac8c5d49a
commit
640a2972c5
@ -1221,6 +1221,10 @@ krb5_error_code smb_krb5_open_keytab(krb5_context context,
|
||||
const char *keytab_name,
|
||||
bool write_access,
|
||||
krb5_keytab *keytab);
|
||||
krb5_error_code smb_krb5_keytab_name(TALLOC_CTX *mem_ctx,
|
||||
krb5_context context,
|
||||
krb5_keytab keytab,
|
||||
const char **keytab_name);
|
||||
int smb_krb5_kt_add_entry(krb5_context context,
|
||||
krb5_keytab keytab,
|
||||
krb5_kvno kvno,
|
||||
|
@ -1727,6 +1727,28 @@ done:
|
||||
return ret;
|
||||
}
|
||||
|
||||
krb5_error_code smb_krb5_keytab_name(TALLOC_CTX *mem_ctx,
|
||||
krb5_context context,
|
||||
krb5_keytab keytab,
|
||||
const char **keytab_name)
|
||||
{
|
||||
char keytab_string[MAX_KEYTAB_NAME_LEN];
|
||||
krb5_error_code ret = 0;
|
||||
|
||||
ret = krb5_kt_get_name(context, keytab,
|
||||
keytab_string, MAX_KEYTAB_NAME_LEN - 2);
|
||||
if (ret) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
*keytab_name = talloc_strdup(mem_ctx, keytab_string);
|
||||
if (!*keytab_name) {
|
||||
return ENOMEM;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else /* HAVE_KRB5 */
|
||||
/* this saves a few linking headaches */
|
||||
int cli_krb5_get_ticket(const char *principal, time_t time_offset,
|
||||
|
Loading…
x
Reference in New Issue
Block a user