]> git.proxmox.com Git - mirror_lxcfs.git/commit
replace opathdir with opendir_flags
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 5 Jul 2022 11:55:20 +0000 (13:55 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 5 Jul 2022 11:58:41 +0000 (13:58 +0200)
commitf5227e5c01c42cf110bb851e30ffdfa13d4ab225
tree719dc14dace7ea9bb51ea21b14dc27a596e1f713
parentfa274fb9f544cf2c697335c1b1e2df97e81fbe86
replace opathdir with opendir_flags

`opathdir` was used to replace `opendir` in order to ensure
`O_NOFOLLOW` and `O_CLOEXEC` were set, however it also added
`O_PATH` which prevents `readdir`/`getdents` to be used on
it, causing the `/sys/devices/system/cpu/<subdir>`
directories to be empty.

Instead, let's have an `opendir_flags` utility which simply
passed additional flags to the `open(..., O_DIRECTORY)` call
preceding `fdopendir()`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/sysfs_fuse.c
src/utils.c
src/utils.h