fs-util: always call label post ops in xopenat_full(), in both success and error...
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Oct 2024 20:43:18 +0000 (22:43 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 22 Oct 2024 15:51:26 +0000 (17:51 +0200)
commit64053bed083d24f2151d05951935d0804173e657
tree29b01d0b1a60537abad5c047e5be5658c49b7bc8
parentda3d81cccd1f915e91a756b3d783e8bc3ecd0a5c
fs-util: always call label post ops in xopenat_full(), in both success and error path

For SELinux it is essential that we reset the file creation label both
in the success and in the error path, hence do so.

Moreover, when calling the label post ops do it if possible with the
opened fd of the inode itself, rather than always going via its path,
simply to reduce the attack surface.
src/basic/fs-util.c