From: Petr Lautrbach <plautrba@redhat.com>
To: selinux@vger.kernel.org
Cc: Vit Mojzis <vmojzis@redhat.com>
Subject: Re: [PATCH] libsemanage/genhomedircon: check usepasswd in add_user
Date: Thu, 29 Oct 2020 11:48:02 +0100 [thread overview]
Message-ID: <20201029104802.GA52464@localhost.localdomain> (raw)
In-Reply-To: <20201027174539.769006-1-vmojzis@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 1101 bytes --]
On Tue, Oct 27, 2020 at 06:45:39PM +0100, Vit Mojzis wrote:
> Only add user homedir context entry 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 | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/libsemanage/src/genhomedircon.c b/libsemanage/src/genhomedircon.c
> index d08c88de..19dfb7b0 100644
> --- a/libsemanage/src/genhomedircon.c
> +++ b/libsemanage/src/genhomedircon.c
> @@ -966,6 +966,9 @@ static int add_user(genhomedircon_settings_t * s,
> }
> }
>
> + if (!(s->usepasswd))
> + return STATUS_SUCCESS;
> +
> int retval = STATUS_ERR;
>
> char *rbuf = NULL;
> --
> 2.25.4
>
add_user() seems to be too deep. Would it make sense to (s->usepasswd) in
write_context_file() as part of a condition on line 1338:
if (user_context_tpl || username_context_tpl) {
?
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-10-29 10:48 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 [this message]
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
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=20201029104802.GA52464@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.