Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Nov 2014 00:26:18 +0000 (UTC)
From:      Bartek Rutkowski <robak@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r372583 - in head/net/xrdp: . files
Message-ID:  <201411150026.sAF0QIJi050700@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: robak
Date: Sat Nov 15 00:26:18 2014
New Revision: 372583
URL: https://svnweb.freebsd.org/changeset/ports/372583
QAT: https://qat.redports.org/buildarchive/r372583/

Log:
  net/xrdp: fix PAM authentication issue
  
  - Fix PAM authentication failure after recent base update
  - Replace local patch with new patch from upstream
  - Rename patch files, remove dirrms, use @sample, some plist fixes
  
  PR:		194474
  Submitted by:	Koichiro Iwao <meta+ports@vmeta.jp>
  Approved by:	mentors (implicit)

Added:
  head/net/xrdp/files/patch-sesman__session.c
     - copied unchanged from r372582, head/net/xrdp/files/patch-sesman__session_1.patch
  head/net/xrdp/files/patch-sesman__verify_user_pam.c   (contents, props changed)
Deleted:
  head/net/xrdp/files/patch-sesman__session_1.patch
Modified:
  head/net/xrdp/Makefile
  head/net/xrdp/files/patch-common__os_calls.c
  head/net/xrdp/pkg-plist

Modified: head/net/xrdp/Makefile
==============================================================================
--- head/net/xrdp/Makefile	Sat Nov 15 00:15:24 2014	(r372582)
+++ head/net/xrdp/Makefile	Sat Nov 15 00:26:18 2014	(r372583)
@@ -3,7 +3,7 @@
 
 PORTNAME=	xrdp
 PORTVERSION=	0.6.1
-PORTREVISION=	4
+PORTREVISION=	5
 PORTEPOCH=	1
 CATEGORIES=	net
 MASTER_SITES=	GH

Modified: head/net/xrdp/files/patch-common__os_calls.c
==============================================================================
--- head/net/xrdp/files/patch-common__os_calls.c	Sat Nov 15 00:15:24 2014	(r372582)
+++ head/net/xrdp/files/patch-common__os_calls.c	Sat Nov 15 00:26:18 2014	(r372583)
@@ -1,11 +1,17 @@
---- common/os_calls.c.orig	2011-03-12 16:10:35.000000000 +0900
-+++ common/os_calls.c	2011-03-12 16:34:05.000000000 +0900
-@@ -1987,6 +1987,8 @@
- g_clearenv(void)
+diff --git common/os_calls.c common/os_calls.c
+index 692dc01..7075ee3 100644
+--- common/os_calls.c
++++ common/os_calls.c
+@@ -2115,8 +2115,12 @@ g_clearenv(void)
  {
  #if defined(_WIN32)
-+#elif defined(__FreeBSD__)
-+  environ[0] = NULL;
  #else
++#if defined(BSD)
++  environ[0] = 0;
++#else
    environ = 0;
  #endif
++#endif
+ }
+ 
+ /*****************************************************************************/

Copied: head/net/xrdp/files/patch-sesman__session.c (from r372582, head/net/xrdp/files/patch-sesman__session_1.patch)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/xrdp/files/patch-sesman__session.c	Sat Nov 15 00:26:18 2014	(r372583, copy of r372582, head/net/xrdp/files/patch-sesman__session_1.patch)
@@ -0,0 +1,85 @@
+--- sesman/session.c.orig	2011-03-12 16:10:35.000000000 +0900
++++ sesman/session.c	2011-10-27 12:13:11.000000000 +0900
+@@ -16,7 +16,47 @@
+    xrdp: A Remote Desktop Protocol server.
+    Copyright (C) Jay Sorg 2005-2008
+ */
+-
++/*
++ * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
++ *                    All rights reserved
++ *
++ * As far as I am concerned, the code I have written for this software
++ * can be used freely for any purpose.  Any derived versions of this
++ * software must be clearly marked as such, and if the derived work is
++ * incompatible with the protocol description in the RFC file, it must be
++ * called by a name other than "ssh" or "Secure Shell".
++ *
++ * SSH2 support by Markus Friedl.
++ * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++ * 
++ * Copyright (c) 2011 Iwao, Koichiro <meta@club.kyutech.ac.jp>, 
++ *                    Kyushu Institute of Technology.
++ *                    All rights reserved.
++ *
++ * 	from: OpenBSD: session.c,v 1.252 2010/03/07 11:57:13 dtucker Exp
++ *            with some ideas about process grouping from OpenSSH to xrdp
++ * 	       
++ */
+ /**
+  *
+  * @file session.c
+@@ -373,6 +413,33 @@
+     g_sprintf(geometry, "%dx%d", width, height);
+     g_sprintf(depth, "%d", bpp);
+     g_sprintf(screen, ":%d", display);
++#ifdef __FreeBSD__
++    /*
++     * Create a new session and process group since 4.4BSD 
++     * setlogin affects the entire process group.
++     */
++    pid_t bsdsespid = g_fork();
++
++    if (bsdsespid == -1)
++    {
++    }
++    else if (bsdsespid == 0) /* BSD session leader */
++    {
++        if (setsid() < 0)
++        {
++          log_message(&(g_cfg->log), LOG_LEVEL_ERROR,
++            "setsid failed: %.100s", strerror(errno));
++        }
++
++        if (setlogin(username) < 0)
++        {
++          log_message(&(g_cfg->log), LOG_LEVEL_ERROR,
++            "setlogin failed: %.100s", strerror(errno));
++        }
++    }
++
++    g_waitpid(bsdsespid);
++#endif
+     wmpid = g_fork();
+     if (wmpid == -1)
+     {

Added: head/net/xrdp/files/patch-sesman__verify_user_pam.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/xrdp/files/patch-sesman__verify_user_pam.c	Sat Nov 15 00:26:18 2014	(r372583)
@@ -0,0 +1,19 @@
+diff --git sesman/verify_user_pam.c sesman/verify_user_pam.c
+index e3d8596..281e297 100644
+--- sesman/verify_user_pam.c
++++ sesman/verify_user_pam.c
+@@ -117,6 +117,14 @@ auth_userpass(char* user, char* pass)
+     g_free(auth_info);
+     return 0;
+   }
++
++  error = pam_set_item(auth_info->ph, PAM_TTY, service_name);
++  if (error != PAM_SUCCESS)
++  {
++    g_printf("pam_set_item failed: %s\r\n",
++                         pam_strerror(auth_info->ph, error));
++  }
++
+   error = pam_authenticate(auth_info->ph, 0);
+   if (error != PAM_SUCCESS)
+   {

Modified: head/net/xrdp/pkg-plist
==============================================================================
--- head/net/xrdp/pkg-plist	Sat Nov 15 00:15:24 2014	(r372582)
+++ head/net/xrdp/pkg-plist	Sat Nov 15 00:26:18 2014	(r372583)
@@ -39,24 +39,24 @@ man/man8/xrdp-sesman.8.gz
 man/man8/xrdp-sesrun.8.gz
 man/man8/xrdp.8.gz
 etc/pam.d/xrdp-sesman
-etc/xrdp/km-0407.ini
-etc/xrdp/km-0409.ini
-etc/xrdp/km-040c.ini
-etc/xrdp/km-0410.ini
-etc/xrdp/km-0419.ini
-etc/xrdp/km-041d.ini
-%%JP106%%etc/xrdp/km-0411.ini
-%%JP106%%etc/xrdp/km-e0010411.ini
-%%JP106%%etc/xrdp/km-e0200411.ini
-%%JP106%%etc/xrdp/km-e0210411.ini
+%%ETCDIR%%/km-0407.ini
+%%ETCDIR%%/km-0409.ini
+%%ETCDIR%%/km-040c.ini
+%%ETCDIR%%/km-0410.ini
+%%ETCDIR%%/km-0419.ini
+%%ETCDIR%%/km-041d.ini
+%%JP106%%%%ETCDIR%%/km-0411.ini
+%%JP106%%%%ETCDIR%%/km-e0010411.ini
+%%JP106%%%%ETCDIR%%/km-e0200411.ini
+%%JP106%%%%ETCDIR%%/km-e0210411.ini
 @unexec if cmp -s %D/etc/xrdp/rsakeys.ini.sample %D/etc/xrdp/rsakeys.ini; then rm -f %D/etc/xrdp/rsakeys.ini; fi
 @unexec if cmp -s %D/etc/xrdp/sesman.ini.sample %D/etc/xrdp/sesman.ini; then rm -f %D/etc/xrdp/sesman.ini; fi
 @unexec if cmp -s %D/etc/xrdp/startwm.sh.sample %D/etc/xrdp/startwm.sh; then rm -f %D/etc/xrdp/startwm.sh; fi
 @unexec if cmp -s %D/etc/xrdp/xrdp.ini.sample %D/etc/xrdp/xrdp.ini; then rm -f %D/etc/xrdp/xrdp.ini; fi
-etc/xrdp/rsakeys.ini.sample
-etc/xrdp/sesman.ini.sample
-etc/xrdp/startwm.sh.sample
-etc/xrdp/xrdp.ini.sample
+@sample %%ETCDIR%%/rsakeys.ini.sample
+@sample %%ETCDIR%%/sesman.ini.sample
+@sample %%ETCDIR%%/startwm.sh.sample
+@sample %%ETCDIR%%/xrdp.ini.sample
 @exec [ -f %D/etc/xrdp/sesman.ini ] || cp -p %D/etc/xrdp/sesman.ini.sample %D/etc/xrdp/sesman.ini
 @exec [ -f %D/etc/xrdp/startwm.sh ] || cp -p %D/etc/xrdp/startwm.sh.sample %D/etc/xrdp/startwm.sh
 @exec [ -f %D/etc/xrdp/xrdp.ini ] || cp -p %D/etc/xrdp/xrdp.ini.sample %D/etc/xrdp/xrdp.ini
@@ -64,13 +64,10 @@ sbin/xrdp
 sbin/xrdp-chansrv
 sbin/xrdp-sesman
 sbin/xrdp-sessvc
-share/xrdp/ad24b.bmp
-share/xrdp/ad256.bmp
-share/xrdp/cursor0.cur
-share/xrdp/cursor1.cur
-share/xrdp/sans-10.fv1
-share/xrdp/xrdp24b.bmp
-share/xrdp/xrdp256.bmp
-@dirrm share/xrdp
-@dirrm lib/xrdp
-@dirrmtry etc/xrdp
+%%DATADIR%%/ad24b.bmp
+%%DATADIR%%/ad256.bmp
+%%DATADIR%%/cursor0.cur
+%%DATADIR%%/cursor1.cur
+%%DATADIR%%/sans-10.fv1
+%%DATADIR%%/xrdp24b.bmp
+%%DATADIR%%/xrdp256.bmp



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411150026.sAF0QIJi050700>