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

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

Modify rule to reflect dialog state.

Definition at line 215 of file rule_dialog.py.

00215                               :
        '''Modify rule to reflect dialog state.'''
        rule.action = self._radio_get(self.__action_map)

        del rule.fields[:]
        if (audit.AUDIT_FILTERKEY not in self.excluded_fields and
            self.rule_key_present.get_active()):
            f = Field()
            f.var = audit.AUDIT_FILTERKEY
            f.op = Field.OP_EQ
            f.value = self.rule_key.get_text()
            rule.fields.append(f)
        if audit.AUDIT_ARCH not in self.excluded_fields:
            if self.rule_arch_present.get_active():
                f = Field()
                f.var = audit.AUDIT_ARCH
                f.op = Field.OP_EQ
                f.value = self.rule_arch.child.get_text()
                try:
                    rule.machine = util.parse_elf(f.value)
                except util.ParsingError:
                    assert False, 'Should have been validated'
                rule.fields.append(f)
            else:
                rule.machine = util.audit_machine_id
        it = self.fields_store.get_iter_first()
        while it is not None:
            rule.fields.append(self.fields_store.get_value(it, 0))
            it = self.fields_store.iter_next(it)

        if audit.AUDIT_ARCH not in self.excluded_fields:
            del rule.syscalls[:]
            if self.rule_syscalls_not_all.get_active():
                it = self.syscall_store.get_iter_first()
                while it is not None:
                    name = self.syscall_store.get_value(it, 0)
                    try:
                        sc = util.parse_syscall(name, self.machine_id)
                    except util.ParsingError:
                        assert False, 'Should have been validated'
                    rule.syscalls.append(sc)
                    it = self.syscall_store.iter_next(it)
                assert len(rule.syscalls) > 0
            else:
                rule.syscalls.append(Rule.SYSCALLS_ALL)

    def _validate_get_failure(self):


Generated by  Doxygen 1.6.0   Back to index