kentpeacock / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone
b58e57
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c
b58e57
index 22ea8ef..2660085 100644
b58e57
--- a/openbsd-compat/port-linux.c
b58e57
+++ b/openbsd-compat/port-linux.c
b58e57
@@ -116,7 +116,11 @@ ssh_selinux_setup_pty(char *pwname, const char *tty)
b58e57
 
b58e57
 	debug3("%s: setting TTY context on %s", __func__, tty);
b58e57
 
b58e57
-	user_ctx = ssh_selinux_getctxbyname(pwname);
b58e57
+	if (getexeccon(&user_ctx) != 0) {
b58e57
+		error("%s: getexeccon: %s", __func__, strerror(errno));
b58e57
+		goto out;
b58e57
+	}
b58e57
+
b58e57
 
b58e57
 	/* XXX: should these calls fatal() upon failure in enforcing mode? */
b58e57