Logo Search packages:      
Sourcecode: condor version File versions  Download package

void DaemonCore::InitSettableAttrsLists ( void   )  [private]

Initialize our array of StringLists that we use to verify if a given request to set a configuration variable with condor_config_val should be allowed.

Definition at line 9150 of file daemon_core.cpp.

Referenced by reconfig().

{
      int i;

            // First, clean out anything that might be there already.
      for( i=0; i<LAST_PERM; i++ ) {
            if( SettableAttrsLists[i] ) {
                  delete SettableAttrsLists[i];
                  SettableAttrsLists[i] = NULL;
            }
      }

            // Now, for each permission level we care about, see if
            // there's an entry in the config file.  We first check for
            // "<SUBSYS>_SETTABLE_ATTRS_<PERM-LEVEL>", if that's not
            // there, we just check for "SETTABLE_ATTRS_<PERM-LEVEL>".
      for( i=0; i<LAST_PERM; i++ ) {
                  // skip permission levels we know we don't want to trust
            if( i == ALLOW ) {
                  continue;
            }
            if( InitSettableAttrsList(get_mySubSystem()->getName(), i) ) {
                        // that worked, move on to the next perm level
                  continue;
            }
                  // there's no subsystem-specific one, just try the generic
                  // version.  if this doesn't work either, we just leave
                  // this StringList NULL and will ignore cmds from it.
            InitSettableAttrsList( NULL, i );
      }

#if (DEBUG_SETTABLE_ATTR_LISTS)
            // Just for debugging, print out everything
      char* tmp;
      for( i=0; i<LAST_PERM; i++ ) {
            if( SettableAttrsLists[i] ) {
                  tmp = (SettableAttrsLists[i])->print_to_string();
                  dprintf( D_ALWAYS, "SettableAttrList[%s]: %s\n",
                               PermString((DCpermission)i), tmp );
                  free( tmp );
            }
      }
#endif
}


Generated by  Doxygen 1.6.0   Back to index