]> git.ipfire.org Git - thirdparty/systemd.git/commit
xattr-util: merge various getxattr()/listxattr() helpers into getxattr_at_malloc...
authorLennart Poettering <lennart@poettering.net>
Wed, 6 Oct 2021 14:31:49 +0000 (16:31 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Oct 2021 09:49:22 +0000 (11:49 +0200)
commitc53e07e249d4635babe901fd40dc1ecdfc32f0d4
treea0ea4c9b2d302ddfe19a83e71ebe680a0055f102
parentc9d1c37c93b779006d901b13e1c32b79cd03877a
xattr-util: merge various getxattr()/listxattr() helpers into getxattr_at_malloc() + listxattr_at_malloc()

Unfortunately fgetxattr() and flistxattr() don't work via O_PATH fds.
Let's thus add fallbacks to go via /proc/self/fd/ in these cases.

Also, let's merge all the various flavours we have here into singular
implementations that can do everything we need:

1. malloc() loop handling
2. by fd, by path, or combination (i.e. a proper openat() like API)
3. work on O_PATH
src/basic/cgroup-util.c
src/basic/os-util.c
src/basic/xattr-util.c
src/basic/xattr-util.h
src/libsystemd/sd-journal/journal-vacuum.c
src/shared/cgroup-show.c
src/shared/discover-image.c
src/shared/dissect-image.c
src/shared/smack-util.c
src/test/test-copy.c
src/test/test-xattr-util.c