/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugin-runner.c

  • Committer: Teddy Hogeborn
  • Date: 2009-01-13 01:36:46 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090113013646-1u21ie2oaotcekdz
* plugin-runner.c (main): Use "sscanf" instead of "strtol"; using the
                          correct type instead of casting.
* plugins.d/mandos-cliend.c (main): Detect an empty string when
                                    parsing DH bits and port number.
* plugins.d/splashy.c (main): Use "sscanf" instead of "strtoul"; using
                              the correct type instead of casting.
* plugins.d/usplash.c (main): - '' -

Show diffs side-by-side

added added

removed removed

Lines of Context:
463
463
      /* This is already done by parse_opt_config_file() */
464
464
      break;
465
465
    case 130:                   /* --userid */
466
 
      uid = (uid_t)strtol(arg, NULL, 10);
 
466
      /* In the GNU C library, uid_t is always unsigned int */
 
467
      ret = sscanf(arg, "%ud", &uid);
 
468
      if(ret != 1){
 
469
        fprintf(stderr, "Bad user ID number: \"%s\", using %ud\n",
 
470
                arg, uid);
 
471
      }
467
472
      break;
468
473
    case 131:                   /* --groupid */
469
 
      gid = (gid_t)strtol(arg, NULL, 10);
 
474
      /* In the GNU C library, gid_t is always unsigned int */
 
475
      ret = sscanf(arg, "%ud", &gid);
 
476
      if(ret != 1){
 
477
        fprintf(stderr, "Bad group ID number: \"%s\", using %ud\n",
 
478
                arg, gid);
 
479
      }
470
480
      break;
471
481
    case 132:                   /* --debug */
472
482
      debug = true;
473
483
      break;
 
484
/*
 
485
 * When adding more options before this line, remember to also add a
 
486
 * "case" to the "parse_opt_config_file" function below.
 
487
 */
474
488
    case ARGP_KEY_ARG:
475
489
      /* Cryptsetup always passes an argument, which is an empty
476
490
         string if "none" was specified in /etc/crypttab.  So if