This reverts commit ce46daab7cc90a6b9cd3bff9f99cf40ff19c3d9a. The behavior described in the reverted commit is correct. `useradd -Z` creates new mapping between new created user and *unconfined_u*, `genhomedircon` then uses this new mapping, not /etc/passwd entries, for generating new homedir contexts. Signed-off-by: Petr Lautrbach <plautrba@xxxxxxxxxx> --- libsemanage/src/genhomedircon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c index 18d3d99a1254..d08c88de99a7 100644 --- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -1332,7 +1332,7 @@ static int write_context_file(genhomedircon_settings_t * s, FILE * out) s->fallback->home = NULL; } } - if ((s->usepasswd) && (user_context_tpl || username_context_tpl)) { + if (user_context_tpl || username_context_tpl) { if (write_username_context(s, out, username_context_tpl, s->fallback) != STATUS_SUCCESS) { retval = STATUS_ERR; -- 2.29.2