From 7bf7b889b3bd2c4c226b8ee39b1e9abfca3d5f13 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 9 Mar 2012 10:25:16 +1100 Subject: - (djm) [openbsd-compat/port-linux.c] bz#1960: fix crash on SELinux systems where sshd is run in te wrong context. Patch from Sven Vermeulen; ok dtucker@ --- openbsd-compat/port-linux.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'openbsd-compat/port-linux.c') diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index ea8dff40f..aba75387c 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c @@ -1,4 +1,4 @@ -/* $Id: port-linux.c,v 1.16 2011/08/29 06:09:57 djm Exp $ */ +/* $Id: port-linux.c,v 1.17 2012/03/08 23:25:18 djm Exp $ */ /* * Copyright (c) 2005 Daniel Walsh @@ -60,7 +60,7 @@ ssh_selinux_enabled(void) static security_context_t ssh_selinux_getctxbyname(char *pwname) { - security_context_t sc; + security_context_t sc = NULL; char *sename = NULL, *lvl = NULL; int r; @@ -86,6 +86,7 @@ ssh_selinux_getctxbyname(char *pwname) case 0: error("%s: Failed to get default SELinux security " "context for %s", __func__, pwname); + sc = NULL; break; default: fatal("%s: Failed to get default SELinux security " @@ -101,7 +102,7 @@ ssh_selinux_getctxbyname(char *pwname) xfree(lvl); #endif - return (sc); + return sc; } /* Set the execution context to the default for the specified user */ -- cgit v1.2.3