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

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

Validate an "*_exe" setting.

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

Definition at line 414 of file global_dialog.py.

00414                             :
        '''Validate an "*_exe" setting.

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

        '''
        if not path.startswith('/'):
            return _('"%s" is not an absolute path') % path
        try:
            st = os.stat(path)
        except OSError, e:
            return (_('Error getting attributes of "%(path)s": %(msg)s') %
                    {'path': path, 'msg': e.strerror})
        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_IRWXU | stat.S_IRGRP | stat.S_IXGRP)):
            return _('Permissions of "%s" should be 075x') % path
        if (st.st_mode & stat.S_IWOTH) != 0:
            return _('"%s" should not be writable by other users') % path
        return None

    @staticmethod
    def __validate_email_use():


Generated by  Doxygen 1.6.0   Back to index