--- check_perms.bak 2014-01-16 15:52:56.000000000 -0600 +++ check_perms 2014-01-16 15:54:18.000000000 -0600 @@ -83,7 +83,7 @@ def statgidmode(path): stat = os.stat(path) - return stat[ST_MODE], stat[ST_GID] + return stat[ST_MODE], stat[ST_UID], stat[ST_GID] seen = {} @@ -109,7 +109,7 @@ if arg.VERBOSE: print _(' checking gid and mode for %(path)s') try: - mode, gid = statgidmode(path) + mode, uid, gid = statgidmode(path) except OSError, e: if e.errno <> errno.ENOENT: raise continue @@ -126,6 +126,19 @@ os.chown(path, -1, MAILMAN_GID) else: print + if uid <> MAILMAN_UID: + try: + username = pwd.getpwuid(uid)[0] + except KeyError: + username = '' % uid + arg.ERRORS += 1 + print _('%(path)s bad user (has: %(username)s, ' + 'expected %(MAILMAN_USER)s)'), + if STATE.FIX: + print _('(fixing)') + os.lchown(path, MAILMAN_UID, -1) + else: + print # Most directories must be at least rwxrwsr-x. # The private archive directory and database directory must be at # least rwxrws---. Their 'other' permissions are checked in