56]TNP d dl Z d ZdS ) Nc 0 | d d }t j dt j t j z } |dd D ]S}t j |t j t j z t j z | }t j | |}Tt j |d t j t j z | }t j | n# t j | w xY w|S )a
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
/N)dir_fd)lstripsplitosopenO_RDONLYO_DIRECTORY
O_NOFOLLOWclose)pathpartsfd componentnext_fd result_fds /builddir/build/BUILDROOT/lve-stats-4.3.2-1.el9.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/commons/fileutil.py
open_nofollowr s
KK""3''E bkBN2 3 3B
ss Igbm+bn< G
HRLLLBBG"Ir{R]22
s
BC= =D)r r r