diff options
| author | Paul Park <pjpark@mit.edu> | 1995-06-01 18:52:17 +0000 |
|---|---|---|
| committer | Paul Park <pjpark@mit.edu> | 1995-06-01 18:52:17 +0000 |
| commit | 15c0f9b5c5b681b8d35b0b6ce22e8a099a28b7fe (patch) | |
| tree | 19335f31e48db777e22cc9814fdc6ec48be03e95 /src | |
| parent | 9fca0e35d94a8404a9080573debfd98d9d3802f6 (diff) | |
| download | krb5-15c0f9b5c5b681b8d35b0b6ce22e8a099a28b7fe.tar.gz krb5-15c0f9b5c5b681b8d35b0b6ce22e8a099a28b7fe.tar.xz krb5-15c0f9b5c5b681b8d35b0b6ce22e8a099a28b7fe.zip | |
Change admin instance name to kadmin and fix bug in kadmin_list
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5929 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/kadmin/v5client/ChangeLog | 8 | ||||
| -rw-r--r-- | src/kadmin/v5client/kadmin5.M | 4 | ||||
| -rw-r--r-- | src/kadmin/v5client/kadmin5.c | 114 |
3 files changed, 62 insertions, 64 deletions
diff --git a/src/kadmin/v5client/ChangeLog b/src/kadmin/v5client/ChangeLog index 667a3ce92..4188e06b8 100644 --- a/src/kadmin/v5client/ChangeLog +++ b/src/kadmin/v5client/ChangeLog @@ -1,4 +1,12 @@ +Thu Jun 1 14:31:49 EDT 1995 Paul Park (pjpark@mit.edu) + * kadmin5.c: Change the default admin instance name to "kadmin" + * kadmin5.c(kadmin_list): Compare principals to each of the supplied + regular expressions instead of only to the last one. This + is slightly inefficient, but correct. + * kadmin5.M: Document the change in default instance name. + + Mon May 15 10:57:17 EDT 1995 Paul Park (pjpark@mit.edu) * kadmin5.M - Change default principal name for kadmin5. diff --git a/src/kadmin/v5client/kadmin5.M b/src/kadmin/v5client/kadmin5.M index 8443c6729..63a5cf79c 100644 --- a/src/kadmin/v5client/kadmin5.M +++ b/src/kadmin/v5client/kadmin5.M @@ -45,7 +45,7 @@ specifies the default realm. .B principal specifies a principal name to use instead of the default .I user -.B /kadmin5@realm. +.B /kadmin@realm. .IP \-m specifies that multiple operations will be permitted for only one entry of the administrative principal's password. @@ -73,7 +73,7 @@ Principals who may perform administrative operations are controlled by the .I kadmind5 access control list. The default administrative principal is .I user -.B /kadmin5@realm. +.B /kadmin@realm. .PP One command may be specified on the command line, or if no command is provided, an interactive command loop is entered for the administrator to enter commands. diff --git a/src/kadmin/v5client/kadmin5.c b/src/kadmin/v5client/kadmin5.c index 92ed342f5..5aa9fd039 100644 --- a/src/kadmin/v5client/kadmin5.c +++ b/src/kadmin/v5client/kadmin5.c @@ -64,7 +64,7 @@ static char *re_string = (char *) NULL; static const char *help_option = "-help"; static const char *verbose_option = "-verbose"; static const char *force_option = "-force"; -static const char *kadmin_instance = "kadmin5"; +static const char *kadmin_instance = "kadmin"; static const char *wr_ktab_type = "WRFILE"; @@ -1046,20 +1046,7 @@ kadmin_list(argc, argv) requestname = argv[0]; error = 0; verbose = 0; -#if HAVE_REGCOMP - if (match_error = regcomp(&match_exp, lprinc_all_regexp, REG_EXTENDED)) { - errmsg_size = regerror(match_error, - &match_exp, - match_errmsg, - sizeof(match_errmsg)); - com_err(requestname, 0, lprinc_regexp_fmt, lprinc_all_regexp, - match_errmsg); - return; - } -#else /* HAVE_REGCOMP */ - re_comp(".*"); /* Accept everything */ -#endif /* HAVE_REGCOMP */ - + for (i=1; i<argc; i++) { if (!strcmp(argv[i], help_option)) { com_err(argv[0], 0, lprinc_usage_fmt, argv[0], verbose_option); @@ -1070,32 +1057,14 @@ kadmin_list(argc, argv) verbose = 1; continue; } -#if HAVE_REGCOMP - if (match_error = regcomp(&match_exp, argv[i], REG_EXTENDED)) { - errmsg_size = regerror(match_error, - &match_exp, - match_errmsg, - sizeof(match_errmsg)); - com_err(requestname, 0, lprinc_regexp_fmt, argv[i], match_errmsg); - error = 1; - } - else - continue; -#else /* HAVE_REGCOMP */ - if (!(re_result = re_comp(argv[i]))) { - continue; - } - else { - com_err(argv[0], 0, lprinc_regexp_fmt, re_result); - error = 1; - } -#endif /* HAVE_REGCOMP */ } + if (!error) { char *next; char *nnext; krb5_ui_4 valid; krb5_db_entry *dbentry; + int match; if (dbentry = (krb5_db_entry *) malloc(sizeof(krb5_db_entry))) { memset((char *) dbentry, 0, sizeof(*dbentry)); @@ -1116,50 +1085,71 @@ kadmin_list(argc, argv) com_err(argv[0], 0, cant_get_fmt, lprinc_first_msg); break; } + match = 0; + for (i=1; i<argc; i++) { + if (!strcmp(argv[i], verbose_option)) + continue; #if HAVE_REGCOMP - if (match_error = regexec(&match_exp, - next, - 1, - &match_match, - 0)) { - if (match_error != REG_NOMATCH) { + if (match_error = regcomp(&match_exp, + argv[i], + REG_EXTENDED)) { errmsg_size = regerror(match_error, &match_exp, match_errmsg, sizeof(match_errmsg)); com_err(requestname, 0, - lprinc_regsrch_fmt, + lprinc_regexp_fmt, argv[i], - next, match_errmsg); error = 1; + break; } - } - else { - /* - * We have a match. See if it matches the whole - * name. - */ - if ((match_match.rm_so == 0) && - (match_match.rm_eo == strlen(next))) { - if (verbose) { - kadmin_print_entry(next, valid, dbentry); + if (match_error = regexec(&match_exp, + next, + 1, + &match_match, + 0)) { + if (match_error != REG_NOMATCH) { + errmsg_size = regerror(match_error, + &match_exp, + match_errmsg, + sizeof(match_errmsg)); + com_err(requestname, 0, + lprinc_regsrch_fmt, + argv[i], + next, + match_errmsg); + error = 1; } - else { - printf("%s\n", next); + } + else { + /* + * We have a match. See if it matches the whole + * name. + */ + if ((match_match.rm_so == 0) && + (match_match.rm_eo == strlen(next))) { + match = 1; } } - } #else /* HAVE_REGCOMP */ - if (re_exec(next)) { - if (verbose) { - kadmin_print_entry(next, valid, dbentry); + if (!(re_result = re_comp(argv[i]))) { + com_err(argv[0], 0, lprinc_regexp_fmt, re_result); + error = 1; + break; } - else { + if (re_exec(next)) + match = 1; +#endif /* HAVE_REGCOMP */ + } + if (error) + break; + if (match || (argc == 1)) { + if (verbose) + kadmin_print_entry(next, valid, dbentry); + else printf("%s\n", next); - } } -#endif /* HAVE_REGCOMP */ free(next); next = nnext; krb5_db_free_principal(kcontext, dbentry, 1); |
