All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsemanage/genhomedircon: check usepasswd in add_user
@ 2020-10-27 16:53 Vit Mojzis
  2020-10-27 17:34 ` Petr Lautrbach
  0 siblings, 1 reply; 9+ messages in thread
From: Vit Mojzis @ 2020-10-27 16:53 UTC (permalink / raw)
  To: selinux

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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-11-10  6:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.