From 9414c578aeb2cf48d2b500e1f102cd819c325df5 Mon Sep 17 00:00:00 2001 From: Paul Park Date: Fri, 5 May 1995 15:38:09 +0000 Subject: [PATCH] Remove getopt(3) options too git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5735 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/kpasswd/kpasswd.c | 4 +++- src/kadmin/v5server/srv_main.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/kadmin/kpasswd/kpasswd.c b/src/kadmin/kpasswd/kpasswd.c index 452e92ce5..47460e6f2 100644 --- a/src/kadmin/kpasswd/kpasswd.c +++ b/src/kadmin/kpasswd/kpasswd.c @@ -58,8 +58,10 @@ static const char *kpwd_old_pwd_name_fmt = "Enter old password for %s: "; #ifdef LANGUAGES_SUPPORTED static const char *kpwd_usage_error_fmt = "%s: usage is %s [-u user] [-l language]\n"; +static const char *kpwd_getoptstring = "l:u:"; #else /* LANGUAGES_SUPPORTED */ static const char *kpwd_usage_error_fmt = "%s: usage is %s [-u user]\n"; +static const char *kpwd_getoptstring = "u:"; #endif /* LANGUAGES_SUPPORTED */ static const char *kpwd_extra_args = "extra arguments"; static const char *kpwd_bad_option_fmt = "%s: unrecognized option -%c.\n"; @@ -198,7 +200,7 @@ main(argc, argv) * Usage is: * kpasswd [-u user] [-l language] */ - while ((option = getopt(argc, argv, "l:mu:")) != EOF) { + while ((option = getopt(argc, argv, kpwd_getoptstring)) != EOF) { switch (option) { case 'u': if ((name = (char *) malloc(strlen(optarg)+1)) == NULL) { diff --git a/src/kadmin/v5server/srv_main.c b/src/kadmin/v5server/srv_main.c index 2d3cda226..fdc7d50ee 100644 --- a/src/kadmin/v5server/srv_main.c +++ b/src/kadmin/v5server/srv_main.c @@ -47,8 +47,10 @@ #ifdef LANGUAGES_SUPPORTED static const char *usage_format = "%s: usage is %s [-a aclfile] [-d database] [-e enctype] [-i]\n\t[-k mkeytype] [-l langlist] [-r realm] [-t timeout]\n\t[-D dbg] [-M mkeyname].\n"; +static const char *getopt_string = "a:d:e:ik:l:r:t:D:M:"; #else /* LANGUAGES_SUPPORTED */ static const char *usage_format = "%s: usage is %s [-a aclfile] [-d database] [-e enctype] [-i]\n\t[-k mkeytype] [-r realm] [-t timeout]\n\t[-D dbg] [-M mkeyname].\n"; +static const char *getopt_string = "a:d:e:ik:r:t:D:M:"; #endif /* LANGUAGES_SUPPORTED */ static const char *fval_not_number = "%s: value (%s) specified for -%c is not numeric.\n"; static const char *extra_params = "%s extra paramters beginning with %s... \n"; @@ -169,7 +171,7 @@ main(argc, argv) * [-M masterkeyname] */ error = 0; - while ((option = getopt(argc, argv, "a:d:e:ik:l:m:r:t:D:M:")) != EOF) { + while ((option = getopt(argc, argv, getopt_string)) != EOF) { switch (option) { case 'a': acl_file = optarg; -- 2.26.2