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

def auditd_config::AuditdConfig::__interpret_option (   self,
  name,
  unused_equals,
  value,
  value2 = None 
) [private]

Handle a single configuration file option.

Raise ParsingError on error.

Definition at line 161 of file auditd_config.py.

00161                                                                            :
        '''Handle a single configuration file option.

        Raise ParsingError on error.

        '''
        name = name.lower()

        if name == 'admin_space_left_action':
            (action, exe) = self.__parse_action(value, value2)
            self.admin_space_left_action = action
            if exe is not None:
                self.admin_space_left_exe = exe
        elif name == 'disk_error_action':
            (action, exe) = self.__parse_action(value, value2)
            if action == self.FAILURE_EMAIL:
                raise ParsingError('Invalid value')
            self.disk_error_action = action
            if exe is not None:
                self.disk_error_exe = exe
        elif name == 'disk_full_action':
            (action, exe) = self.__parse_action(value, value2)
            if action == self.FAILURE_EMAIL:
                raise ParsingError('Invalid value')
            self.disk_full_action = action
            if exe is not None:
                self.disk_full_exe = exe
        elif name == 'space_left_action':
            (action, exe) = self.__parse_action(value, value2)
            self.space_left_action = action
            if exe is not None:
                self.space_left_exe = exe
        else:
            if value2 is not None:
                raise ParsingError('Only one value is expected for this '
                                   'keyword')

            if name == 'action_mail_acct':
                self.action_mail_acct = value
            elif name == 'admin_space_left':
                self.admin_space_left = util.parse_unsigned(value)
            elif name == 'disp_qos':
                try:
                    self.disp_qos = self.__disp_qos_values[value.lower()]
                except KeyError:
                    raise ParsingError('Invalid value')
            elif name == 'dispatcher':
                self.dispatcher = value
            elif name == 'flush':
                try:
                    self.flush = self.__flush_values[value.lower()]
                except KeyError:
                    raise ParsingError('Invalid value')
            elif name == 'freq':
                self.freq = util.parse_unsigned(value)
            elif name == 'log_file':
                self.log_file = value
            elif name == 'log_format':
                try:
                    self.log_format = self.__format_values[value.lower()]
                except KeyError:
                    raise ParsingError('Invalid value')
            elif name == 'log_group':
                self.log_group = value
            elif name == 'max_log_file':
                self.max_log_file = util.parse_unsigned(value)
            elif name == 'max_log_file_action':
                try:
                    self.max_log_file_action = \
                        self.__size_action_values[value.lower()]
                except KeyError:
                    raise ParsingError('Invalid value')
            elif name == 'name':
                self.name = value
            elif name == 'name_format':
                try:
                    self.name_format = self.__name_values[value.lower()]
                except KeyError:
                    raise ParsingError('Invalid value')
            elif name == 'num_logs':
                v = util.parse_unsigned(value)
                if v > 99:
                    raise ParsingError('Invalid value, valid range is 0..99')
                self.num_logs = v
            elif name == 'priority_boost':
                self.priority_boost = util.parse_unsigned(value)
            elif name == 'space_left':
                self.space_left = util.parse_unsigned(value)
            else:
                raise ParsingError('Unknown keyword')

    def read(self, client):


Generated by  Doxygen 1.6.0   Back to index