/[pdpsoft]/trunk/grid-mw-security/ees/plugin_examples/posix_enf/src/posix_enf.c
ViewVC logotype

Diff of /trunk/grid-mw-security/ees/plugin_examples/posix_enf/src/posix_enf.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1381 by aramv, Tue Jan 12 11:23:26 2010 UTC revision 1382 by aramv, Wed Jan 13 10:49:06 2010 UTC
# Line 9  Line 9 
9    #define NGROUPS 32    #define NGROUPS 32
10  #endif  #endif
11    
12  static int maxuid        = MAX_UNDEFINED;  static int       maxuid        = MAX_UNDEFINED;
13  static int maxpgid       = MAX_UNDEFINED;  static int       maxpgid       = MAX_UNDEFINED;
14  static int maxsgid       = MAX_UNDEFINED;  static int       maxsgid       = MAX_UNDEFINED;
15  static int set_only_euid = 0;  static int       set_only_euid = 0;
16  static int set_only_egid = 0;  static int       set_only_egid = 0;
17  static char *plugin_name = "posix_enf";  static char      *plugin_name  = "posix_enf";
18    aos_context_t    *context      = NULL;
19    aos_attribute_t  *attribute    = NULL;
20    
21  EES_PL_RC plugin_initialize(int argc, char* argv[]){  EES_PL_RC plugin_initialize(int argc, char* argv[]){
22    static struct option long_options[] =    static struct option long_options[] =
# Line 46  EES_PL_RC plugin_initialize(int argc, ch Line 48  EES_PL_RC plugin_initialize(int argc, ch
48          maxsgid = atoi(optarg);          maxsgid = atoi(optarg);
49          break;          break;
50        case 'e':        case 'e':
51          if(strcmp(optarg,"yes") == 0){          if(strncmp(optarg,"yes", 4) == 0){
52            set_only_euid = 1;            set_only_euid = 1;
53          }          }
54          break;          break;
55        case 'g':        case 'g':
56          if(strcmp(optarg, "yes") == 0){          if(strncmp(optarg, "yes", 4) == 0){
57            set_only_egid = 1;            set_only_egid = 1;
58          }          }
59          break;          break;
# Line 79  EES_PL_RC plugin_initialize(int argc, ch Line 81  EES_PL_RC plugin_initialize(int argc, ch
81  }  }
82    
83  EES_PL_RC plugin_run(){  EES_PL_RC plugin_run(){
84      printf("Examining AOS\n");
85      while((context = getNextContext(OBLIGATION, NULL))){
86        printf("Context: %s\n", getContextObligationId(context));
87        if(strncmp(getContextObligationId(context), "uidgid", strlen("uidgid")) == 0){
88          while((attribute = getNextAttribute(context))){
89            if(strncmp(getAttributeId(attribute), "posix-uid", strlen("posix-uid")) == 0){
90              printf("Got UID: %s\n", getAttributeId(attribute));
91            } else if(strncmp(getAttributeId(attribute), "posix-gid", strlen("posix-gid")) == 0){
92              printf("Got primary GID: %s\n", getAttributeId(attribute));
93            }
94          }
95        }
96      }
97          return 0;          return 0;
98  }  }
99    

Legend:
Removed from v.1381  
changed lines
  Added in v.1382

grid.support@nikhef.nl
ViewVC Help
Powered by ViewVC 1.1.28