]> git.ipfire.org Git - thirdparty/util-linux.git/commit
mkswap: set selinux label also when creating file
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 17 Nov 2024 18:04:49 +0000 (19:04 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 17 Nov 2024 18:06:05 +0000 (19:06 +0100)
commit1dd27d1fa733f97b3a94822ccfd406e1a572867d
treebb687f240904e0f7225933ca96d38d0335d6c584
parent2bf297b55f78b77b0e585502546afa79264e693d
mkswap: set selinux label also when creating file

With --file, shen the file is created by mkswap, stat() fails with -ENOENT
and the st_mode field is not populated, so the IS_REG() check fails. But if
we created by mkswap, we know it's just a regular file and we should apply
the selinux label.

Reported in https://bugzilla.redhat.com/show_bug.cgi?id=2324811#c56.
disk-utils/mkswap.c