summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2011-01-25 01:51:25 +0000
committerColin Watson <cjwatson@debian.org>2011-01-25 01:51:25 +0000
commit5e750371bb19c8cc58b5faea70278d857acdae0a (patch)
treefa223746d886bda4acb9e242675bbcc4ddba4efb /openbsd-compat
parent26883397c648afa38ed502e68652945a794b0cd3 (diff)
Backport SELinux build fix from CVS.
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/port-linux.c14
-rw-r--r--openbsd-compat/port-linux.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
index 86a7146a6..744a404c8 100644
--- a/openbsd-compat/port-linux.c
+++ b/openbsd-compat/port-linux.c
@@ -222,6 +222,20 @@ ssh_selinux_change_context(const char *newname)
222 xfree(oldctx); 222 xfree(oldctx);
223 xfree(newctx); 223 xfree(newctx);
224} 224}
225
226void
227ssh_selinux_setfscreatecon(const char *path)
228{
229 security_context_t context;
230
231 if (path == NULL) {
232 setfscreatecon(NULL);
233 return;
234 }
235 matchpathcon(path, 0700, &context);
236 setfscreatecon(context);
237}
238
225#endif /* WITH_SELINUX */ 239#endif /* WITH_SELINUX */
226 240
227#ifdef LINUX_OOM_ADJUST 241#ifdef LINUX_OOM_ADJUST
diff --git a/openbsd-compat/port-linux.h b/openbsd-compat/port-linux.h
index 209d9a7a2..884482bf5 100644
--- a/openbsd-compat/port-linux.h
+++ b/openbsd-compat/port-linux.h
@@ -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