From owner-svn-ports-head@freebsd.org Fri Mar 9 17:49:21 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA48CF3D5FE; Fri, 9 Mar 2018 17:49:20 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55F0F835FA; Fri, 9 Mar 2018 17:49:20 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3273E2243B; Fri, 9 Mar 2018 17:49:20 +0000 (UTC) (envelope-from arved@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w29HnK6a012550; Fri, 9 Mar 2018 17:49:20 GMT (envelope-from arved@FreeBSD.org) Received: (from arved@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w29HnJH3012548; Fri, 9 Mar 2018 17:49:19 GMT (envelope-from arved@FreeBSD.org) Message-Id: <201803091749.w29HnJH3012548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arved set sender to arved@FreeBSD.org using -f From: Tilman Keskinoz Date: Fri, 9 Mar 2018 17:49:19 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r463982 - in head/net/xrdp-devel: . files X-SVN-Group: ports-head X-SVN-Commit-Author: arved X-SVN-Commit-Paths: in head/net/xrdp-devel: . files X-SVN-Commit-Revision: 463982 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Mar 2018 17:49:21 -0000 Author: arved Date: Fri Mar 9 17:49:19 2018 New Revision: 463982 URL: https://svnweb.freebsd.org/changeset/ports/463982 Log: Backport patch from upstream issue #1030 PR: 225859 Submitted by: maintainer Added: head/net/xrdp-devel/files/patch-upstream-issue-1030 (contents, props changed) Modified: head/net/xrdp-devel/Makefile Modified: head/net/xrdp-devel/Makefile ============================================================================== --- head/net/xrdp-devel/Makefile Fri Mar 9 17:39:11 2018 (r463981) +++ head/net/xrdp-devel/Makefile Fri Mar 9 17:49:19 2018 (r463982) @@ -4,6 +4,7 @@ PORTNAME= xrdp PORTVERSION= 0.9.5 DISTVERSIONPREFIX= v +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= net PKGNAMESUFFIX= -devel Added: head/net/xrdp-devel/files/patch-upstream-issue-1030 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/xrdp-devel/files/patch-upstream-issue-1030 Fri Mar 9 17:49:19 2018 (r463982) @@ -0,0 +1,54 @@ +--- sesman/session.c.orig 2017-12-27 14:40:24 UTC ++++ sesman/session.c +@@ -484,22 +484,40 @@ session_start_fork(tbus data, tui8 type, + * $OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp $ + * with some ideas about BSD process grouping to xrdp + */ ++ pid_t bsdsespid = g_fork(); + +- /** +- * Create a new session and process group since the 4.4BSD +- * setlogin() affects the entire process group +- */ +- if (g_setsid() < 0) ++ if (bsdsespid == -1) + { +- log_message(LOG_LEVEL_ERROR, +- "setsid failed - pid %d", g_getpid()); ++ } ++ else if (bsdsespid == 0) /* BSD session leader */ ++ { ++ /** ++ * Create a new session and process group since the 4.4BSD ++ * setlogin() affects the entire process group ++ */ ++ if (g_setsid() < 0) ++ { ++ log_message(LOG_LEVEL_ERROR, ++ "setsid failed - pid %d", g_getpid()); ++ } ++ ++ if (g_setlogin(s->username) < 0) ++ { ++ log_message(LOG_LEVEL_ERROR, ++ "setlogin failed for user %s - pid %d", s->username, ++ g_getpid()); ++ } + } + +- if (g_setlogin(s->username) < 0) ++ g_waitpid(bsdsespid); ++ ++ if (bsdsespid > 0) + { +- log_message(LOG_LEVEL_ERROR, +- "setlogin failed for user %s - pid %d", s->username, +- g_getpid()); ++ g_exit(0); ++ /* ++ * intermediate sesman should exit here after WM exits. ++ * do not execure the following codes. ++ */ + } + #endif + window_manager_pid = g_fork(); /* parent becomes X,