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

def rule_dialog::RuleDialog::_load_rule (   self,
  rule 
) [private]

Modify dialog controls to reflect rule.

Definition at line 168 of file rule_dialog.py.

00168                               :
        '''Modify dialog controls to reflect rule.'''
        self._radio_set(rule.action, self.__action_map)
        if audit.AUDIT_FILTERKEY not in self.excluded_fields:
            for f in rule.fields:
                if f.var == audit.AUDIT_FILTERKEY:
                    self.rule_key_present.set_active(True)
                    self.rule_key.set_text(f.value)
                    break
            else:
                self.rule_key_present.set_active(False)
                self.rule_key.set_text('')
        if audit.AUDIT_ARCH not in self.excluded_fields:
            for f in rule.fields:
                if f.var == audit.AUDIT_ARCH:
                    self.rule_arch_present.set_active(True)
                    try:
                        m = util.parse_elf(f.value)
                    except util.ParsingError:
                        assert False, 'Rule should not have been created'
                    util.set_combo_entry_text(self.rule_arch, f.value)
                    break
            else:
                self.rule_arch_present.set_active(False)
                self.rule_arch.set_active(-1)
                self.rule_arch.child.set_text('')
                m = util.audit_machine_id
            assert rule.machine == m
            self.__rule_arch_changed()

        if audit.AUDIT_ARCH not in self.excluded_fields:
            self.syscall_store.clear()
            if Rule.SYSCALLS_ALL in rule.syscalls:
                self.rule_syscalls_not_all.set_active(False)
            else:
                self.rule_syscalls_not_all.set_active(True)
                for sc in rule.syscalls:
                    name = util.syscall_string(sc, self.machine_id)
                    self.syscall_store.append((name,))

        self.fields_store.clear()
        for field in rule.fields:
            if field.var not in (audit.AUDIT_ARCH, audit.AUDIT_FILTERKEY):
                it = self.fields_store.append()
                self.fields_store.set_value(it, 0, field)
                self.__update_fields_store_row(it)

    def _save_rule(self, rule):


Generated by  Doxygen 1.6.0   Back to index