static int debug = 0;
void *handle;
-int use_keytab, use_master;
+int use_keytab, use_master, use_other_realm;
char *keytab = NULL;
krb5_keytab kt;
void usage(context)
krb5_context context;
{
- fprintf(stderr, "Usage: %s [-m[aster]] [-k[eytab]]\n", whoami);
+ fprintf(stderr, "Usage: %s [-k[eytab]] [-m[aster] [-r realm]]\n", whoami);
cleanup_and_exit(1, context);
}
fd_set rfds;
krb5_context context;
krb5_error_code retval;
+ kadm5_config_params config_params;
retval = krb5_init_context(&context);
if (retval) {
whoami = ((whoami = strrchr(argv[0], '/')) ? whoami + 1 : argv[0]);
argv++; argc--;
- use_master = use_keytab = 0;
+ use_master = use_keytab = use_other_realm = 0;
+ config_params.mask = 0;
+
while (argc) {
if (strncmp(*argv, "-k", 2) == 0)
use_keytab = 1;
else if (strncmp(*argv, "-m", 2) == 0)
use_master = 1;
+ else if (strcmp(*argv, "-r") == 0) {
+ use_other_realm = 1;
+ argv++; argc--;
+ if (argc == 0 || !use_master)
+ usage(context);
+ config_params.mask |= KADM5_CONFIG_REALM;
+ config_params.realm = *argv;
+ }
else
break;
argv++; argc--;
}
if (argc || use_keytab + use_master > 1 ||
+ use_keytab + use_other_realm > 1 ||
use_keytab + use_master == 0) {
- use_keytab = use_master = 0;
+ use_keytab = use_master = use_other_realm = 0;
usage(context);
}
if (use_keytab)
init_keytab(context);
if (use_master)
- /* someday maybe there will be some config param options */
- init_master(context, NULL);
+ init_master(context, &config_params);
memset((char *) &saddr, 0, sizeof(struct sockaddr_in));
saddr.sin_family = AF_INET;