]> git.ipfire.org Git - thirdparty/systemd.git/commit
label: tweak LabelOps post() hook to take "created" boolean
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Oct 2024 20:07:56 +0000 (22:07 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Oct 2024 15:51:26 +0000 (17:51 +0200)
commitd49449c89b3bec486b16ddaec582a4de28bc3dea
tree4ee20a38200fa8a1ca9d929fe77e541912b9e58e
parent652371a3c100a74999e21d9424538d3ab4cb9b97
label: tweak LabelOps post() hook to take "created" boolean

We have two distinct implementations of the post hook.

1. For SELinux we just reset the selinux label we told the kernel
   earlier to use for new inodes.

2. For SMACK we might apply an xattr to the specified file.

The two calls are quite different: the first call we want to call in all
cases (failure or success), the latter only if we actually managed to
create an inode, in which case it is called on the inode.
src/basic/fs-util.c
src/basic/label.c
src/basic/label.h
src/shared/selinux-util.c
src/shared/smack-util.c
src/test/test-label.c