summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/port-linux.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
index 11385326e..a2498dc15 100644
--- a/openbsd-compat/port-linux.c
+++ b/openbsd-compat/port-linux.c
@@ -224,12 +224,15 @@ ssh_selinux_setfscreatecon(const char *path)
224{ 224{
225 security_context_t context; 225 security_context_t context;
226 226
227 if (!ssh_selinux_enabled())
228 return;
229
227 if (path == NULL) { 230 if (path == NULL) {
228 setfscreatecon(NULL); 231 setfscreatecon(NULL);
229 return; 232 return;
230 } 233 }
231 matchpathcon(path, 0700, &context); 234 if (matchpathcon(path, 0700, &context) == 0)
232 setfscreatecon(context); 235 setfscreatecon(context);
233} 236}
234 237
235#endif /* WITH_SELINUX */ 238#endif /* WITH_SELINUX */