if not HAS_PWD:
        return None
    elif user is None:
        try:
            return os.geteuid()