mirror of
https://github.com/SELinuxProject/selinux
synced 2025-02-06 04:42:58 +00:00
libsemanage/genhomedircon: check usepasswd
Only add user homedir contexts when usepasswd = True Resolves: # grep usepasswd /etc/selinux/semanage.conf usepasswd=False # useradd -Z unconfined_u -d /tmp test # matchpathcon /tmp /tmp unconfined_u:object_r:user_home_dir_t:s0 Signed-off-by: Vit Mojzis <vmojzis@redhat.com>
This commit is contained in:
parent
c2a58cc525
commit
ce46daab7c
@ -1332,7 +1332,7 @@ static int write_context_file(genhomedircon_settings_t * s, FILE * out)
|
||||
s->fallback->home = NULL;
|
||||
}
|
||||
}
|
||||
if (user_context_tpl || username_context_tpl) {
|
||||
if ((s->usepasswd) && (user_context_tpl || username_context_tpl)) {
|
||||
if (write_username_context(s, out, username_context_tpl,
|
||||
s->fallback) != STATUS_SUCCESS) {
|
||||
retval = STATUS_ERR;
|
||||
|
Loading…
Reference in New Issue
Block a user