components/krb5/patches/032-pam-krb5.patch
changeset 5986 bab15c34f645
parent 5969 96bac9fbcfbd
child 6085 eb3c11e27709
equal deleted inserted replaced
5985:6b195cad32d4 5986:bab15c34f645
    12 # of kadmin@<fqhn> for instance.  In any case, a design such as this should be
    12 # of kadmin@<fqhn> for instance.  In any case, a design such as this should be
    13 # presented to MIT.
    13 # presented to MIT.
    14 # Patch source: in-house
    14 # Patch source: in-house
    15 #
    15 #
    16 diff -pur old/src/lib/kadm5/clnt/client_init.c new/src/lib/kadm5/clnt/client_init.c
    16 diff -pur old/src/lib/kadm5/clnt/client_init.c new/src/lib/kadm5/clnt/client_init.c
    17 --- no-032/src/lib/kadm5/clnt/client_init.c	2016-03-28 14:25:17.265078167 -0600
    17 --- old/src/lib/kadm5/clnt/client_init.c	2015-04-30 01:12:10.579373279 -0600
    18 +++ 032/src/lib/kadm5/clnt/client_init.c	2016-03-28 14:27:42.301681052 -0600
    18 +++ new/src/lib/kadm5/clnt/client_init.c	2015-05-26 23:38:41.638267439 -0600
    19 @@ -299,7 +299,7 @@ _kadm5_initialize_rpcsec_gss_handle(kadm
    19 @@ -299,7 +299,7 @@ _kadm5_initialize_rpcsec_gss_handle(kadm
    20  {
    20  {
    21  	int code = 0;
    21  	int code = 0;
    22  	generic_ret *r;
    22  	generic_ret *r;
    23 -	char *ccname_orig = NULL;
    23 -	char *ccname_orig = NULL;
    24 +	const char *ccname_orig = NULL;
    24 +	const char *ccname_orig = NULL;
    25  	char *iprop_svc;
    25  	char *iprop_svc;
    26  	boolean_t iprop_enable = B_FALSE;
    26  	boolean_t iprop_enable = B_FALSE;
    27  	char mech[] = "kerberos_v5";
    27  	char mech[] = "kerberos_v5";
    28 @@ -317,15 +317,13 @@ _kadm5_initialize_rpcsec_gss_handle(kadm
    28 @@ -316,15 +316,13 @@ _kadm5_initialize_rpcsec_gss_handle(kadm
       
    29  	char *server;
    29  	int port;
    30  	int port;
    30  	struct timeval timeout;
       
    31  
    31  
    32 -        /* service name is service/host */
    32 -        /* service name is service/host */
    33 -        server = strpbrk(service_name, "/");
    33 -        server = strpbrk(service_name, "/");
    34 +        /* service name is service@host */
    34 +        /* service name is service@host */
    35 +        server = strpbrk(service_name, "@");
    35 +        server = strpbrk(service_name, "@");
    42 -	*server++ = '@';
    42 -	*server++ = '@';
    43 +	server++;
    43 +	server++;
    44  
    44  
    45  	iprop_svc = strdup(KIPROP_SVC_NAME);
    45  	iprop_svc = strdup(KIPROP_SVC_NAME);
    46  	if (iprop_svc == NULL)
    46  	if (iprop_svc == NULL)
    47 @@ -516,7 +514,7 @@ cleanup:
    47 @@ -510,7 +508,7 @@ cleanup:
    48  
    48  
    49  static kadm5_ret_t
    49  static kadm5_ret_t
    50  init_any(krb5_context context, char *client_name, enum init_type init_type,
    50  init_any(krb5_context context, char *client_name, enum init_type init_type,
    51 -         char *pass, krb5_ccache ccache_in, char *svcname_in,
    51 -         char *pass, krb5_ccache ccache_in, char *svcname_in,
    52 +         char *pass, krb5_ccache ccache_in, char *svcname,
    52 +         char *pass, krb5_ccache ccache_in, char *svcname,
    53           kadm5_config_params *params_in, krb5_ui_4 struct_version,
    53           kadm5_config_params *params_in, krb5_ui_4 struct_version,
    54           krb5_ui_4 api_version, char **db_args, void **server_handle)
    54           krb5_ui_4 api_version, char **db_args, void **server_handle)
    55  {
    55  {
    56 @@ -534,7 +532,6 @@ init_any(krb5_context context, char *cli
    56 @@ -528,7 +526,6 @@ init_any(krb5_context context, char *cli
    57  
    57  
    58      int code = 0;
    58      int code = 0;
    59      generic_ret *r;
    59      generic_ret *r;
    60 -    char svcname[BUFSIZ];
    60 -    char svcname[BUFSIZ];
    61  
    61  
    62      initialize_ovk_error_table();
    62      initialize_ovk_error_table();
    63  /*      initialize_adb_error_table(); */
    63  /*      initialize_adb_error_table(); */
    64 @@ -603,15 +600,19 @@ init_any(krb5_context context, char *cli
    64 @@ -597,15 +594,19 @@ init_any(krb5_context context, char *cli
    65          goto error;
    65          goto error;
    66  
    66  
    67      /* NULL svcname means use host-based. */
    67      /* NULL svcname means use host-based. */
    68 -    if (svcname_in == NULL) {
    68 -    if (svcname_in == NULL) {
    69 -        code = kadm5_get_admin_service_name(handle->context,
    69 -        code = kadm5_get_admin_service_name(handle->context,
    86 +            goto error;
    86 +            goto error;
    87 +	}
    87 +	}
    88      }
    88      }
    89  
    89  
    90      /* Get credentials. */
    90      /* Get credentials. */
    91 @@ -666,14 +667,52 @@ cleanup:
    91 @@ -660,14 +661,52 @@ cleanup:
    92  static kadm5_ret_t
    92  static kadm5_ret_t
    93  get_init_creds(kadm5_server_handle_t handle, krb5_principal client,
    93  get_init_creds(kadm5_server_handle_t handle, krb5_principal client,
    94                 enum init_type init_type, char *pass, krb5_ccache ccache_in,
    94                 enum init_type init_type, char *pass, krb5_ccache ccache_in,
    95 -               char *svcname, char *realm, krb5_principal *server_out)
    95 -               char *svcname, char *realm, krb5_principal *server_out)
    96 +               char *svcname_in, char *realm, krb5_principal *server_out)
    96 +               char *svcname_in, char *realm, krb5_principal *server_out)
   140 +
   140 +
   141 +    /*
   141 +    /*
   142       * Acquire a service ticket for svcname@realm for client, using password
   142       * Acquire a service ticket for svcname@realm for client, using password
   143       * pass (which could be NULL), and create a ccache to store them in.  If
   143       * pass (which could be NULL), and create a ccache to store them in.  If
   144       * INIT_CREDS, use the ccache we were provided instead.
   144       * INIT_CREDS, use the ccache we were provided instead.
   145 @@ -708,7 +747,7 @@ get_init_creds(kadm5_server_handle_t han
   145 @@ -702,7 +741,7 @@ get_init_creds(kadm5_server_handle_t han
   146      }
   146      }
   147      handle->lhandle->cache_name = handle->cache_name;
   147      handle->lhandle->cache_name = handle->cache_name;
   148  
   148  
   149 -    code = gic_iter(handle, init_type, ccache, client, pass, svcname, realm,
   149 -    code = gic_iter(handle, init_type, ccache, client, pass, svcname, realm,
   150 +    code = gic_iter(handle, init_type, ccache, client, pass, svcbuf, realm,
   150 +    code = gic_iter(handle, init_type, ccache, client, pass, svcbuf, realm,