Print this page
8485 Remove set but unused variables in usr/src/cmd
*** 1,6 ****
--- 1,7 ----
/*
+ * Copyright 2017 Gary Mills
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*** 154,173 ****
{
time_t date;
time_t now;
int mask = 0;
krb5_error_code retval = 0;
- krb5_boolean no_msg = FALSE;
- krb5_boolean print_usage = FALSE;
/* Solaris Kerberos */
char *me = progname;
time(&now);
if (!strcmp(argv[*i], "-maxtktlife")) {
if (++(*i) > argc-1)
! goto err_usage;
date = get_date(argv[*i]);
if (date == (time_t)(-1)) {
retval = EINVAL;
com_err (me, retval, gettext("while providing time specification"));
goto err_nomsg;
--- 155,172 ----
{
time_t date;
time_t now;
int mask = 0;
krb5_error_code retval = 0;
/* Solaris Kerberos */
char *me = progname;
time(&now);
if (!strcmp(argv[*i], "-maxtktlife")) {
if (++(*i) > argc-1)
! goto err_nomsg;
date = get_date(argv[*i]);
if (date == (time_t)(-1)) {
retval = EINVAL;
com_err (me, retval, gettext("while providing time specification"));
goto err_nomsg;
*** 177,187 ****
}
else if (!strcmp(argv[*i], "-maxrenewlife")) {
if (++(*i) > argc-1)
! goto err_usage;
date = get_date(argv[*i]);
if (date == (time_t)(-1)) {
retval = EINVAL;
com_err (me, retval, gettext("while providing time specification"));
--- 176,186 ----
}
else if (!strcmp(argv[*i], "-maxrenewlife")) {
if (++(*i) > argc-1)
! goto err_nomsg;
date = get_date(argv[*i]);
if (date == (time_t)(-1)) {
retval = EINVAL;
com_err (me, retval, gettext("while providing time specification"));
*** 193,240 ****
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_POSTDATED);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_POSTDATED;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_forwardable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_FORWARDABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_FORWARDABLE;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_renewable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_RENEWABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_RENEWABLE;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_proxiable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_PROXIABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_PROXIABLE;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_dup_skey")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_DUP_SKEY);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_DUP_SKEY;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
}
else if (!strcmp((argv[*i] + 1), "requires_preauth")) {
--- 192,239 ----
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_POSTDATED);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_POSTDATED;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_forwardable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_FORWARDABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_FORWARDABLE;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_renewable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_RENEWABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_RENEWABLE;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_proxiable")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_PROXIABLE);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_PROXIABLE;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_dup_skey")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_DUP_SKEY);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_DUP_SKEY;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
}
else if (!strcmp((argv[*i] + 1), "requires_preauth")) {
*** 241,313 ****
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_PRE_AUTH;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PRE_AUTH);
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "requires_hwauth")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_HW_AUTH;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_HW_AUTH);
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_svr")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_SVR);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_SVR;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_tgs_req")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_TGT_BASED);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_TGT_BASED;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_tix")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_ALL_TIX);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_ALL_TIX;
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "needchange")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_PWCHANGE;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PWCHANGE);
else
! goto err_usage;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "password_changing_service")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_PWCHANGE_SERVICE;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_PWCHANGE_SERVICE);
else
! goto err_usage;
mask |=LDAP_REALM_KRBTICKETFLAGS;
}
- err_usage:
- print_usage = TRUE;
err_nomsg:
- no_msg = TRUE;
return mask;
}
/*
--- 240,309 ----
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_PRE_AUTH;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PRE_AUTH);
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "requires_hwauth")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_HW_AUTH;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_HW_AUTH);
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_svr")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_SVR);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_SVR;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_tgs_req")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_TGT_BASED);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_TGT_BASED;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "allow_tix")) {
if (*(argv[*i]) == '+')
rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_ALL_TIX);
else if (*(argv[*i]) == '-')
rparams->tktflags |= KRB5_KDB_DISALLOW_ALL_TIX;
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "needchange")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_REQUIRES_PWCHANGE;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PWCHANGE);
else
! goto err_nomsg;
mask |= LDAP_REALM_KRBTICKETFLAGS;
} else if (!strcmp((argv[*i] + 1), "password_changing_service")) {
if (*(argv[*i]) == '+')
rparams->tktflags |= KRB5_KDB_PWCHANGE_SERVICE;
else if (*(argv[*i]) == '-')
rparams->tktflags &= (int)(~KRB5_KDB_PWCHANGE_SERVICE);
else
! goto err_nomsg;
mask |=LDAP_REALM_KRBTICKETFLAGS;
}
err_nomsg:
return mask;
}
/*