]> git.ipfire.org Git - thirdparty/shadow.git/commit
set_selinux_file_context(): prepare context for actual file type
authorChristian Göttsche <cgzones@googlemail.com>
Fri, 9 Apr 2021 16:21:00 +0000 (18:21 +0200)
committerChristian Göttsche <cgzones@googlemail.com>
Thu, 6 May 2021 14:58:10 +0000 (16:58 +0200)
commiteb1d2de0e9bd9e1262080312f0bca9c7e6a36d94
tree80dbf7097f0e7a016b8ed4ef19135589b8af40e0
parent5f7649fb37bfe66544bc3141c047f5d09c8eaef5
set_selinux_file_context(): prepare context for actual file type

Search the SELinux selabel database for the file type to be created.
Not specifying the file mode can cause an incorrect file context to be
returned.

Also prepare contexts in commonio_close() for the generic database
filename, not with the backup suffix appended, to ensure the desired
file context after the final rename.

Closes: #322
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: James Carter <jwcart2@gmail.com>
lib/commonio.c
lib/prototypes.h
lib/selinux.c
libmisc/copydir.c
src/useradd.c