/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 04:29:35 UTC
  • Revision ID: teddy@fukt.bsnet.se-20090113042935-ztxe47n42q5z767b
* plugin-runner.c (main): Bug fix; do not accept a "d" character after
                          user ID or group ID numbers.  Bug fix: use
                          "%u" when printing PID of coredumped plugin,
                          not "%d".
* plugins.d/password-prompt.c (main): Remove comment which was copied
                                      from another program by mistake.
* plugins.d/splashy.c: Only comment changes.
* plugins.d/usplash.c: - '' -

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, "%u", &uid);
 
468
      if(ret != 1){
 
469
        fprintf(stderr, "Bad user ID number: \"%s\", using %u\n", arg,
 
470
                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, "%u", &gid);
 
476
      if(ret != 1){
 
477
        fprintf(stderr, "Bad group ID number: \"%s\", using %u\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
525
539
                       .args_doc = "",
526
540
                       .doc = "Mandos plugin runner -- Run plugins" };
527
541
  
528
 
  /* Parse using the parse_opt_config_file in order to get the custom
 
542
  /* Parse using parse_opt_config_file() in order to get the custom
529
543
     config file location, if any. */
530
544
  ret = argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, NULL);
531
545
  if (ret == ARGP_ERR_UNKNOWN){
954
968
                      (unsigned int) (proc->pid),
955
969
                      WTERMSIG(proc->status));
956
970
            } else if(WCOREDUMP(proc->status)){
957
 
              fprintf(stderr, "Plugin %d dumped core\n",
 
971
              fprintf(stderr, "Plugin %u dumped core\n",
958
972
                      (unsigned int) (proc->pid));
959
973
            }
960
974
          }