s3-kerberos: add smb_krb5_parse_name_flags().
authorGünther Deschner <gd@samba.org>
Thu, 5 Nov 2009 18:02:55 +0000 (19:02 +0100)
committerGünther Deschner <gd@samba.org>
Fri, 6 Nov 2009 11:43:03 +0000 (12:43 +0100)
Guenther

source3/include/includes.h
source3/libsmb/clikrb5.c

index b3446cbf65abe1787251cd1104327ac2ba28f2bc..796a729d6a4e80af1da5f5e9a024b4f5883ed520 100644 (file)
@@ -952,7 +952,10 @@ char *talloc_asprintf_strupper_m(TALLOC_CTX *t, const char *fmt, ...) PRINTF_ATT
 krb5_error_code smb_krb5_parse_name(krb5_context context,
                                const char *name, /* in unix charset */
                                 krb5_principal *principal);
-
+krb5_error_code smb_krb5_parse_name_flags(krb5_context context,
+                                         const char *name, /* in unix charset */
+                                         int flags,
+                                         krb5_principal *principal);
 krb5_error_code smb_krb5_unparse_name(TALLOC_CTX *mem_ctx,
                                      krb5_context context,
                                      krb5_const_principal principal,
index 145e30beb3e14b115d630f7184baa8011d95280c..2f68abe961bbe77c23c6ef1a9860a020858b1848 100644 (file)
@@ -65,6 +65,24 @@ static krb5_error_code ads_krb5_get_fwd_ticket( krb5_context context,
        return ret;
 }
 
+krb5_error_code smb_krb5_parse_name_flags(krb5_context context,
+                                         const char *name, /* in unix charset */
+                                         int flags,
+                                         krb5_principal *principal)
+{
+       krb5_error_code ret;
+       char *utf8_name;
+       size_t converted_size;
+
+       if (!push_utf8_talloc(talloc_tos(), &utf8_name, name, &converted_size)) {
+               return ENOMEM;
+       }
+
+       ret = krb5_parse_name_flags(context, utf8_name, flags, principal);
+       TALLOC_FREE(utf8_name);
+       return ret;
+}
+
 #ifdef HAVE_KRB5_PARSE_NAME_NOREALM
 /**************************************************************
  krb5_parse_name_norealm that takes a UNIX charset.