1 #pragma ident "@(#)server_init.c 1.4 04/09/08 SMI"
2
3 /*
4 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
5 *
6 * Openvision retains the copyright to derivative works of
7 * this source code. Do *NOT* create a derivative of this
8 * source code before consulting with your legal department.
9 * Do *NOT* integrate *ANY* of this source code into another
10 * product before consulting with your legal department.
11 *
12 * For further information, read the top-level Openvision
13 * copyright which is contained in the top-level MIT Kerberos
14 * copyright.
15 *
16 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
17 *
18 */
19
20
21 /*
22 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
23 *
24 * $Id: server_init.c,v 1.5 1997/10/13 15:03:13 epeisach Exp $
25 * $Source: /cvs/krbdev/krb5/src/lib/kadm5/srv/server_init.c,v $
26 */
27
28 #if !defined(lint) && !defined(__CODECENTER__)
29 static char *rcsid = "$Header: /cvs/krbdev/krb5/src/lib/kadm5/srv/server_init.c,v 1.5 1997/10/13 15:03:13 epeisach Exp $";
30 #endif
31
32 #include <stdio.h>
33 #include <stdlib.h>
34 #include <com_err.h>
35 #include <kadm5/admin.h>
36 #include <krb5.h>
37 #include "server_internal.h"
38
39 /*
40 * Function check_handle
41 *
42 * Purpose: Check a server handle and return a com_err code if it is
43 * invalid or 0 if it is valid.
44 *
45 * Arguments:
46 *
47 * handle The server handle.
48 */
49
50 static int check_handle(void *handle)
51 {
52 CHECK_HANDLE(handle);
53 return 0;
54 }
55
56 kadm5_ret_t kadm5_init_with_password(char *client_name, char *pass,
57 char *service_name,
325 if ((ret = krb5_db_fini(handle->context)) ||
326 /*
327 * Set the db_name based on configuration before calling
328 * krb5_db_init, so it will get used.
329 */
330 (ret = krb5_db_set_name(handle->context,
331 handle->params.dbname)) ||
332 (ret = krb5_db_init(handle->context)) ||
333 (ret = adb_policy_close(handle)) ||
334 (ret = adb_policy_init(handle))) {
335 (void) kadm5_destroy(server_handle);
336 return ret;
337 }
338 return KADM5_OK;
339 }
340
341 int _kadm5_check_handle(void *handle)
342 {
343 CHECK_HANDLE(handle);
344 return 0;
345 }
|
1 /*
2 * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5
6 #pragma ident "@(#)server_init.c 1.3 04/02/20 SMI"
7
8 /*
9 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
10 *
11 * Openvision retains the copyright to derivative works of
12 * this source code. Do *NOT* create a derivative of this
13 * source code before consulting with your legal department.
14 * Do *NOT* integrate *ANY* of this source code into another
15 * product before consulting with your legal department.
16 *
17 * For further information, read the top-level Openvision
18 * copyright which is contained in the top-level MIT Kerberos
19 * copyright.
20 *
21 * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
22 *
23 */
24
25
26 /*
27 * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved.
28 *
29 * $Id: server_init.c,v 1.5 1997/10/13 15:03:13 epeisach Exp $
30 * $Source: /cvs/krbdev/krb5/src/lib/kadm5/srv/server_init.c,v $
31 */
32
33 #if !defined(lint) && !defined(__CODECENTER__)
34 static char *rcsid = "$Header: /cvs/krbdev/krb5/src/lib/kadm5/srv/server_init.c,v 1.5 1997/10/13 15:03:13 epeisach Exp $";
35 #endif
36
37 #include <stdio.h>
38 #include <stdlib.h>
39 #include <com_err.h>
40 #include <kadm5/admin.h>
41 #include <krb5.h>
42 #include "server_internal.h"
43 #include <kdb/kdb_log.h>
44
45 /*
46 * Function check_handle
47 *
48 * Purpose: Check a server handle and return a com_err code if it is
49 * invalid or 0 if it is valid.
50 *
51 * Arguments:
52 *
53 * handle The server handle.
54 */
55
56 static int check_handle(void *handle)
57 {
58 CHECK_HANDLE(handle);
59 return 0;
60 }
61
62 kadm5_ret_t kadm5_init_with_password(char *client_name, char *pass,
63 char *service_name,
331 if ((ret = krb5_db_fini(handle->context)) ||
332 /*
333 * Set the db_name based on configuration before calling
334 * krb5_db_init, so it will get used.
335 */
336 (ret = krb5_db_set_name(handle->context,
337 handle->params.dbname)) ||
338 (ret = krb5_db_init(handle->context)) ||
339 (ret = adb_policy_close(handle)) ||
340 (ret = adb_policy_init(handle))) {
341 (void) kadm5_destroy(server_handle);
342 return ret;
343 }
344 return KADM5_OK;
345 }
346
347 int _kadm5_check_handle(void *handle)
348 {
349 CHECK_HANDLE(handle);
350 return 0;
351 }
352
353 krb5_error_code
354 kadm5_init_iprop(void *handle)
355 {
356 kadm5_server_handle_t iprop_h;
357 krb5_error_code retval;
358
359 iprop_h = handle;
360 if (iprop_h->params.iprop_enabled) {
361 ulog_set_role(iprop_h->context, IPROP_MASTER);
362 if ((retval = ulog_map(iprop_h->context, &iprop_h->params,
363 FKCOMMAND)) != 0)
364 return (retval);
365 }
366 return (0);
367 }
|