diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c index 6991fffc..5e9d7224 100644 --- a/libsemanage/src/genhomedircon.c +++ b/libsemanage/src/genhomedircon.c @@ -638,7 +638,11 @@ static int write_contexts(genhomedircon_settings_t *s, FILE *out, goto fail; } - if (sepol_context_set_user(sepolh, context, user->sename) < 0 || + if (sepol_context_set_user(sepolh, context, user->sename) < 0) { + goto fail; + } + + if (sepol_policydb_mls_enabled(s->policydb) && sepol_context_set_mls(sepolh, context, user->level) < 0) { goto fail; }