diff options
Diffstat (limited to 'openbsd-compat/port-linux.c')
-rw-r--r-- | openbsd-compat/port-linux.c | 18 |
1 files changed, 17 insertions, 1 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 | |||
209 | void | ||
210 | ssh_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 |