2 * Copyright 2000, International Business Machines Corporation and others.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
10 /* These two needed for rxgen output to work */
11 #include <afsconfig.h>
12 #include <afs/param.h>
22 #include <sys/types.h>
30 #include <WINNT/afsevent.h>
39 #include <afs/cellconfig.h>
40 #include <afs/com_err.h>
47 main(int argc, char *argv[])
52 char *whoami = argv[0];
56 * The following signal action for AIX is necessary so that in case of a
57 * crash (i.e. core is generated) we can include the user's data section
58 * in the core dump. Unfortunately, by default, only a partial core is
59 * generated which, in many cases, isn't too useful.
63 sigemptyset(&nsa.sa_mask);
64 nsa.sa_handler = SIG_DFL;
65 nsa.sa_flags = SA_FULLDUMP;
66 sigaction(SIGABRT, &nsa, NULL);
67 sigaction(SIGSEGV, &nsa, NULL);
69 initialize_CMD_error_table();
70 initialize_KTC_error_table();
71 initialize_KA_error_table();
72 initialize_ACFG_error_table();
73 initialize_U_error_table();
76 /* initialize winsock */
77 if (afs_winsockInit() < 0) {
78 fprintf(stderr, "%s: Couldn't initialize winsock.\n", whoami);
85 afs_com_err(whoami, code, "Can't get cell info");
89 /* if there are no arguments or if the first argument is "-cell" or if the
90 * first argument is clearly a username (it contains a '.' or '@') assume
91 * the interactive command and splice it into the arglist. */
94 ap[1] = "interactive";
96 code = ka_AdminInteractive(2, ap);
97 else if ((strncmp(argv[1], "-admin_username", strlen(argv[1])) == 0)
98 || (strncmp(argv[1], "-password_for_admin", strlen(argv[1])) ==
100 || (strncmp(argv[1], "-cell", strlen(argv[1])) == 0)
101 || (strncmp(argv[1], "-servers", strlen(argv[1])) == 0)
102 || (strncmp(argv[1], "-noauth", strlen(argv[1])) == 0)
103 || (strpbrk(argv[1], "@.") != 0)) {
104 for (i = 1; i < argc; i++)
106 code = ka_AdminInteractive(argc + 1, ap);
108 code = ka_AdminInteractive(argc, argv);