/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: 2012-05-07 20:46:51 UTC
  • Revision ID: teddy@recompile.se-20120507204651-qx5o5ztwmau54mh4
* mandos-monitor: Speedup: Use properties from D-Bus
                  GetAllClientsWithProperties() call.  Also use
                  super() properly - only use keyword arguments and
                  strip them off as "kwargs" is passed on.
  (MandosClientPropertyCache.__init__): Take new "properties"
                                        argument; use it to skip
                                        calling D-Bus GetAll() method.
                                        Call super().  Bind self._
  (MandosClientPropertyCache._property_changed): New helper function.
  (MandosClientPropertyCache.property_changed): Changed to take
                                                keyword arguments.
  (MandosClientPropertyCache.delete): Bug fix: Don't call
                                      super().__init__().
  (MandosClientWidget.__init__): Don't take *args.  Strip used keyword
                                 arguments before calling super().
  (MandosClientWidget.property_changed): Removed dead code.
  (MandosClientWidget.delete): Don't take *args.
  (MandosClientWidget.property_changed): Don't take "value" argument,
                                         since it is not used.
  (ConstrainedListBox.keypress): Take *args, **kwargs and pass them on
                                 to super().

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
/*
3
3
 * Mandos plugin runner - Run Mandos plugins
4
4
 *
5
 
 * Copyright © 2008-2011 Teddy Hogeborn
6
 
 * Copyright © 2008-2011 Björn Påhlsson
 
5
 * Copyright © 2008-2012 Teddy Hogeborn
 
6
 * Copyright © 2008-2012 Björn Påhlsson
7
7
 * 
8
8
 * This program is free software: you can redistribute it and/or
9
9
 * modify it under the terms of the GNU General Public License as
426
426
    errno = 0;
427
427
    switch(key){
428
428
      char *tmp;
429
 
      intmax_t tmpmax;
 
429
      intmax_t tmp_id;
430
430
    case 'g':                   /* --global-options */
431
431
      {
432
432
        char *plugin_option;
505
505
      /* This is already done by parse_opt_config_file() */
506
506
      break;
507
507
    case 130:                   /* --userid */
508
 
      tmpmax = strtoimax(arg, &tmp, 10);
 
508
      tmp_id = strtoimax(arg, &tmp, 10);
509
509
      if(errno != 0 or tmp == arg or *tmp != '\0'
510
 
         or tmpmax != (uid_t)tmpmax){
 
510
         or tmp_id != (uid_t)tmp_id){
511
511
        argp_error(state, "Bad user ID number: \"%s\", using %"
512
512
                   PRIdMAX, arg, (intmax_t)uid);
513
513
        break;
514
514
      }
515
 
      uid = (uid_t)tmpmax;
 
515
      uid = (uid_t)tmp_id;
516
516
      break;
517
517
    case 131:                   /* --groupid */
518
 
      tmpmax = strtoimax(arg, &tmp, 10);
 
518
      tmp_id = strtoimax(arg, &tmp, 10);
519
519
      if(errno != 0 or tmp == arg or *tmp != '\0'
520
 
         or tmpmax != (gid_t)tmpmax){
 
520
         or tmp_id != (gid_t)tmp_id){
521
521
        argp_error(state, "Bad group ID number: \"%s\", using %"
522
522
                   PRIdMAX, arg, (intmax_t)gid);
523
523
        break;
524
524
      }
525
 
      gid = (gid_t)tmpmax;
 
525
      gid = (gid_t)tmp_id;
526
526
      break;
527
527
    case 132:                   /* --debug */
528
528
      debug = true;