summaryrefslogtreecommitdiff
path: root/source3/libsmb
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-06-18 12:48:35 +0200
committerGünther Deschner <gd@samba.org>2008-06-24 23:34:17 +0200
commit640a2972c555a456ea9a083bdc7aae8ea283492a (patch)
tree0a1b25f5d5fb34e9f43684f25510c7badb48aee2 /source3/libsmb
parent0ac8c5d49a8b0d5535eebf80871003f6c19af5eb (diff)
downloadsamba-640a2972c555a456ea9a083bdc7aae8ea283492a.tar.gz
samba-640a2972c555a456ea9a083bdc7aae8ea283492a.tar.bz2
samba-640a2972c555a456ea9a083bdc7aae8ea283492a.zip
kerberos: add smb_krb5_keytab_name().
Guenther (This used to be commit c273ce8798062d1b55100411f3e92a01bdbf611c)
Diffstat (limited to 'source3/libsmb')
-rw-r--r--source3/libsmb/clikrb5.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/libsmb/clikrb5.c b/source3/libsmb/clikrb5.c
index 52c729625c..2aae9df53e 100644
--- a/source3/libsmb/clikrb5.c
+++ b/source3/libsmb/clikrb5.c
@@ -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,