summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/port-linux.c18
-rw-r--r--openbsd-compat/port-linux.h3
2 files changed, 19 insertions, 2 deletions
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
index 5b1cf402c..ede533fdd 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>
@@ -205,6 +205,22 @@ ssh_selinux_change_context(const char *newname)
205 xfree(oldctx); 205 xfree(oldctx);
206 xfree(newctx); 206 xfree(newctx);
207} 207}
208
209void
210ssh_selinux_setfscreatecon(const char *path)
211{
212 security_context_t context;
213
214 if (!ssh_selinux_enabled())
215 return;
216 if (path == NULL)
217 setfscreatecon(NULL);
218 return;
219 }
220 if (matchpathcon(path, 0700, &context) == 0)
221 setfscreatecon(context);
222}
223
208#endif /* WITH_SELINUX */ 224#endif /* WITH_SELINUX */
209 225
210#ifdef LINUX_OOM_ADJUST 226#ifdef LINUX_OOM_ADJUST
diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h
index 209d9a7a2..c2f618400 100644
--- a/openbsd-compat/port-linux.h
+++ b/openbsd-compat/port-linux.h
@@ -1,4 +1,4 @@
1/* $Id: port-linux.h,v 1.4 2009/12/08 02:39:48 dtucker Exp $ */ 1/* $Id: port-linux.h,v 1.4.10.1 2011/02/04 00:42:21 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2006 Damien Miller <djm@openbsd.org> 4 * Copyright (c) 2006 Damien Miller <djm@openbsd.org>
@@ -24,6 +24,7 @@ int ssh_selinux_enabled(void);
24void ssh_selinux_setup_pty(char *, const char *); 24void ssh_selinux_setup_pty(char *, const char *);
25void ssh_selinux_setup_exec_context(char *); 25void ssh_selinux_setup_exec_context(char *);
26void ssh_selinux_change_context(const char *); 26void ssh_selinux_change_context(const char *);
27void ssh_selinux_setfscreatecon(const char *);
27#endif 28#endif
28 29
29#ifdef LINUX_OOM_ADJUST 30#ifdef LINUX_OOM_ADJUST