summaryrefslogtreecommitdiff
path: root/openbsd-compat/port-linux.c
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat/port-linux.c')
-rw-r--r--openbsd-compat/port-linux.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
index a2498dc15..dc8b1fa55 100644
--- a/openbsd-compat/port-linux.c
+++ b/openbsd-compat/port-linux.c
@@ -1,4 +1,4 @@
1/* $Id: port-linux.c,v 1.11 2011/01/17 07:50:24 dtucker Exp $ */ 1/* $Id: port-linux.c,v 1.11.4.2 2011/02/04 00:43:08 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com> 4 * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com>
@@ -222,17 +222,16 @@ ssh_selinux_change_context(const char *newname)
222void 222void
223ssh_selinux_setfscreatecon(const char *path) 223ssh_selinux_setfscreatecon(const char *path)
224{ 224{
225 security_context_t context; 225 security_context_t context;
226 226
227 if (!ssh_selinux_enabled()) 227 if (!ssh_selinux_enabled())
228 return; 228 return;
229 229 if (path == NULL) {
230 if (path == NULL) { 230 setfscreatecon(NULL);
231 setfscreatecon(NULL); 231 return;
232 return; 232 }
233 } 233 if (matchpathcon(path, 0700, &context) == 0)
234 if (matchpathcon(path, 0700, &context) == 0) 234 setfscreatecon(context);
235 setfscreatecon(context);
236} 235}
237 236
238#endif /* WITH_SELINUX */ 237#endif /* WITH_SELINUX */