diff options
author | Jeff Layton <jlayton@redhat.com> | 2010-02-07 07:42:58 -0500 |
---|---|---|
committer | Jeff Layton <jlayton@redhat.com> | 2010-02-07 07:42:58 -0500 |
commit | 84234f1559ce90d2ebd48a994e4c8b1ef6463d79 (patch) | |
tree | 7f355842b81eff65037d5fea214d2e2ae507487d | |
parent | ce0b1609a9eedce6c5eb20eab287ea44217c0a6a (diff) | |
download | cifs-utils-84234f1559ce90d2ebd48a994e4c8b1ef6463d79.tar.gz cifs-utils-84234f1559ce90d2ebd48a994e4c8b1ef6463d79.tar.bz2 cifs-utils-84234f1559ce90d2ebd48a994e4c8b1ef6463d79.zip |
cifs.upcall: don't use smb_krb5_principal_get_realm
...we need our own version.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
-rw-r--r-- | cifs.upcall.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/cifs.upcall.c b/cifs.upcall.c index bfc70d1..e956d99 100644 --- a/cifs.upcall.c +++ b/cifs.upcall.c @@ -46,6 +46,31 @@ typedef enum _sectype { MS_KRB5 } sectype_t; +/* + * smb_krb5_principal_get_realm + * + * @brief Get realm of a principal + * + * @param[in] context The krb5_context + * @param[in] principal The principal + * @return pointer to the realm + * + */ + +static char *cifs_krb5_principal_get_realm(krb5_context context, + krb5_principal principal) +{ +#ifdef HAVE_KRB5_PRINCIPAL_GET_REALM /* Heimdal */ + return krb5_principal_get_realm(context, principal); +#elif defined(krb5_princ_realm) /* MIT */ + krb5_data *realm; + realm = krb5_princ_realm(context, principal); + return (char *)realm->data; +#else + return NULL; +#endif +} + /* does the ccache have a valid TGT? */ static time_t get_tgt_time(const char *ccname) { @@ -82,7 +107,7 @@ get_tgt_time(const char *ccname) { goto err_ccstart; } - if ((realm = smb_krb5_principal_get_realm(context, principal)) == NULL) { + if ((realm = cifs_krb5_principal_get_realm(context, principal)) == NULL) { syslog(LOG_DEBUG, "%s: unable to get realm", __func__); goto err_ccstart; } |