From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Vit Mojzis <vmojzis@redhat.com>
Subject: Re: [PATCH] libsemanage/genhomedircon: check usepasswd
Date: Fri, 30 Oct 2020 13:33:51 +0100 [thread overview]
Message-ID: <20201030123351.GA78496@localhost.localdomain> (raw)
In-Reply-To: <20201029172845.1321021-1-vmojzis@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1217 bytes --]
On Thu, Oct 29, 2020 at 06:28:45PM +0100, Vit Mojzis wrote:
> Only add user homedir contexts when usepasswd = True
>
> Resolves:
> #cat /etc/selinux/semanage.conf | grep usepasswd
> 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>
> ---
> 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 d08c88de..fc75fa8c 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 (user_context_tpl || username_context_tpl) {
> + if (!(s->usepasswd) && (user_context_tpl || username_context_tpl)) {
I guess this condition is reversed - we want to write user contexts when usepasswd is True
> if (write_username_context(s, out, username_context_tpl,
> s->fallback) != STATUS_SUCCESS) {
> retval = STATUS_ERR;
> --
> 2.26.2
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-10-30 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-27 16:53 [PATCH] libsemanage/genhomedircon: check usepasswd in add_user Vit Mojzis
2020-10-27 17:34 ` Petr Lautrbach
2020-10-27 17:45 ` Vit Mojzis
2020-10-29 10:48 ` Petr Lautrbach
2020-10-29 17:27 ` [PATCH] libsemanage/genhomedircon: check usepasswd Vit Mojzis
2020-10-29 17:28 ` Vit Mojzis
2020-10-30 12:33 ` Petr Lautrbach [this message]
2020-10-30 16:42 ` [PATCH v2] " Vit Mojzis
2020-11-10 6:25 ` Petr Lautrbach
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201030123351.GA78496@localhost.localdomain \
--to=plautrba@redhat.com \
--cc=selinux@vger.kernel.org \
--cc=vmojzis@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox