From 107cd3254e32640c08577ce630b51e75a9d871f4 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 22 Jun 2001 11:29:13 +0000 Subject: [PATCH] * kdb5_util.c (main): Change optarg to koptarg to prevent shadowing of getopt function. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13488 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/dbutil/ChangeLog | 5 +++++ src/kadmin/dbutil/kdb5_util.c | 18 +++++++++--------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index 6baa3ff70..66947de1e 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,8 @@ +2001-06-21 Ezra Peisach + + * kdb5_util.c (main): Change optarg to koptarg to prevent + shadowing of getopt function. + 2001-06-20 Ezra Peisach * kdb5_create.c: Include for diff --git a/src/kadmin/dbutil/kdb5_util.c b/src/kadmin/dbutil/kdb5_util.c index 849c24a9d..d44f86714 100644 --- a/src/kadmin/dbutil/kdb5_util.c +++ b/src/kadmin/dbutil/kdb5_util.c @@ -141,14 +141,14 @@ static struct _cmd_table *cmd_lookup(name) return NULL; } -#define ARG_VAL (--argc > 0 ? (optarg = *(++argv)) : (char *)(usage(), NULL)) +#define ARG_VAL (--argc > 0 ? (koptarg = *(++argv)) : (char *)(usage(), NULL)) int main(argc, argv) int argc; char *argv[]; { struct _cmd_table *cmd = NULL; - char *optarg, **cmd_argv; + char *koptarg, **cmd_argv; int cmd_argc; krb5_error_code retval; @@ -172,13 +172,13 @@ int main(argc, argv) argv++; argc--; while (*argv) { if (strcmp(*argv, "-P") == 0 && ARG_VAL) { - mkey_password = optarg; + mkey_password = koptarg; manual_mkey = TRUE; } else if (strcmp(*argv, "-d") == 0 && ARG_VAL) { - global_params.dbname = optarg; + global_params.dbname = koptarg; global_params.mask |= KADM5_CONFIG_DBNAME; } else if (strcmp(*argv, "-r") == 0 && ARG_VAL) { - global_params.realm = optarg; + global_params.realm = koptarg; global_params.mask |= KADM5_CONFIG_REALM; /* not sure this is really necessary */ if ((retval = krb5_set_default_realm(util_context, @@ -187,15 +187,15 @@ int main(argc, argv) exit(1); } } else if (strcmp(*argv, "-k") == 0 && ARG_VAL) { - if (krb5_string_to_enctype(optarg, &global_params.enctype)) - com_err(argv[0], 0, "%s is an invalid enctype", optarg); + if (krb5_string_to_enctype(koptarg, &global_params.enctype)) + com_err(argv[0], 0, "%s is an invalid enctype", koptarg); else global_params.mask |= KADM5_CONFIG_ENCTYPE; } else if (strcmp(*argv, "-M") == 0 && ARG_VAL) { - global_params.mkey_name = optarg; + global_params.mkey_name = koptarg; global_params.mask |= KADM5_CONFIG_MKEY_NAME; } else if (strcmp(*argv, "-sf") == 0 && ARG_VAL) { - global_params.stash_file = optarg; + global_params.stash_file = koptarg; global_params.mask |= KADM5_CONFIG_STASH_FILE; } else if (strcmp(*argv, "-m") == 0) { manual_mkey = TRUE; -- 2.26.2