components/krb5/patches/035-multi-master.patch
author Will Fiveash <will.fiveash@oracle.com>
Wed, 24 Feb 2016 10:43:57 -0600
changeset 5490 9bf0bc57423a
child 5969 96bac9fbcfbd
permissions -rw-r--r--
PSARC/2015/144 Kerberos 1.13 Delivery to Userland 19153034 Add MIT Kerberos to the Userland Consolidation
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5490
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     1
#
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     2
# This patch provides support in kadmin and kpropd to work in a
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     3
# multi-master environment.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     4
#
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     5
# Note that we have discussed support for this with MIT in the past but
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     6
# they have been reticent to add such support.  It is possible that
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     7
# support for this may be introduced at a later time at which point we
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     8
# should look at modifying/deleting this patch.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
     9
# Patch source: in-house
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    10
#
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    11
diff -u -r old/src/kadmin/cli/kadmin.c new/src/kadmin/cli/kadmin.c
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    12
--- old/src/kadmin/cli/kadmin.c	2015-05-28 15:10:45.129616302 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    13
+++ new/src/kadmin/cli/kadmin.c	2015-05-29 13:32:41.901105712 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    14
@@ -268,7 +268,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    15
     char **db_args = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    16
     int db_args_size = 0;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    17
     char *db_name = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    18
-    char *svcname, *realm;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    19
+    char **svcnames = NULL, *realm;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    20
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    21
     memset(&params, 0, sizeof(params));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    22
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    23
@@ -380,11 +380,6 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    24
     params.mask |= KADM5_CONFIG_REALM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    25
     params.realm = def_realm;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    26
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    27
-    if (params.mask & KADM5_CONFIG_OLD_AUTH_GSSAPI)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    28
-        svcname = KADM5_ADMIN_SERVICE;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    29
-    else
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    30
-        svcname = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    31
-
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    32
     /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    33
      * Set cc to an open credentials cache, either specified by the -c
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    34
      * argument or the default.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    35
@@ -515,13 +510,15 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    36
     if (ccache_name) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    37
         printf(_("Authenticating as principal %s with existing "
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    38
                  "credentials.\n"), princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    39
-        retval = kadm5_init_with_creds(context, princstr, cc, svcname, &params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    40
+        retval = kadm5_init_with_creds_mm(context, princstr, cc, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    41
+                                       &params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    42
                                        KADM5_STRUCT_VERSION,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    43
                                        KADM5_API_VERSION_4, db_args, &handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    44
     } else if (use_anonymous) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    45
         printf(_("Authenticating as principal %s with password; "
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    46
                  "anonymous requested.\n"), princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    47
-        retval = kadm5_init_anonymous(context, princstr, svcname, &params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    48
+        retval = kadm5_init_anonymous_mm(context, princstr, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    49
+                                      &params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    50
                                       KADM5_STRUCT_VERSION,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    51
                                       KADM5_API_VERSION_4, db_args, &handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    52
     } else if (use_keytab) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    53
@@ -531,17 +528,20 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    54
         else
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    55
             printf(_("Authenticating as principal %s with default keytab.\n"),
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    56
                    princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    57
-        retval = kadm5_init_with_skey(context, princstr, keytab_name, svcname,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    58
+        retval = kadm5_init_with_skey_mm(context, princstr, keytab_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    59
+                                      svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    60
                                       &params, KADM5_STRUCT_VERSION,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    61
                                       KADM5_API_VERSION_4, db_args, &handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    62
     } else {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    63
         printf(_("Authenticating as principal %s with password.\n"),
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    64
                princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    65
-        retval = kadm5_init_with_password(context, princstr, password, svcname,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    66
+        retval = kadm5_init_with_password_mm(context, princstr, password,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    67
+                                          svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    68
                                           &params, KADM5_STRUCT_VERSION,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    69
                                           KADM5_API_VERSION_4, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    70
                                           &handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    71
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    72
+    free_srv_names(svcnames);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    73
     if (retval) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    74
         com_err(whoami, retval, _("while initializing %s interface"), whoami);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    75
         if (retval == KADM5_BAD_CLIENT_PARAMS ||
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    76
diff -u -r old/src/lib/kadm5/admin.h new/src/lib/kadm5/admin.h
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    77
--- old/src/lib/kadm5/admin.h	2015-05-28 15:10:45.095122403 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    78
+++ new/src/lib/kadm5/admin.h	2015-05-28 15:34:35.800877732 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    79
@@ -345,6 +345,51 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    80
                                      krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    81
                                      char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    82
                                      void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    83
+kadm5_ret_t kadm5_init_with_creds_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    84
+                                     char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    85
+                                     krb5_ccache ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    86
+                                     char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    87
+                                     kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    88
+                                     krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    89
+                                     krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    90
+                                     char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    91
+                                     void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    92
+kadm5_ret_t kadm5_init_with_password_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    93
+                                        char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    94
+                                        char *pass,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    95
+                                        char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    96
+                                        kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    97
+                                        krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    98
+                                        krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
    99
+                                        char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   100
+                                        void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   101
+kadm5_ret_t kadm5_init_anonymous_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   102
+                                    char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   103
+                                    char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   104
+                                    kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   105
+                                    krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   106
+                                    krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   107
+                                    char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   108
+                                    void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   109
+kadm5_ret_t kadm5_init_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   110
+                          char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   111
+                          char *pass,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   112
+                          char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   113
+                          kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   114
+                          krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   115
+                          krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   116
+                          char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   117
+                          void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   118
+kadm5_ret_t kadm5_init_with_skey_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   119
+                                    char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   120
+                                    char *keytab,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   121
+                                    char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   122
+                                    kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   123
+                                    krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   124
+                                    krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   125
+                                    char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   126
+                                    void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   127
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   128
 kadm5_ret_t    kadm5_lock(void *server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   129
 kadm5_ret_t    kadm5_unlock(void *server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   130
 kadm5_ret_t    kadm5_flush(void *server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   131
diff -u -r old/src/lib/kadm5/clnt/client_init.c new/src/lib/kadm5/clnt/client_init.c
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   132
--- old/src/lib/kadm5/clnt/client_init.c	2015-05-28 15:10:45.192975632 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   133
+++ new/src/lib/kadm5/clnt/client_init.c	2015-06-02 10:33:51.639341637 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   134
@@ -55,7 +55,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   135
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   136
 static kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   137
 init_any(krb5_context context, char *client_name, enum init_type init_type,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   138
-         char *pass, krb5_ccache ccache_in, char *service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   139
+         char *pass, krb5_ccache ccache_in, char **service_names,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   140
          kadm5_config_params *params, krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   141
          krb5_ui_4 api_version, char **db_args, void **server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   142
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   143
@@ -87,8 +87,25 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   144
                       krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   145
                       void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   146
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   147
+    char *svcnames[2];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   148
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   149
+    svcnames[0] = service_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   150
+    svcnames[1] = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   151
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   152
+    return init_any(context, client_name, INIT_CREDS, NULL, ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   153
+                    svcnames, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   154
+                    server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   155
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   156
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   157
+kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   158
+kadm5_init_with_creds_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   159
+                      krb5_ccache ccache, char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   160
+                      kadm5_config_params *params, krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   161
+                      krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   162
+                      void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   163
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   164
     return init_any(context, client_name, INIT_CREDS, NULL, ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   165
-                    service_name, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   166
+                    svcnames, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   167
                     server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   168
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   169
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   170
@@ -99,7 +116,24 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   171
                          krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   172
                          void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   173
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   174
-    return init_any(context, client_name, INIT_PASS, pass, NULL, service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   175
+    char *svcnames[2];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   176
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   177
+    svcnames[0] = service_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   178
+    svcnames[1] = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   179
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   180
+    return init_any(context, client_name, INIT_PASS, pass, NULL, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   181
+                    params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   182
+                    server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   183
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   184
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   185
+kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   186
+kadm5_init_with_password_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   187
+                         char *pass, char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   188
+                         kadm5_config_params *params, krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   189
+                         krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   190
+                         void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   191
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   192
+    return init_any(context, client_name, INIT_PASS, pass, NULL, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   193
                     params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   194
                     server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   195
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   196
@@ -110,8 +144,24 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   197
                      krb5_ui_4 struct_version, krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   198
                      char **db_args, void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   199
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   200
+    char *svcnames[2];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   201
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   202
+    svcnames[0] = service_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   203
+    svcnames[1] = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   204
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   205
+    return init_any(context, client_name, INIT_ANONYMOUS, NULL, NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   206
+                    svcnames, params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   207
+                    db_args, server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   208
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   209
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   210
+kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   211
+kadm5_init_anonymous_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   212
+                     char **svcnames, kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   213
+                     krb5_ui_4 struct_version, krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   214
+                     char **db_args, void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   215
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   216
     return init_any(context, client_name, INIT_ANONYMOUS, NULL, NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   217
-                    service_name, params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   218
+                    svcnames, params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   219
                     db_args, server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   220
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   221
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   222
@@ -121,7 +171,23 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   223
            krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   224
            void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   225
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   226
-    return init_any(context, client_name, INIT_PASS, pass, NULL, service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   227
+    char *svcnames[2];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   228
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   229
+    svcnames[0] = service_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   230
+    svcnames[1] = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   231
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   232
+    return init_any(context, client_name, INIT_PASS, pass, NULL, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   233
+                    params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   234
+                    server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   235
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   236
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   237
+kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   238
+kadm5_init_mm(krb5_context context, char *client_name, char *pass,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   239
+           char **svcnames, kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   240
+           krb5_ui_4 struct_version, krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   241
+           void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   242
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   243
+    return init_any(context, client_name, INIT_PASS, pass, NULL, svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   244
                     params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   245
                     server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   246
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   247
@@ -133,8 +199,25 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   248
                      krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   249
                      void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   250
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   251
+    char *svcnames[2];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   252
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   253
+    svcnames[0] = service_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   254
+    svcnames[1] = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   255
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   256
     return init_any(context, client_name, INIT_SKEY, keytab, NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   257
-                    service_name, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   258
+                    svcnames, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   259
+                    server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   260
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   261
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   262
+kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   263
+kadm5_init_with_skey_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   264
+                     char *keytab, char **svcnames,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   265
+                     kadm5_config_params *params, krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   266
+                     krb5_ui_4 api_version, char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   267
+                     void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   268
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   269
+    return init_any(context, client_name, INIT_SKEY, keytab, NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   270
+                    svcnames, params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   271
                     server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   272
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   273
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   274
@@ -338,7 +421,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   275
 	}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   276
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   277
 	/*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   278
-	 * iprop fallback logic: 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   279
+	 * iprop fallback logic:
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   280
 	 *    - if iprop_port is configured, connect to iprop_port
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   281
 	 *    - if not, query remote rpc/bind
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   282
 	 *    - if that fails, try consuming iprop service on kadmin port
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   283
@@ -506,9 +589,35 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   284
 	return (code);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   285
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   286
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   287
+/* utility function used below */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   288
+static void
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   289
+clean_up(kadm5_server_handle_t handle,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   290
+         krb5_principal *server,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   291
+         krb5_ccache *ccache)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   292
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   293
+    if (handle->destroy_cache && handle->cache_name) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   294
+        if (krb5_cc_resolve(handle->context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   295
+                            handle->cache_name, &ccache) == 0)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   296
+            (void) krb5_cc_destroy (handle->context, ccache);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   297
+    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   298
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   299
+    free(handle->cache_name);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   300
+    handle->cache_name = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   301
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   302
+    if (handle->clnt && handle->clnt->cl_auth)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   303
+        AUTH_DESTROY(handle->clnt->cl_auth);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   304
+    if (handle->clnt) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   305
+        clnt_destroy(handle->clnt);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   306
+        handle->clnt = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   307
+    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   308
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   309
+    krb5_free_principal(handle->context, *server);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   310
+    *server = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   311
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   312
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   313
 static kadm5_ret_t
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   314
 init_any(krb5_context context, char *client_name, enum init_type init_type,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   315
-         char *pass, krb5_ccache ccache_in, char *svcname,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   316
+         char *pass, krb5_ccache ccache_in, char **svcnames_in,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   317
          kadm5_config_params *params_in, krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   318
          krb5_ui_4 api_version, char **db_args, void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   319
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   320
@@ -526,6 +635,10 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   321
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   322
     int code = 0;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   323
     generic_ret *r;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   324
+    char **kadmin_srv_names = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   325
+    char *tmp_srv_names[2] = {NULL, NULL};
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   326
+    char **svcname_ptr;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   327
+    int i;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   328
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   329
     initialize_ovk_error_table();
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   330
 /*      initialize_adb_error_table(); */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   331
@@ -593,34 +706,56 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   332
     if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   333
         goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   334
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   335
-    /* NULL svcname means use host-based. */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   336
-    if (svcname == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   337
-	char **kadmin_srv_names;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   338
+    if (svcnames_in == NULL || svcnames_in[0] == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   339
+        if (params_in && params_in->mask & KADM5_CONFIG_ADMIN_SERVER &&
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   340
+            params_in->admin_server != NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   341
+            /* User passed in a admin server host name so use that */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   342
+            if (asprintf(&tmp_srv_names[0], "%s@%s", KADM5_ADMIN_HOST_SERVICE,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   343
+                         params_in->admin_server) == -1) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   344
+                code = ENOMEM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   345
+                goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   346
+            }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   347
+            svcname_ptr = tmp_srv_names;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   348
+        } else {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   349
+            /* Otherwise punt and get the admin server names. */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   350
+            code = kadm5_get_adm_host_srv_names(context, handle->params.realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   351
+                                                &kadmin_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   352
+            if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   353
+                goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   354
+            svcname_ptr = kadmin_srv_names;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   355
+        }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   356
+    } else {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   357
+        svcname_ptr = svcnames_in;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   358
+    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   359
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   360
-	code = kadm5_get_adm_host_srv_names(context, handle->params.realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   361
-	    &kadmin_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   362
-        if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   363
-            goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   364
-	svcname = strdup(kadmin_srv_names[0]);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   365
-	free_srv_names(kadmin_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   366
-	if (svcname == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   367
-	    code = ENOMEM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   368
-            goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   369
-	}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   370
+    for (i = 0; svcname_ptr[i]; i++) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   371
+        /* Get credentials. */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   372
+        code = get_init_creds(handle, client, init_type, pass, ccache_in,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   373
+                              svcname_ptr[i], handle->params.realm, &server);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   374
+        if (code) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   375
+            if (code == KADM5_SECURE_PRINC_MISSING ||
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   376
+                code == KRB5_ERR_BAD_HOSTNAME) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   377
+                /* clean up for another go around */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   378
+                clean_up(handle, &server, &ccache);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   379
+                continue;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   380
+            } else
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   381
+                goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   382
+        }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   383
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   384
+        code = _kadm5_initialize_rpcsec_gss_handle(handle, client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   385
+                                                   svcname_ptr[i]);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   386
+        if (code) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   387
+            /* clean up for another go around */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   388
+            clean_up(handle, &server, &ccache);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   389
+        } else {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   390
+            /* inited the rpcsec_gss handle, can stop looping now */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   391
+            break;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   392
+        }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   393
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   394
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   395
-    /* Get credentials. */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   396
-    code = get_init_creds(handle, client, init_type, pass, ccache_in,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   397
-                          svcname, handle->params.realm, &server);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   398
     if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   399
         goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   400
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   401
-    code = _kadm5_initialize_rpcsec_gss_handle(handle, client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   402
-                                               svcname);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   403
-    if (code != 0) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   404
-        goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   405
-    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   406
-
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   407
     *server_handle = (void *) handle;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   408
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   409
     goto cleanup;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   410
@@ -653,6 +788,8 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   411
     krb5_free_principal(handle->context, server);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   412
     if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   413
         free(handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   414
+    free_srv_names(kadmin_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   415
+    free(tmp_srv_names[0]);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   416
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   417
     return code;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   418
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   419
@@ -665,46 +802,43 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   420
 {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   421
     kadm5_ret_t code;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   422
     krb5_ccache ccache = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   423
-    krb5_principal cprinc;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   424
     char svcbuf[BUFSIZ], *service, *host, *svcname, *save;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   425
+    char strtok_buf[BUFSIZ];
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   426
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   427
     *server_out = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   428
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   429
-    /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   430
-     * Convert the RPCSEC_GSS version to the host based version as this
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   431
-     * is what gic expects.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   432
-     */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   433
-    if ((svcname = strdup(svcname_in)) == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   434
-	code = ENOMEM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   435
-	goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   436
-    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   437
-    if ((service = strtok_r(svcname, "@", &save)) != NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   438
-	if ((host = strtok_r(NULL, "@", &save)) != NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   439
-	    char *str = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   440
-	    /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   441
-	     * We want the canonical name here, via sname_to_principal.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   442
-	     */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   443
-	    code = krb5_sname_to_principal(handle->context, host, service,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   444
-		KRB5_NT_SRV_HST, &cprinc);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   445
-	    if (code) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   446
-		free(svcname);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   447
-		goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   448
-	    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   449
-	    code = krb5_unparse_name_flags(handle->context, cprinc,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   450
-		KRB5_PRINCIPAL_UNPARSE_NO_REALM, &str);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   451
-	    krb5_free_principal(handle->context, cprinc);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   452
-	    if (code) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   453
-		free(svcname);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   454
-		goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   455
-	    }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   456
-	    (void) strncpy(svcbuf, str, sizeof(svcbuf));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   457
-	    krb5_free_unparsed_name(handle->context, str);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   458
-	}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   459
+    if (strpbrk(svcname_in, "@") == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   460
+        svcname = svcname_in;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   461
     } else {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   462
-	strncpy(svcbuf, svcname, sizeof(svcbuf));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   463
-	svcbuf[sizeof(svcname)-1] = '\0';
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   464
+        /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   465
+         * Convert the RPCSEC_GSS version to the host based version as this
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   466
+         * is what gic expects.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   467
+         */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   468
+        (void) strlcpy(strtok_buf, svcname_in, sizeof(strtok_buf));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   469
+        service = strtok_r(strtok_buf, "@", &save);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   470
+        if ((host = strtok_r(NULL, "@", &save)) != NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   471
+            char *str = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   472
+            krb5_principal cprinc;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   473
+            /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   474
+             * We want the canonical name here, via sname_to_principal.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   475
+             */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   476
+            code = krb5_sname_to_principal(handle->context, host, service,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   477
+                                           KRB5_NT_SRV_HST, &cprinc);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   478
+            if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   479
+                goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   480
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   481
+            code = krb5_unparse_name_flags(handle->context, cprinc,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   482
+                                           KRB5_PRINCIPAL_UNPARSE_NO_REALM,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   483
+                                           &str);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   484
+            krb5_free_principal(handle->context, cprinc);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   485
+            if (code)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   486
+                goto error;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   487
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   488
+            (void) strlcpy(svcbuf, str, sizeof(svcbuf));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   489
+            krb5_free_unparsed_name(handle->context, str);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   490
+            svcname = svcbuf;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   491
+        }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   492
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   493
-    free(svcname);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   494
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   495
     /*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   496
      * Acquire a service ticket for svcname@realm for client, using password
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   497
@@ -741,7 +875,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   498
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   499
     handle->lhandle->cache_name = handle->cache_name;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   500
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   501
-    code = gic_iter(handle, init_type, ccache, client, pass, svcbuf, realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   502
+    code = gic_iter(handle, init_type, ccache, client, pass, svcname, realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   503
                     server_out);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   504
     /* Improved error messages */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   505
     if (code == KRB5KRB_AP_ERR_BAD_INTEGRITY) code = KADM5_BAD_PASSWORD;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   506
diff -u -r old/src/lib/kadm5/clnt/libkadm5clnt_mit.exports new/src/lib/kadm5/clnt/libkadm5clnt_mit.exports
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   507
--- old/src/lib/kadm5/clnt/libkadm5clnt_mit.exports	2015-02-11 21:16:43.000000000 -0600
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   508
+++ new/src/lib/kadm5/clnt/libkadm5clnt_mit.exports	2015-05-28 15:34:35.828495806 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   509
@@ -31,6 +31,11 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   510
 kadm5_init_with_creds
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   511
 kadm5_init_with_password
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   512
 kadm5_init_with_skey
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   513
+kadm5_init_mm
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   514
+kadm5_init_anonymous_mm
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   515
+kadm5_init_with_creds_mm
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   516
+kadm5_init_with_password_mm
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   517
+kadm5_init_with_skey_mm
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   518
 kadm5_lock
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   519
 kadm5_modify_policy
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   520
 kadm5_modify_principal
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   521
diff -u -r old/src/lib/kadm5/srv/server_init.c new/src/lib/kadm5/srv/server_init.c
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   522
--- old/src/lib/kadm5/srv/server_init.c	2015-05-28 15:10:45.100182433 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   523
+++ new/src/lib/kadm5/srv/server_init.c	2015-05-29 12:40:47.354397224 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   524
@@ -97,6 +97,29 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   525
                       server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   526
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   527
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   528
+/*
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   529
+ * The following *_mm() functions are also defined here because kadmin.local
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   530
+ * shares the same source as kadmin.  One difference however is that
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   531
+ * kadmin.local links with libkadm5srv_mit.so instead of libkadm5clnt_mit.so so
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   532
+ * these functions must also be defined here.  Given kadmin.local can only
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   533
+ * operate on one server, the *_mm() functions just pass in the first server in
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   534
+ * the list of service_names.
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   535
+ */
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   536
+kadm5_ret_t kadm5_init_with_password_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   537
+                                        char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   538
+                                        char *pass, char **service_names,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   539
+                                        kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   540
+                                        krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   541
+                                        krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   542
+                                        char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   543
+                                        void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   544
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   545
+    return kadm5_init_with_password(context, client_name, pass,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   546
+                                    service_names ? service_names[0] : NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   547
+                                    params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   548
+                                    db_args, server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   549
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   550
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   551
 kadm5_ret_t kadm5_init_anonymous(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   552
                                  char *service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   553
                                  kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   554
@@ -110,6 +133,20 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   555
                       server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   556
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   557
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   558
+kadm5_ret_t kadm5_init_anonymous_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   559
+                                 char **service_names,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   560
+                                 kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   561
+                                 krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   562
+                                 krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   563
+                                 char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   564
+                                 void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   565
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   566
+    return kadm5_init_anonymous(context, client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   567
+                                service_names ? service_names[0] : NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   568
+                                params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   569
+                                db_args, server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   570
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   571
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   572
 kadm5_ret_t kadm5_init_with_creds(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   573
                                   char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   574
                                   krb5_ccache ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   575
@@ -133,6 +170,22 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   576
                       server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   577
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   578
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   579
+kadm5_ret_t kadm5_init_with_creds_mm(krb5_context context,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   580
+                                  char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   581
+                                  krb5_ccache ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   582
+                                  char **service_names,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   583
+                                  kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   584
+                                  krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   585
+                                  krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   586
+                                  char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   587
+                                  void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   588
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   589
+    return kadm5_init_with_creds(context, client_name, ccache,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   590
+                                 service_names ? service_names[0] : NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   591
+                                 params, struct_version, api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   592
+                                 db_args, server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   593
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   594
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   595
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   596
 kadm5_ret_t kadm5_init_with_skey(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   597
                                  char *keytab, char *service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   598
@@ -155,6 +208,20 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   599
                       server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   600
 }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   601
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   602
+kadm5_ret_t kadm5_init_with_skey_mm(krb5_context context, char *client_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   603
+                                 char *keytab, char **service_names,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   604
+                                 kadm5_config_params *params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   605
+                                 krb5_ui_4 struct_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   606
+                                 krb5_ui_4 api_version,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   607
+                                 char **db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   608
+                                 void **server_handle)
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   609
+{
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   610
+    return kadm5_init_with_skey(context, client_name, keytab,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   611
+                                service_names ? service_names[0] : NULL,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   612
+                                params, struct_version, api_version, db_args,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   613
+                                server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   614
+}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   615
+
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   616
 kadm5_ret_t kadm5_init(krb5_context context, char *client_name, char *pass,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   617
                        char *service_name,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   618
                        kadm5_config_params *params_in,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   619
diff -u -r old/src/slave/kpropd.c new/src/slave/kpropd.c
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   620
--- old/src/slave/kpropd.c	2015-05-28 15:10:45.194095824 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   621
+++ new/src/slave/kpropd.c	2015-05-29 12:17:56.397347156 -0500
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   622
@@ -609,7 +609,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   623
     kadm5_ret_t retval;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   624
     krb5_principal iprop_svc_principal;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   625
     void *server_handle = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   626
-    char *iprop_svc_princstr = NULL, *master_svc_princstr = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   627
+    char *iprop_svc_princstr = NULL, **master_svc_princstrs = NULL;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   628
     unsigned int pollin, backoff_time;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   629
     int backoff_cnt = 0, reinit_cnt = 0;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   630
     struct timeval iprop_start, iprop_end;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   631
@@ -639,22 +639,9 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   632
     params.mask |= KADM5_CONFIG_REALM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   633
     params.realm = def_realm;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   634
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   635
-    if (master_svc_princstr == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   636
-#if 0
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   637
-        retval = kadm5_get_kiprop_host_srv_name(kpropd_context, def_realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   638
-                                                &master_svc_princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   639
-        if (retval) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   640
-            com_err(progname, retval,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   641
-                    _("%s: unable to get kiprop host based "
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   642
-                      "service name for realm %s\n"),
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   643
-                    progname, def_realm);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   644
-            return retval;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   645
-        }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   646
-#endif
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   647
-        char **kiprop_srv_names;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   648
-
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   649
+    if (master_svc_princstrs == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   650
         retval = kadm5_get_kiprop_host_srv_names(kpropd_context, def_realm,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   651
-						 &kiprop_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   652
+						 &master_svc_princstrs);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   653
         if (retval) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   654
             com_err(progname, retval,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   655
                     _("%s: unable to get kiprop host based "
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   656
@@ -662,15 +649,6 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   657
                     progname, def_realm);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   658
             return retval;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   659
 	}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   660
-        master_svc_princstr = strdup(kiprop_srv_names[0]);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   661
-	free_srv_names(kiprop_srv_names);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   662
-	if (master_svc_princstr == NULL) {
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   663
-            com_err(progname, retval,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   664
-                    _("%s: unable to allocate memory for kiprop host based "
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   665
-                      "service name for realm %s\n"),
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   666
-                    progname, def_realm);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   667
-            return ENOMEM;
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   668
-	}
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   669
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   670
 
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   671
     retval = krb5_sname_to_principal(kpropd_context, NULL, KIPROP_SVC_NAME,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   672
@@ -714,9 +692,9 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   673
         fprintf(stderr, _("Initializing kadm5 as client %s\n"),
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   674
                 iprop_svc_princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   675
     }
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   676
-    retval = kadm5_init_with_skey(kpropd_context, iprop_svc_princstr,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   677
+    retval = kadm5_init_with_skey_mm(kpropd_context, iprop_svc_princstr,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   678
                                   srvtab,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   679
-                                  master_svc_princstr,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   680
+                                  master_svc_princstrs,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   681
                                   &params,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   682
                                   KADM5_STRUCT_VERSION,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   683
                                   KADM5_API_VERSION_4,
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   684
@@ -1014,7 +992,7 @@
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   685
     syslog(LOG_ERR, _("ERROR returned by master KDC, bailing.\n"));
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   686
 done:
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   687
     free(iprop_svc_princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   688
-    free(master_svc_princstr);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   689
+    free_srv_names(master_svc_princstrs);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   690
     krb5_free_default_realm(kpropd_context, def_realm);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   691
     kadm5_destroy(server_handle);
9bf0bc57423a PSARC/2015/144 Kerberos 1.13 Delivery to Userland
Will Fiveash <will.fiveash@oracle.com>
parents:
diff changeset
   692
     krb5_free_context(kpropd_context);