summaryrefslogtreecommitdiff
path: root/modules/pam_namespace/pam_namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'modules/pam_namespace/pam_namespace.c')
-rw-r--r--modules/pam_namespace/pam_namespace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/pam_namespace/pam_namespace.c b/modules/pam_namespace/pam_namespace.c
index 73d8e591..d3612f59 100644
--- a/modules/pam_namespace/pam_namespace.c
+++ b/modules/pam_namespace/pam_namespace.c
@@ -589,8 +589,9 @@ static int poly_name(const struct polydir_s *polyptr, char **i_name,
#ifdef WITH_SELINUX
*i_context = NULL;
*origcon = NULL;
- if ((rc=form_context(polyptr, i_context, origcon, idata)) != PAM_SUCCESS) {
- return rc;
+ if ((idata->flags & PAMNS_SELINUX_ENABLED) &&
+ (rc=form_context(polyptr, i_context, origcon, idata)) != PAM_SUCCESS) {
+ return rc;
}
#endif