$50 GRAYBYTE WORDPRESS FILE MANAGER $95

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.162.162 | ADMIN IP 216.73.216.51
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons//fileutil.py
# coding=utf-8
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT

import os


def open_nofollow(path):
    """
    Open *path* rejecting symlinks at every component, not just the
    leaf.  Uses openat() (via *dir_fd*) to walk each component with
    O_NOFOLLOW so that an attacker who controls an intermediate
    directory (e.g. /tmp/lshttpd owned by nobody) cannot substitute
    it with a symlink.

    :return: file descriptor (caller must close)
    :raises: OSError if any component is a symlink or does not exist
    """
    parts = path.lstrip('/').split('/')
    fd = os.open('/', os.O_RDONLY | os.O_DIRECTORY)
    try:
        for component in parts[:-1]:
            next_fd = os.open(
                component,
                os.O_RDONLY | os.O_NOFOLLOW | os.O_DIRECTORY,
                dir_fd=fd,
            )
            os.close(fd)
            fd = next_fd
        result_fd = os.open(
            parts[-1], os.O_RDONLY | os.O_NOFOLLOW, dir_fd=fd,
        )
    finally:
        os.close(fd)
    return result_fd

Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
19 May 2026 8.30 AM
root / root
0755
__pycache__
--
19 May 2026 8.30 AM
root / root
0755
__init__.py
0.214 KB
28 Apr 2026 1.04 PM
root / root
0644
argparse_utils.py
11.246 KB
28 Apr 2026 1.04 PM
root / root
0644
dateutil.py
5.627 KB
28 Apr 2026 1.04 PM
root / root
0644
decorators.py
0.872 KB
28 Apr 2026 1.04 PM
root / root
0644
fileutil.py
1.14 KB
28 Apr 2026 1.04 PM
root / root
0644
func.py
15.887 KB
28 Apr 2026 1.04 PM
root / root
0644
htpasswd.py
2.25 KB
28 Apr 2026 1.04 PM
root / root
0644
litespeed.py
7.736 KB
28 Apr 2026 1.04 PM
root / root
0644
logsetup.py
4.502 KB
28 Apr 2026 1.04 PM
root / root
0644
proctitle.py
4.702 KB
28 Apr 2026 1.04 PM
root / root
0644
profiler.py
0.562 KB
28 Apr 2026 1.04 PM
root / root
0644
progress.py
0.992 KB
28 Apr 2026 1.04 PM
root / root
0644
sentry.py
6.165 KB
28 Apr 2026 1.04 PM
root / root
0644
server_status.py
1.314 KB
28 Apr 2026 1.04 PM
root / root
0644
sizeutil.py
2.591 KB
28 Apr 2026 1.04 PM
root / root
0644
users_manager.py
2.971 KB
28 Apr 2026 1.04 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF Static GIF