1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 06:25:37 +03:00
systemd/src
Lennart Poettering db55bbf29b stat-util: fix dir_is_empty() with hidden/backup files
This is a follow-up for f470cb6d13 which in
turn is a follow-up for a068aceafb.

The latter started to honour hidden files when deciding whether a
directory is empty. The former reverted to the old behaviour to fix
issue #23220.

It introduced a bug though: when a directory contains a larger number of
hidden entries the getdents64() buffer will not suffice to read them,
since we just allocate three entries for it (which is definitely enough
if we just ignore the . + .. entries, but not ig we ignore more).

I think it's a bit confusing that dir_is_empty() can return true even if
rmdir() on the dir would return ENOTEMPTY. Hence, let's rework the
function to make it optional whether hidden files are ignored or not.
After all, I looking at the users of this function I am pretty sure in
more cases we want to honour hidden files.
2022-05-04 13:29:14 +02:00
..
ac-power
activate
analyze analyze security: print DeviceAllow list 2022-05-01 13:43:01 +09:00
ask-password
backlight
basic stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
binfmt
boot stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
busctl
cgls
cgroups-agent
cgtop
core stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
coredump meson: use a single constant for default compression setting 2022-04-22 15:08:28 +02:00
creds creds: trivial coding style fixes 2022-05-02 18:04:53 +02:00
cryptenroll cryptenroll,homectl: Introduce --fido2-credential-algorithm option 2022-04-22 20:22:40 +02:00
cryptsetup
debug-generator
delta
detect-virt
dissect tree-wide: take BSD lock on loopback devices we dissect/mount/operate on 2022-04-10 22:52:29 +09:00
environment-d-generator
escape
firstboot
fsck
fstab-generator
fundamental
fuzz compress: make Compression a regular non-sparse enum 2022-04-26 21:55:49 +02:00
getty-generator
gpt-auto-generator stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
hibernate-resume devnum-util: define helper macros for formatting devnum major/minor pairs 2022-04-13 16:26:31 +02:00
home stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
hostname hostnamed: update to use new style sd-bus macros 2022-04-21 23:22:52 +02:00
hwdb
id128
import
initctl
integritysetup
journal journal: Use header macros everywhere instead of JournalFile fields 2022-05-03 17:23:02 +02:00
journal-remote
kernel-install kernel-install: Skip execution if $KERNEL_INSTALL_BYPASS=1 2022-04-22 09:12:08 +09:00
libsystemd sd-network: Keep inotify watch if watch descriptor didn't change 2022-05-04 07:00:56 +09:00
libsystemd-network sd-lldp: use memcpy_safe() as the buffer size may be zero 2022-05-04 16:05:04 +09:00
libudev
locale
login login: drop non-default value for RuntimeDirectoryInodesMax= 2022-04-29 21:15:21 +09:00
machine machine: update to use new-style sd-bus macros (#23012) 2022-04-08 21:43:18 +01:00
machine-id-setup
modules-load
mount
network udev: check stats of .link files and their drop-in files 2022-05-03 10:26:22 +02:00
notify
nspawn stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
nss-myhostname nss-myhostname: do not return IPv6 local address if IPv6 is disabled 2022-04-23 04:18:51 +09:00
nss-mymachines
nss-resolve
nss-systemd
oom oomd: "descendent" → "descendant" 2022-04-28 15:46:44 +02:00
partition basic: split out dev_t related calls into new devno-util.[ch] 2022-04-13 16:26:31 +02:00
path
portable tree-wide: take BSD lock on loopback devices we dissect/mount/operate on 2022-04-10 22:52:29 +09:00
pstore
quotacheck
random-seed
rc-local-generator
remount-fs
reply-password
resolve resolve: fix typo in dns_class_is_pseudo() 2022-04-18 07:01:17 +09:00
rfkill
rpm
run
run-generator
shared stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
shutdown
sleep
socket-proxy
stdio-bridge
sulogin-shell
sysctl
sysext stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
system-update-generator
systemctl systemctl: colorize "enabled" in 'systemctl status ...' 2022-04-17 14:30:46 +09:00
systemd sd-ndisc: drop unused function 2022-05-04 16:03:57 +09:00
sysupdate basic: split out dev_t related calls into new devno-util.[ch] 2022-04-13 16:26:31 +02:00
sysusers
sysv-generator
test stat-util: fix dir_is_empty() with hidden/backup files 2022-05-04 13:29:14 +02:00
timedate timedate: update to use new-style sd-bus macros 2022-04-11 23:10:06 +09:00
timesync timesync: update to use new-style sd-bus macros 2022-04-11 10:50:33 +02:00
tmpfiles Merge pull request #23021 from fbuihuu/tmpfiles-fix-precedence-with-plus-sign 2022-04-16 01:36:51 +09:00
tty-ask-password-agent
udev udev: check stats of .link files and their drop-in files 2022-05-03 10:26:22 +02:00
update-done
update-utmp
user-sessions
userdb
vconsole
veritysetup
version
volatile-root basic: split out dev_t related calls into new devno-util.[ch] 2022-04-13 16:26:31 +02:00
xdg-autostart-generator