Description: Fix crash in ssh_selinux_setfscreatecon when SELinux is disabled Author: Colin Watson Bug-Ubuntu: https://bugs.launchpad.net/bugs/708571 Forwarded: https://bugzilla.mindrot.org/show_bug.cgi?id=1851 Last-Update: 2011-01-27 Index: b/openbsd-compat/port-linux.c =================================================================== --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c @@ -224,12 +224,15 @@ { security_context_t context; + if (!ssh_selinux_enabled()) + return; + if (path == NULL) { setfscreatecon(NULL); return; } - matchpathcon(path, 0700, &context); - setfscreatecon(context); + if (matchpathcon(path, 0700, &context) == 0) + setfscreatecon(context); } #endif /* WITH_SELINUX */