From 5e750371bb19c8cc58b5faea70278d857acdae0a Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Tue, 25 Jan 2011 01:51:25 +0000 Subject: Backport SELinux build fix from CVS. --- openbsd-compat/port-linux.c | 14 ++++++++++++++ openbsd-compat/port-linux.h | 1 + 2 files changed, 15 insertions(+) (limited to 'openbsd-compat') 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) xfree(oldctx); xfree(newctx); } + +void +ssh_selinux_setfscreatecon(const char *path) +{ + security_context_t context; + + if (path == NULL) { + setfscreatecon(NULL); + return; + } + matchpathcon(path, 0700, &context); + setfscreatecon(context); +} + #endif /* WITH_SELINUX */ #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); void ssh_selinux_setup_pty(char *, const char *); void ssh_selinux_setup_exec_context(char *); void ssh_selinux_change_context(const char *); +void ssh_selinux_setfscreatecon(const char *); #endif #ifdef LINUX_OOM_ADJUST -- cgit v1.2.3