Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/krb5/ldap_util/kdb5_ldap_realm.c
          +++ new/usr/src/cmd/krb5/ldap_util/kdb5_ldap_realm.c
   1    1  /*
        2 + * Copyright 2017 Gary Mills
   2    3   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
   3    4   * Use is subject to license terms.
   4    5   */
   5    6  
   6    7  /*
   7    8   * kadmin/ldap_util/kdb5_ldap_realm.c
   8    9   *
   9   10   * Copyright 1990,1991,2001, 2002 by the Massachusetts Institute of Technology.
  10   11   * All Rights Reserved.
  11   12   *
↓ open down ↓ 137 lines elided ↑ open up ↑
 149  150  static int get_ticket_policy(rparams,i,argv,argc)
 150  151      krb5_ldap_realm_params *rparams;
 151  152      int *i;
 152  153      char *argv[];
 153  154      int argc;
 154  155  {
 155  156      time_t date;
 156  157      time_t now;
 157  158      int mask = 0;
 158  159      krb5_error_code retval = 0;
 159      -    krb5_boolean no_msg = FALSE;
 160  160  
 161      -    krb5_boolean print_usage = FALSE;
 162  161      /* Solaris Kerberos */
 163  162      char *me = progname;
 164  163  
 165  164      time(&now);
 166  165      if (!strcmp(argv[*i], "-maxtktlife")) {
 167  166          if (++(*i) > argc-1)
 168      -            goto err_usage;
      167 +            goto err_nomsg;
 169  168          date = get_date(argv[*i]);
 170  169          if (date == (time_t)(-1)) {
 171  170              retval = EINVAL;
 172  171              com_err (me, retval, gettext("while providing time specification"));
 173  172              goto err_nomsg;
 174  173          }
 175  174          rparams->max_life = date-now;
 176  175          mask |= LDAP_REALM_MAXTICKETLIFE;
 177  176      }
 178  177  
 179  178  
 180  179      else if (!strcmp(argv[*i], "-maxrenewlife")) {
 181  180          if (++(*i) > argc-1)
 182      -            goto err_usage;
      181 +            goto err_nomsg;
 183  182  
 184  183          date = get_date(argv[*i]);
 185  184          if (date == (time_t)(-1)) {
 186  185              retval = EINVAL;
 187  186              com_err (me, retval, gettext("while providing time specification"));
 188  187              goto err_nomsg;
 189  188          }
 190  189          rparams->max_renewable_life = date-now;
 191  190          mask |= LDAP_REALM_MAXRENEWLIFE;
 192  191      } else if (!strcmp((argv[*i] + 1), "allow_postdated")) {
 193  192          if (*(argv[*i]) == '+')
 194  193              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_POSTDATED);
 195  194          else if (*(argv[*i]) == '-')
 196  195              rparams->tktflags |= KRB5_KDB_DISALLOW_POSTDATED;
 197  196          else
 198      -            goto err_usage;
      197 +            goto err_nomsg;
 199  198  
 200  199          mask |= LDAP_REALM_KRBTICKETFLAGS;
 201  200      } else if (!strcmp((argv[*i] + 1), "allow_forwardable")) {
 202  201          if (*(argv[*i]) == '+')
 203  202              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_FORWARDABLE);
 204  203  
 205  204          else if (*(argv[*i]) == '-')
 206  205              rparams->tktflags |= KRB5_KDB_DISALLOW_FORWARDABLE;
 207  206          else
 208      -            goto err_usage;
      207 +            goto err_nomsg;
 209  208  
 210  209          mask |= LDAP_REALM_KRBTICKETFLAGS;
 211  210      } else if (!strcmp((argv[*i] + 1), "allow_renewable")) {
 212  211          if (*(argv[*i]) == '+')
 213  212              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_RENEWABLE);
 214  213          else if (*(argv[*i]) == '-')
 215  214              rparams->tktflags |= KRB5_KDB_DISALLOW_RENEWABLE;
 216  215          else
 217      -            goto err_usage;
      216 +            goto err_nomsg;
 218  217  
 219  218          mask |= LDAP_REALM_KRBTICKETFLAGS;
 220  219      } else if (!strcmp((argv[*i] + 1), "allow_proxiable")) {
 221  220          if (*(argv[*i]) == '+')
 222  221              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_PROXIABLE);
 223  222          else if (*(argv[*i]) == '-')
 224  223              rparams->tktflags |= KRB5_KDB_DISALLOW_PROXIABLE;
 225  224          else
 226      -            goto err_usage;
      225 +            goto err_nomsg;
 227  226  
 228  227          mask |= LDAP_REALM_KRBTICKETFLAGS;
 229  228      } else if (!strcmp((argv[*i] + 1), "allow_dup_skey")) {
 230  229          if (*(argv[*i]) == '+')
 231  230              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_DUP_SKEY);
 232  231          else if (*(argv[*i]) == '-')
 233  232              rparams->tktflags |= KRB5_KDB_DISALLOW_DUP_SKEY;
 234  233          else
 235      -            goto err_usage;
      234 +            goto err_nomsg;
 236  235  
 237  236          mask |= LDAP_REALM_KRBTICKETFLAGS;
 238  237      }
 239  238  
 240  239      else if (!strcmp((argv[*i] + 1), "requires_preauth")) {
 241  240          if (*(argv[*i]) == '+')
 242  241              rparams->tktflags |= KRB5_KDB_REQUIRES_PRE_AUTH;
 243  242          else if (*(argv[*i]) == '-')
 244  243              rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PRE_AUTH);
 245  244          else
 246      -            goto err_usage;
      245 +            goto err_nomsg;
 247  246  
 248  247          mask |= LDAP_REALM_KRBTICKETFLAGS;
 249  248      } else if (!strcmp((argv[*i] + 1), "requires_hwauth")) {
 250  249          if (*(argv[*i]) == '+')
 251  250              rparams->tktflags |= KRB5_KDB_REQUIRES_HW_AUTH;
 252  251          else if (*(argv[*i]) == '-')
 253  252              rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_HW_AUTH);
 254  253          else
 255      -            goto err_usage;
      254 +            goto err_nomsg;
 256  255  
 257  256          mask |= LDAP_REALM_KRBTICKETFLAGS;
 258  257      } else if (!strcmp((argv[*i] + 1), "allow_svr")) {
 259  258          if (*(argv[*i]) == '+')
 260  259              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_SVR);
 261  260          else if (*(argv[*i]) == '-')
 262  261              rparams->tktflags |= KRB5_KDB_DISALLOW_SVR;
 263  262          else
 264      -            goto err_usage;
      263 +            goto err_nomsg;
 265  264  
 266  265          mask |= LDAP_REALM_KRBTICKETFLAGS;
 267  266      } else if (!strcmp((argv[*i] + 1), "allow_tgs_req")) {
 268  267          if (*(argv[*i]) == '+')
 269  268              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_TGT_BASED);
 270  269          else if (*(argv[*i]) == '-')
 271  270              rparams->tktflags |= KRB5_KDB_DISALLOW_TGT_BASED;
 272  271          else
 273      -            goto err_usage;
      272 +            goto err_nomsg;
 274  273  
 275  274          mask |= LDAP_REALM_KRBTICKETFLAGS;
 276  275      } else if (!strcmp((argv[*i] + 1), "allow_tix")) {
 277  276          if (*(argv[*i]) == '+')
 278  277              rparams->tktflags &= (int)(~KRB5_KDB_DISALLOW_ALL_TIX);
 279  278          else if (*(argv[*i]) == '-')
 280  279              rparams->tktflags |= KRB5_KDB_DISALLOW_ALL_TIX;
 281  280          else
 282      -            goto err_usage;
      281 +            goto err_nomsg;
 283  282  
 284  283          mask |= LDAP_REALM_KRBTICKETFLAGS;
 285  284      } else if (!strcmp((argv[*i] + 1), "needchange")) {
 286  285          if (*(argv[*i]) == '+')
 287  286              rparams->tktflags |= KRB5_KDB_REQUIRES_PWCHANGE;
 288  287          else if (*(argv[*i]) == '-')
 289  288              rparams->tktflags &= (int)(~KRB5_KDB_REQUIRES_PWCHANGE);
 290  289          else
 291      -            goto err_usage;
      290 +            goto err_nomsg;
 292  291  
 293  292          mask |= LDAP_REALM_KRBTICKETFLAGS;
 294  293      } else if (!strcmp((argv[*i] + 1), "password_changing_service")) {
 295  294          if (*(argv[*i]) == '+')
 296  295              rparams->tktflags |= KRB5_KDB_PWCHANGE_SERVICE;
 297  296          else if (*(argv[*i]) == '-')
 298  297              rparams->tktflags &= (int)(~KRB5_KDB_PWCHANGE_SERVICE);
 299  298          else
 300      -            goto err_usage;
      299 +            goto err_nomsg;
 301  300  
 302  301          mask |=LDAP_REALM_KRBTICKETFLAGS;
 303  302      }
 304      -err_usage:
 305      -    print_usage = TRUE;
 306  303  
 307  304  err_nomsg:
 308      -    no_msg = TRUE;
 309  305  
 310  306      return mask;
 311  307  }
 312  308  
 313  309  /*
 314  310   * This function will create a realm on the LDAP Server, with
 315  311   * the specified attributes.
 316  312   */
 317  313  void kdb5_ldap_create(argc, argv)
 318  314      int argc;
↓ open down ↓ 2362 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX