From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Vit Mojzis <vmojzis@redhat.com>
Subject: Re: [PATCH v2] libsemanage/genhomedircon: check usepasswd
Date: Tue, 10 Nov 2020 07:25:35 +0100 [thread overview]
Message-ID: <20201110062535.GA166769@localhost.localdomain> (raw)
In-Reply-To: <20201030164217.1374255-1-vmojzis@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]
On Fri, Oct 30, 2020 at 05:42:17PM +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>
Acked-by: Petr Lautrbach <plautrba@redhat.com>
Merged with slightly changed commit message, thanks!
> ---
> v2 - invert condition as suggested by plautrba
>
> 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..18d3d99a 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)) {
> 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 --]
prev parent reply other threads:[~2020-11-10 6:25 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
2020-10-30 16:42 ` [PATCH v2] " Vit Mojzis
2020-11-10 6:25 ` Petr Lautrbach [this message]
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=20201110062535.GA166769@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