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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rpcsec.c
          +++ new/usr/src/cmd/cmd-inet/usr.sbin/snoop/snoop_rpcsec.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  16   16   * If applicable, add the following below this CDDL HEADER, with the
  17   17   * fields enclosed by brackets "[]" replaced with your own identifying
  18   18   * information: Portions Copyright [yyyy] [name of copyright owner]
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  /*
  23   23   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   * Copyright 2012 Milan Jurik. All rights reserved.
       26 + * Copyright 2017 Gary Mills
  26   27   */
  27   28  
  28   29  #include <sys/types.h>
  29   30  #include <sys/errno.h>
  30   31  #include <sys/tiuser.h>
  31   32  #include <setjmp.h>
  32   33  
  33   34  #include <rpc/types.h>
  34   35  #include <rpc/xdr.h>
  35   36  #include <rpc/auth.h>
↓ open down ↓ 250 lines elided ↑ open up ↑
 286  287          return (0);
 287  288  }
 288  289  
 289  290  /*
 290  291   *  Skip the header RPCSEC_GSS cred data and
 291  292   *  put service and control type in the xid cache.
 292  293   */
 293  294  void
 294  295  extract_rpcsec_gss_cred_info(int xid)
 295  296  {
 296      -        unsigned int seq_num;
 297  297          unsigned int handle_len;
 298      -        unsigned int flavor_len;
 299  298          unsigned int rpcsec_gss_ver;
 300  299          rpc_gss_service_t rpcsec_gss_service;
 301  300          unsigned int rpcsec_gss_proc;
 302  301          struct cache_struct *x;
 303  302  
 304      -        flavor_len = getxdr_u_long();
      303 +        (void) getxdr_u_long();
 305  304          rpcsec_gss_ver = getxdr_u_long();
 306  305          /* see if we know this version or not */
 307  306          if (rpcsec_gss_ver != 1) {
 308  307                  longjmp(xdr_err, 1);
 309  308          }
 310  309          rpcsec_gss_proc   = getxdr_u_long();
 311      -        seq_num    = getxdr_u_long();
      310 +        (void) getxdr_u_long();
 312  311          rpcsec_gss_service    = getxdr_enum();
 313  312          /* skip the handle */
 314  313          xdr_skip(RNDUP(getxdr_u_long()));
 315  314  
 316  315          if (x = find_xid(xid)) {
 317  316                  x->xid_gss_service = rpcsec_gss_service;
 318  317                  x->xid_gss_proc = rpcsec_gss_proc;
 319  318          }
 320  319  
 321  320  }
 322  321  
 323  322  /*
 324  323   *  Print the argument data for the RPCSEC_GSS_INIT control procedure.
 325  324   */
 326  325  static void
 327  326  print_rpc_gss_init_arg(int flags, struct cache_struct *x)
 328  327  {
 329  328  
 330      -        char *token, *line;
      329 +        char  *line;
 331  330          unsigned int token_len;
 332  331          int pos = 0;
 333  332  
 334  333          /*
 335  334           *  see if we need to print out the rpc_gss_init_arg structure
 336  335           *  or not.
 337  336           */
 338  337  
 339  338          if (x->xid_gss_proc != RPCSEC_GSS_INIT &&
 340  339              x->xid_gss_proc != RPCSEC_GSS_CONTINUE_INIT) {
 341  340                  return;
 342  341          }
 343  342  
 344  343          /* print it */
 345  344  
 346  345          (void) sprintf(get_line(pos, getxdr_pos()),
 347  346              "RPCSEC_GSS_INIT args:");
 348  347  
 349  348          pos = getxdr_pos();
 350  349          token_len = getxdr_u_long();
 351      -        token = getxdr_hex(token_len);
      350 +        (void) getxdr_hex(token_len);
 352  351          line = get_line(pos, getxdr_pos());
 353  352          sprintf(line, "   gss token: length = %d, data = [%d bytes]",
 354  353              token_len, token_len);
 355  354  
 356  355          show_trailer();
 357  356  }
 358  357  
 359  358  /*
 360  359   *  Print the results data for the RPCSEC_GSS_INIT control procedure.
 361  360   */
 362  361  void
 363  362  print_rpc_gss_init_res(int flags)
 364  363  {
 365  364  
 366      -        char *handle, *token, *line;
      365 +        char *handle, *line;
 367  366          unsigned int token_len, handle_len;
 368  367          unsigned int major, minor, seq_window;
 369  368  
 370  369          int pos = 0;
 371  370          struct cache_struct *x;
 372  371  
 373  372          /* print it */
 374  373  
 375  374          (void) sprintf(get_line(pos, getxdr_pos()), "RPCSEC_GSS_INIT result:");
 376  375  
↓ open down ↓ 11 lines elided ↑ open up ↑
 388  387          (void) sprintf(get_line(pos, getxdr_pos()),
 389  388              "   gss_major status = %u", major);
 390  389  
 391  390          (void) sprintf(get_line(pos, getxdr_pos()),
 392  391              "   gss_minor status = %u", minor);
 393  392  
 394  393          (void) sprintf(get_line(pos, getxdr_pos()),
 395  394              "   sequence window  = %u", seq_window);
 396  395          pos = getxdr_pos();
 397  396          token_len = getxdr_u_long();
 398      -        token = getxdr_hex(token_len);
      397 +        (void) getxdr_hex(token_len);
 399  398          line = get_line(pos, getxdr_pos());
 400  399          sprintf(line, "   gss token: length = %d, data = [%d bytes]",
 401  400              token_len, token_len);
 402  401          show_trailer();
 403  402  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX