client_init.c (bd211b85) client_init.c (159d09a2)
1/*
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
1/*
2 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 *
5 * $Header: /cvs/krbdev/krb5/src/lib/kadm5/clnt/client_init.c,v 1.13.2.2 2000/05/09 13:17:14 raeburn Exp $
6 */
7
4 */
5
8#pragma ident "%Z%%M% %I% %E% SMI"
9
6
7
10/*
8/*
9 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
10 */
11
12/*
11 * Copyright (C) 1998 by the FundsXpress, INC.
12 *
13 * All rights reserved.
14 *
15 * Export of this software from the United States of America may require
16 * a specific license from the United States Government. It is the
17 * responsibility of any person or organization contemplating export to
18 * obtain such a license before exporting.

--- 9 unchanged lines hidden (view full) ---

28 * this software for any purpose. It is provided "as is" without express
29 * or implied warranty.
30 *
31 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
32 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
33 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
34 */
35
13 * Copyright (C) 1998 by the FundsXpress, INC.
14 *
15 * All rights reserved.
16 *
17 * Export of this software from the United States of America may require
18 * a specific license from the United States Government. It is the
19 * responsibility of any person or organization contemplating export to
20 * obtain such a license before exporting.

--- 9 unchanged lines hidden (view full) ---

30 * this software for any purpose. It is provided "as is" without express
31 * or implied warranty.
32 *
33 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
34 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
35 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
36 */
37
36
37/*
38 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
39 *
40 * $Header: /afs/athena.mit.edu/astaff/project/krbdev/.cvsroot/src/lib/kadm5/clnt/client_init.c,v 1.6 1996/11/07 17:13:44 tytso Exp $
41 */
42
43#include <stdio.h>
44#include <netdb.h>
45#include "autoconf.h"
46#ifdef HAVE_MEMORY_H
47#include <memory.h>
48#endif
49#include <string.h>
50#include <com_err.h>

--- 489 unchanged lines hidden (view full) ---

540 * Bypass the remainder of the code and return straightaway
541 * if the gss service requested is kiprop
542 */
543 if (iprop_enable == B_TRUE) {
544 code = 0;
545 goto cleanup;
546 }
547
38#include <stdio.h>
39#include <netdb.h>
40#include "autoconf.h"
41#ifdef HAVE_MEMORY_H
42#include <memory.h>
43#endif
44#include <string.h>
45#include <com_err.h>

--- 489 unchanged lines hidden (view full) ---

535 * Bypass the remainder of the code and return straightaway
536 * if the gss service requested is kiprop
537 */
538 if (iprop_enable == B_TRUE) {
539 code = 0;
540 goto cleanup;
541 }
542
548 r = init_1(&handle->api_version, handle->clnt, &rpc_err_code);
543 r = init_2(&handle->api_version, handle->clnt);
544 /* Solaris Kerberos: 163 resync */
549 if (r == NULL) {
550 ADMIN_LOGO(LOG_ERR, dgettext(TEXT_DOMAIN,
551 "error during admin api initialization\n"));
545 if (r == NULL) {
546 ADMIN_LOGO(LOG_ERR, dgettext(TEXT_DOMAIN,
547 "error during admin api initialization\n"));
552
553 if (rpc_err_code == RPC_CANTENCODEARGS) {
554 ADMIN_LOGO(LOG_ERR, dgettext(TEXT_DOMAIN,
555 "encryption needed to encode RPC data may not be "
556 "installed/configured on this system"));
557 code = KADM5_RPC_ERROR_CANTENCODEARGS;
558 } else if (rpc_err_code == RPC_CANTDECODEARGS) {
559 ADMIN_LOGO(LOG_ERR, dgettext(TEXT_DOMAIN,
560 "encryption needed to decode RPC data may not be "
561 "installed/configured on the server"));
562 code = KADM5_RPC_ERROR_CANTDECODEARGS;
563 } else
564 code = KADM5_RPC_ERROR;
565
548 code = KADM5_RPC_ERROR;
566 goto error;
549 goto error;
567
568 }
550 }
551
569 if (r->code) {
570 code = r->code;
571 ADMIN_LOG(LOG_ERR,
572 dgettext(TEXT_DOMAIN,
573 "error during admin api initialization: %d\n"),
574 r->code);
575 goto error;
576 }

--- 119 unchanged lines hidden (view full) ---

696 free(handle->lhandle);
697 free(handle);
698 ADMIN_LOG(LOG_ERR, dgettext(TEXT_DOMAIN,
699 "bad client parameters, returning %d"),
700 KADM5_BAD_CLIENT_PARAMS);
701 return KADM5_BAD_CLIENT_PARAMS;
702 }
703
552 if (r->code) {
553 code = r->code;
554 ADMIN_LOG(LOG_ERR,
555 dgettext(TEXT_DOMAIN,
556 "error during admin api initialization: %d\n"),
557 r->code);
558 goto error;
559 }

--- 119 unchanged lines hidden (view full) ---

679 free(handle->lhandle);
680 free(handle);
681 ADMIN_LOG(LOG_ERR, dgettext(TEXT_DOMAIN,
682 "bad client parameters, returning %d"),
683 KADM5_BAD_CLIENT_PARAMS);
684 return KADM5_BAD_CLIENT_PARAMS;
685 }
686
704 if ((code = kadm5_get_config_params(handle->context,
705 DEFAULT_PROFILE_PATH,
706 "KRB5_CONFIG",
707 params_in,
708 &handle->params))) {
687 if ((code = kadm5_get_config_params(handle->context, 0,
688 params_in, &handle->params))) {
709 krb5_free_context(handle->context);
710 free(handle->lhandle);
711 free(handle);
712 ADMIN_LOG(LOG_ERR, dgettext(TEXT_DOMAIN,
713 "failed to get config_params, return: %d\n"), code);
714 return(code);
715 }
716

--- 237 unchanged lines hidden (view full) ---

954 * Solaris Kerberos:
955 * If _kadm5_initialize_rpcsec_gss_handle() fails it will have
956 * called krb5_gss_release_cred(). If the credential cache is a
957 * MEMORY cred cache krb5_gss_release_cred() destroys the
958 * cred cache data. Make sure that the cred-cache is closed
959 * to prevent a double free in the "error" code.
960 */
961 if (code != 0) {
689 krb5_free_context(handle->context);
690 free(handle->lhandle);
691 free(handle);
692 ADMIN_LOG(LOG_ERR, dgettext(TEXT_DOMAIN,
693 "failed to get config_params, return: %d\n"), code);
694 return(code);
695 }
696

--- 237 unchanged lines hidden (view full) ---

934 * Solaris Kerberos:
935 * If _kadm5_initialize_rpcsec_gss_handle() fails it will have
936 * called krb5_gss_release_cred(). If the credential cache is a
937 * MEMORY cred cache krb5_gss_release_cred() destroys the
938 * cred cache data. Make sure that the cred-cache is closed
939 * to prevent a double free in the "error" code.
940 */
941 if (code != 0) {
962 if (init_type != INIT_CREDS)
942 if (init_type != INIT_CREDS) {
963 krb5_cc_close(handle->context, ccache);
943 krb5_cc_close(handle->context, ccache);
944 ccache = NULL;
945 }
964 goto error;
965 }
966 }
967
968 *server_handle = (void *) handle;
969
970 if (init_type != INIT_CREDS)
971 krb5_cc_close(handle->context, ccache);

--- 137 unchanged lines hidden ---
946 goto error;
947 }
948 }
949
950 *server_handle = (void *) handle;
951
952 if (init_type != INIT_CREDS)
953 krb5_cc_close(handle->context, ccache);

--- 137 unchanged lines hidden ---