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

def global_dialog::GlobalDialog::__validate_log_file (   path  )  [private]

Validate the "log_file" setting.

Return an error message, or None if no error is detected.

Definition at line 390 of file global_dialog.py.

00390                                  :
        '''Validate the "log_file" setting.

        Return an error message, or None if no error is detected.

        '''
        dirname = os.path.dirname(path)
        if not os.path.isdir(dirname):
            return _('"%s" is not an existing directory') % dirname
        try:
            st = os.stat(path)
        except OSError:
            pass
        else:
            if not stat.S_ISREG(st.st_mode):
                return _('"%s" is not a regular file') % path
            if st.st_uid != 0:
                return _('"%s" is not owned by root') % path
            if ((st.st_mode & (stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)) !=
                (stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP)):
                return _('Permissions of "%s" should be 0640') % path
        return None

    @staticmethod
    def __validate_exe(path):


Generated by  Doxygen 1.6.0   Back to index