SELinux Security Module development
 help / color / mirror / Atom feed
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: Tue, 27 Oct 2020 18:34:57 +0100	[thread overview]
Message-ID: <20201027173457.GC25212@localhost.localdomain> (raw)
In-Reply-To: <20201027165343.764095-1-vmojzis@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1231 bytes --]

On Tue, Oct 27, 2020 at 05:53:43PM +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

It should be enough to indent lines with few spaces, e.g.

Resolves:
    # grep usepasswd /etc/selinux/semanage.conf
    usepasswd=False
    # useradd -Z unconfined_u -d /tmp test
    # matchpathcon /tmp
    /tmp	unconfined_u:object_r:user_home_dir_t:s0


Also please provide Signed-off-by: see
https://github.com/SELinuxProject/selinux/blob/master/CONTRIBUTING.md


> ---
>  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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-10-27 17:36 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 [this message]
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

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=20201027173457.GC25212@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