[pkg-remote-commits] [xrdp] 03/12: Refresh patches.

Dominik George natureshadow-guest at moszumanska.debian.org
Mon Oct 9 17:04:37 UTC 2017


This is an automated email from the git hooks/post-receive script.

natureshadow-guest pushed a commit to branch master
in repository xrdp.

commit dc3d818e5feb67edeb2d0f268112617427d2900b
Author: Dominik George <nik at naturalnet.de>
Date:   Mon Oct 9 17:08:26 2017 +0200

    Refresh patches.
---
 debian/patches/config.diff        |  23 +---
 debian/patches/cve-2017-6967.diff | 136 --------------------
 debian/patches/fix_perms.diff     |  22 ++--
 debian/patches/highres.diff       |  51 --------
 debian/patches/kb_jp.diff         |  16 ---
 debian/patches/kfreebsd.diff      |  63 ---------
 debian/patches/lfs.diff           |  12 +-
 debian/patches/make-fixes.diff    |   6 +-
 debian/patches/misc-fixes.diff    |   8 +-
 debian/patches/series             |   5 -
 debian/patches/shutup-daemon.diff |  14 +-
 debian/patches/sockpath.diff      | 264 --------------------------------------
 debian/patches/systemd.diff       |  52 +++-----
 13 files changed, 53 insertions(+), 619 deletions(-)

diff --git a/debian/patches/config.diff b/debian/patches/config.diff
index bd5995c..8bff5d1 100644
--- a/debian/patches/config.diff
+++ b/debian/patches/config.diff
@@ -2,7 +2,7 @@ From: Dominik George <nik at naturalnet.de>
 Subject: Use xorgxrdp instead of x11rdp
 --- a/sesman/sesman.ini
 +++ b/sesman/sesman.ini
-@@ -61,12 +61,13 @@ LogLevel=DEBUG
+@@ -54,12 +54,13 @@ LogLevel=DEBUG
  EnableSyslog=1
  SyslogLevel=DEBUG
  
@@ -20,7 +20,7 @@ Subject: Use xorgxrdp instead of x11rdp
  
  [Xvnc]
  param=Xvnc
-@@ -77,16 +78,6 @@ param=-localhost
+@@ -70,16 +71,6 @@ param=-localhost
  param=-dpi
  param=96
  
@@ -37,22 +37,3 @@ Subject: Use xorgxrdp instead of x11rdp
  [Chansrv]
  ; drive redirection, defaults to xrdp_client if not set
  FuseMountName=thinclient_drives
---- a/xrdp/xrdp.ini
-+++ b/xrdp/xrdp.ini
-@@ -147,16 +147,6 @@ tcutils=true
- ; Session types
- ;
- 
--[X11rdp]
--name=X11rdp
--lib=libxup.so
--username=ask
--password=ask
--ip=127.0.0.1
--port=-1
--xserverbpp=24
--code=10
--
- [Xorg]
- name=Xorg
- lib=libxup.so
diff --git a/debian/patches/cve-2017-6967.diff b/debian/patches/cve-2017-6967.diff
deleted file mode 100644
index b7012dc..0000000
--- a/debian/patches/cve-2017-6967.diff
+++ /dev/null
@@ -1,136 +0,0 @@
-From: Jay Sorg <jay.sorg at gmail.com>
-Date: Mon, 20 Mar 2017 18:59:44 -0700
-Subject: [PATCH] sesman: move auth/pam calls to main process
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858143
-Origin: https://github.com/neutrinolabs/xrdp/commit/4b8a33e087ee9cf5556b40b717cd7e8ff243b3c3
-Reviewed-By: Dominik George <nik at naturalnet.de>
-Reviewed-By: Thorsten Glaser <tg at mirbsd.org>
-
---- a/sesman/scp_v0.c
-+++ b/sesman/scp_v0.c
-@@ -36,6 +36,7 @@ scp_v0_process(struct SCP_CONNECTION *c,
-     tbus data;
-     struct session_item *s_item;
-     int errorcode = 0;
-+    int do_auth_end = 1;
- 
-     data = auth_userpass(s->username, s->password, &errorcode);
- 
-@@ -131,6 +132,9 @@ scp_v0_process(struct SCP_CONNECTION *c,
-                     log_message(LOG_LEVEL_INFO, "starting Xorg session...");
-                     display = session_start(data, SESMAN_SESSION_TYPE_XORG, s);
-                 }
-+                /* if the session started up ok, auth_end will be called on
-+                   sig child */
-+                do_auth_end = display == 0;
-             }
-             else
-             {
-@@ -151,5 +155,8 @@ scp_v0_process(struct SCP_CONNECTION *c,
-     {
-         scp_v0s_deny_connection(c);
-     }
--    auth_end(data);
-+    if (do_auth_end)
-+    {
-+        auth_end(data);
-+    }
- }
---- a/sesman/scp_v1.c
-+++ b/sesman/scp_v1.c
-@@ -38,7 +38,7 @@ void DEFAULT_CC
- scp_v1_process(struct SCP_CONNECTION *c, struct SCP_SESSION *s)
- {
-     long data;
--    int display;
-+    int display = 0;
-     int retries;
-     int current_try;
-     enum SCP_SERVER_STATES_E e;
-@@ -46,6 +46,7 @@ scp_v1_process(struct SCP_CONNECTION *c,
-     struct session_item *sitem;
-     int scount;
-     SCP_SID sid;
-+    int do_auth_end = 1;
- 
-     retries = g_cfg->sec.login_retry;
-     current_try = retries;
-@@ -124,14 +125,21 @@ scp_v1_process(struct SCP_CONNECTION *c,
-             log_message(LOG_LEVEL_INFO, "starting Xvnc session...");
-             display = session_start(data, SESMAN_SESSION_TYPE_XVNC, s);
-         }
--        else
-+        else if (SCP_SESSION_TYPE_XRDP == s->type)
-         {
-             log_message(LOG_LEVEL_INFO, "starting X11rdp session...");
-             display = session_start(data, SESMAN_SESSION_TYPE_XRDP, s);
-         }
-+        else if (SCP_SESSION_TYPE_XORG == s->type)
-+        {
-+            log_message(LOG_LEVEL_INFO, "starting Xorg session...");
-+            display = session_start(data, SESMAN_SESSION_TYPE_XORG, s);
-+        }
-+        /* if the session started up ok, auth_end will be called on
-+           sig child */
-+        do_auth_end = display == 0;
- 
-         e = scp_v1s_connect_new_session(c, display);
--
-         switch (e)
-         {
-             case SCP_SERVER_STATE_OK:
-@@ -197,7 +205,10 @@ scp_v1_process(struct SCP_CONNECTION *c,
-     }
- 
-     /* cleanup */
--    auth_end(data);
-+    if (do_auth_end)
-+    {
-+        auth_end(data);
-+    }
-     g_free(slist);
- }
- 
---- a/sesman/session.c
-+++ b/sesman/session.c
-@@ -335,7 +335,6 @@ session_start_sessvc(int xpid, int wmpid
-     g_sigterm(xpid);
-     g_sigterm(wmpid);
-     g_sleep(1000);
--    auth_end(data);
-     g_exit(0);
- }
- 
-@@ -490,6 +489,7 @@ session_start_fork(tbus data, tui8 type,
-         return 0;
-     }
- 
-+    auth_start_session(data, display);
-     pid = g_fork(); /* parent is fork from tcp accept,
-                        child forks X and wm, then becomes scp */
- 
-@@ -548,7 +548,6 @@ session_start_fork(tbus data, tui8 type,
-         else if (wmpid == 0)
-         {
-             wait_for_xserver(display);
--            auth_start_session(data, display);
-             pampid = g_fork(); /* parent waits, todo
-                                   child becomes wm */
-             if (pampid == -1)
-@@ -639,7 +638,6 @@ session_start_fork(tbus data, tui8 type,
-             else
-             {
-                 g_waitpid(pampid);
--                auth_stop_session(data);
-                 g_deinit();
-                 g_exit(0);
-             }
-@@ -967,6 +965,8 @@ session_kill(int pid)
- 
-         if (tmp->item->pid == pid)
-         {
-+            auth_stop_session(tmp->item->data);
-+            auth_end(tmp->item->data);
-             /* deleting the session */
-             log_message(LOG_LEVEL_INFO, "++ terminated session:  username %s, display :%d.0, session_pid %d, ip %s", tmp->item->name, tmp->item->display, tmp->item->pid, tmp->item->client_ip);
-             g_free(tmp->item);
diff --git a/debian/patches/fix_perms.diff b/debian/patches/fix_perms.diff
index 48400ff..48b0bf7 100644
--- a/debian/patches/fix_perms.diff
+++ b/debian/patches/fix_perms.diff
@@ -8,42 +8,42 @@ Forwarded: https://github.com/neutrinolabs/xorgxrdp/pull/16
  https://github.com/neutrinolabs/xrdp/pull/464
 --- a/common/os_calls.c
 +++ b/common/os_calls.c
-@@ -122,7 +122,7 @@ g_mk_temp_dir(const char *app_name)
+@@ -124,7 +124,7 @@ g_mk_socket_path(const char *app_name)
                  return 1;
              }
          }
--        g_chmod_hex("/tmp/.xrdp", 0x1777);
-+        g_chmod_hex("/tmp/.xrdp", 0x3777);
+-        g_chmod_hex(XRDP_SOCKET_PATH, 0x1777);
++        g_chmod_hex(XRDP_SOCKET_PATH, 0x3777);
      }
      return 0;
  }
 --- a/xorg/X11R7.6/rdp/rdpup.c
 +++ b/xorg/X11R7.6/rdp/rdpup.c
-@@ -1242,7 +1242,7 @@ rdpup_init(void)
+@@ -1245,7 +1245,7 @@ rdpup_init(void)
              return 0;
          }
  
--        g_chmod_hex("/tmp/.xrdp", 0x1777);
-+        g_chmod_hex("/tmp/.xrdp", 0x3777);
+-        g_chmod_hex(socket_dir, 0x1777);
++        g_chmod_hex(socket_dir, 0x3777);
      }
  
      i = atoi(display);
 --- a/xorgxrdp/module/rdpClientCon.c
 +++ b/xorgxrdp/module/rdpClientCon.c
-@@ -1176,7 +1176,7 @@ rdpClientConInit(rdpPtr dev)
+@@ -1217,7 +1217,7 @@ rdpClientConInit(rdpPtr dev)
                  return 0;
              }
          }
--        g_chmod_hex("/tmp/.xrdp", 0x1777);
-+        g_chmod_hex("/tmp/.xrdp", 0x3777);
+-        g_chmod_hex(socket_dir, 0x1777);
++        g_chmod_hex(socket_dir, 0x3777);
      }
      i = atoi(display);
      if (i < 1)
-@@ -1195,6 +1195,7 @@ rdpClientConInit(rdpPtr dev)
+@@ -1238,6 +1238,7 @@ rdpClientConInit(rdpPtr dev)
              return 1;
          }
          g_sck_listen(dev->listen_sck);
 +        g_chmod_hex(dev->uds_data, 0x0660);
          rdpClientConAddEnabledDevice(dev->pScreen, dev->listen_sck);
      }
-     return 0;
+ 
diff --git a/debian/patches/highres.diff b/debian/patches/highres.diff
deleted file mode 100644
index 8bf64ba..0000000
--- a/debian/patches/highres.diff
+++ /dev/null
@@ -1,51 +0,0 @@
-From: Dominik George <nik at naturalnet.de>
-Forwarded: https://github.com/neutrinolabs/xrdp/pull/664
-Acked-by: Thorsten Glaser <tg at mirbsd.de>
-Subject: RFX fixes for large tile sets.
- This patch disables the limitation of rects to use and then
- dynamically calculates the size of the message from the
- rects that are really used.
-Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=855387
-Bug: https://github.com/neutrinolabs/xrdp/issues/524
---- a/xrdp/xrdp_encoder.c
-+++ b/xrdp/xrdp_encoder.c
-@@ -22,6 +22,7 @@
- #include "xrdp.h"
- #include "thread_calls.h"
- #include "fifo.h"
-+#include "limits.h"
- 
- #ifdef XRDP_RFXCODEC
- #include "rfxcodec_encode.h"
-@@ -320,21 +321,25 @@ process_enc_rfx(struct xrdp_encoder *sel
-     mutex = self->mutex;
-     event_processed = self->xrdp_encoder_event_processed;
- 
--    if ((enc->num_crects > 512) || (enc->num_drects > 512))
--    {
-+    out_data_bytes = 16 * 1024 * 1024;
-+
-+    if ((enc->num_crects > (INT_MAX / sizeof(struct rfx_tile))) ||
-+        (enc->num_drects > (INT_MAX / sizeof(struct rfx_rect) -
-+                            sizeof(struct rfx_tile) * enc->num_crects -
-+                            256 - out_data_bytes)) ||
-+        (enc->num_crects < 0) || (enc->num_drects < 0)) {
-         return 0;
-     }
- 
--    out_data_bytes = 16 * 1024 * 1024;
--    index = 256 + sizeof(struct rfx_tile) * 512 +
--                  sizeof(struct rfx_rect) * 512;
-+    index = 256 + sizeof(struct rfx_tile) * enc->num_crects +
-+                  sizeof(struct rfx_rect) * enc->num_drects;
-     out_data = (char *) g_malloc(out_data_bytes + index, 0);
-     if (out_data == 0)
-     {
-         return 0;
-     }
-     tiles = (struct rfx_tile *) (out_data + out_data_bytes + 256);
--    rfxrects = (struct rfx_rect *) (tiles + 512);
-+    rfxrects = (struct rfx_rect *) (tiles + enc->num_crects);
- 
-     count = enc->num_crects;
-     for (index = 0; index < count; index++)
diff --git a/debian/patches/kb_jp.diff b/debian/patches/kb_jp.diff
deleted file mode 100644
index ba42082..0000000
--- a/debian/patches/kb_jp.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-From: YOSHINO Yoshihito <yy.y.ja.jp at gmail.com>
-Subject: xrdp: fails to detect some Japanese keyboard
-Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854847
-Bug: https://github.com/neutrinolabs/xrdp/issues/663
---- a/xrdp/xrdp_keyboard.ini
-+++ b/xrdp/xrdp_keyboard.ini
-@@ -62,6 +62,9 @@ rdp_layout_de=0x00000407
- rdp_layout_fr=0x0000040C
- rdp_layout_it=0x00000410
- rdp_layout_jp=0x00000411
-+rdp_layout_jp=0xe0010411
-+rdp_layout_jp=0xe0200411
-+rdp_layout_jp=0xe0210411
- rdp_layout_kr=0x00000412
- rdp_layout_ru=0x00000419
- rdp_layout_se=0x0000041D
diff --git a/debian/patches/kfreebsd.diff b/debian/patches/kfreebsd.diff
deleted file mode 100644
index 6ac7387..0000000
--- a/debian/patches/kfreebsd.diff
+++ /dev/null
@@ -1,63 +0,0 @@
-From: Thorsten Glaser <tg at mirbsd.org>
-Subject: Recognise GNU/kFreeBSD as FreeBSD variant in code,
- but as a Linux for instfiles/ (init scripts and so on)
-Forwarded: https://github.com/neutrinolabs/xrdp/pull/645
-Reviewed-by: Dominik George <nik at naturalnet.de>
---- a/common/os_calls.c
-+++ b/common/os_calls.c
-@@ -87,8 +87,8 @@ extern char **environ;
- #endif
- 
- /* sys/ucred.h needs to be included to use struct xucred
-- * in FreeBSD and OS X. No need for other BSDs  */
--#if defined(__FreeBSD__) || defined(__APPLE__)
-+ * in FreeBSD and OS X. No need for other BSDs except GNU/kFreeBSD */
-+#if defined(__FreeBSD__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
- #include <sys/ucred.h>
- #endif
- 
---- a/configure.ac
-+++ b/configure.ac
-@@ -24,6 +24,9 @@ case $host_os in
- 	*linux*)
- 		linux=yes
- 		;;
-+	*kfreebsd*)
-+		linux=yes # only used in instfiles/ so that’s ok for us for now
-+		;;
- 	*freebsd*)
- 		freebsd=yes
- 		;;
---- a/librfxcodec/acinclude.m4
-+++ b/librfxcodec/acinclude.m4
-@@ -40,7 +40,7 @@ case "$host_os" in
-         ;;
-     esac
-   ;;
--  freebsd* | netbsd* | openbsd*)
-+  kfreebsd* | freebsd* | netbsd* | openbsd*)
-     if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-       objfmt='BSD-a.out'
-     else
---- a/sesman/session.c
-+++ b/sesman/session.c
-@@ -503,7 +503,7 @@ session_start_fork(tbus data, tui8 type,
-         g_sprintf(geometry, "%dx%d", s->width, s->height);
-         g_sprintf(depth, "%d", s->bpp);
-         g_sprintf(screen, ":%d", display);
--#ifdef __FreeBSD__
-+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-         /*
-          * FreeBSD bug
-          * ports/157282: effective login name is not set by xrdp-sesman
---- a/xorgxrdp/acinclude.m4
-+++ b/xorgxrdp/acinclude.m4
-@@ -40,7 +40,7 @@ case "$host_os" in
-         ;;
-     esac
-   ;;
--  freebsd* | netbsd* | openbsd*)
-+  kfreebsd* | freebsd* | netbsd* | openbsd*)
-     if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-       objfmt='BSD-a.out'
-     else
diff --git a/debian/patches/lfs.diff b/debian/patches/lfs.diff
index e6d12e7..5059346 100644
--- a/debian/patches/lfs.diff
+++ b/debian/patches/lfs.diff
@@ -12,8 +12,8 @@ Reviewed-by: Dominik George <nik at naturalnet.de>
 +AC_FUNC_FSEEKO
  AC_C_CONST
  AC_PROG_LIBTOOL
- PKG_PROG_PKG_CONFIG
-@@ -320,4 +322,5 @@ AC_CONFIG_FILES([
+ 
+@@ -361,4 +363,5 @@ AC_CONFIG_FILES([
    xup/Makefile
  ])
  
@@ -30,7 +30,7 @@ Reviewed-by: Dominik George <nik at naturalnet.de>
  AC_C_CONST
  AC_PROG_LIBTOOL
  PKG_INSTALLDIR
-@@ -34,4 +36,5 @@ AC_CONFIG_FILES([
+@@ -31,4 +33,5 @@ AC_CONFIG_FILES([
    tests/Makefile
  ])
  
@@ -40,14 +40,14 @@ Reviewed-by: Dominik George <nik at naturalnet.de>
 +++ b/librfxcodec/configure.ac
 @@ -7,6 +7,8 @@ AM_INIT_AUTOMAKE([1.6 foreign])
  AC_CONFIG_MACRO_DIR([m4])
- m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES])
+ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
  AC_PROG_CC
 +AC_SYS_LARGEFILE
 +AC_FUNC_FSEEKO
  AC_C_CONST
  AC_PROG_LIBTOOL
  PKG_INSTALLDIR
-@@ -49,5 +51,6 @@ AC_CONFIG_FILES([Makefile
+@@ -53,5 +55,6 @@ AC_CONFIG_FILES([Makefile
                   rfxcodec-uninstalled.pc
  ])
  
@@ -65,7 +65,7 @@ Reviewed-by: Dominik George <nik at naturalnet.de>
  AC_C_CONST
  AC_PROG_LIBTOOL
  
-@@ -72,5 +74,6 @@ AC_CONFIG_FILES([Makefile
+@@ -75,5 +77,6 @@ AC_CONFIG_FILES([Makefile
                   xrdpmouse/Makefile
  ])
  
diff --git a/debian/patches/make-fixes.diff b/debian/patches/make-fixes.diff
index bb43865..af47f67 100644
--- a/debian/patches/make-fixes.diff
+++ b/debian/patches/make-fixes.diff
@@ -13,7 +13,7 @@ Forwarded: https://github.com/neutrinolabs/xrdp/pull/467
    $(XRDPVRDIR)
 --- a/configure.ac
 +++ b/configure.ac
-@@ -264,6 +264,14 @@ AC_CHECK_HEADER([X11/extensions/Xrandr.h
+@@ -305,6 +305,14 @@ AC_CHECK_HEADER([X11/extensions/Xrandr.h
    [AC_MSG_ERROR([please install libxrandr-dev or libXrandr-devel])],
    [#include <X11/Xlib.h>])
  
@@ -30,7 +30,7 @@ Forwarded: https://github.com/neutrinolabs/xrdp/pull/467
  AC_SUBST([moduledir], '${libdir}/xrdp')
 --- a/xrdp/Makefile.am
 +++ b/xrdp/Makefile.am
-@@ -24,7 +24,7 @@ endif
+@@ -23,7 +23,7 @@ endif
  if XRDP_RFXCODEC
  AM_CPPFLAGS += -DXRDP_RFXCODEC
  AM_CPPFLAGS += -I$(top_srcdir)/librfxcodec/include
@@ -41,7 +41,7 @@ Forwarded: https://github.com/neutrinolabs/xrdp/pull/467
  if XRDP_PIXMAN
 --- a/xrdpapi/Makefile.am
 +++ b/xrdpapi/Makefile.am
-@@ -9,3 +9,9 @@ module_LTLIBRARIES = \
+@@ -13,3 +13,9 @@ module_LTLIBRARIES = \
  libxrdpapi_la_SOURCES = \
    xrdpapi.c \
    xrdpapi.h
diff --git a/debian/patches/misc-fixes.diff b/debian/patches/misc-fixes.diff
index 19f365b..3196054 100644
--- a/debian/patches/misc-fixes.diff
+++ b/debian/patches/misc-fixes.diff
@@ -4,7 +4,7 @@ Forwarded: https://github.com/neutrinolabs/xorgxrdp/pull/17
  https://github.com/neutrinolabs/xrdp/pull/467
 --- a/xorgxrdp/xrdpkeyb/rdpKeyboard.c
 +++ b/xorgxrdp/xrdpkeyb/rdpKeyboard.c
-@@ -534,7 +534,7 @@ rdpInputKeyboard(rdpPtr dev, int msg, lo
+@@ -538,7 +538,7 @@ rdpInputKeyboard(rdpPtr dev, int msg, lo
  }
  
  /******************************************************************************/
@@ -13,15 +13,15 @@ Forwarded: https://github.com/neutrinolabs/xorgxrdp/pull/17
  rdpkeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
  {
      int i;
-@@ -565,7 +565,7 @@ rdpkeybDeviceInit(DeviceIntPtr pDevice,
+@@ -569,7 +569,7 @@ rdpkeybDeviceInit(DeviceIntPtr pDevice,
      if (pKeySyms->map == 0)
      {
          LLOGLN(0, ("rdpkeybDeviceInit: out of memory"));
 -        exit(1);
 +        return 1;
      }
-     else
-     {
+ 
+     for (i = 0; i < MAP_LENGTH * GLYPHS_PER_KEY; i++)
 @@ -581,6 +581,8 @@ rdpkeybDeviceInit(DeviceIntPtr pDevice,
      {
          pKeySyms->map[i] = g_kbdMap[i];
diff --git a/debian/patches/series b/debian/patches/series
index bd3f630..8d13f9b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,10 +3,5 @@ config.diff
 misc-fixes.diff
 fix_perms.diff
 shutup-daemon.diff
-sockpath.diff
-kfreebsd.diff
 systemd.diff
 lfs.diff
-kb_jp.diff
-highres.diff
-cve-2017-6967.diff
diff --git a/debian/patches/shutup-daemon.diff b/debian/patches/shutup-daemon.diff
index c53d9a2..d567bdf 100644
--- a/debian/patches/shutup-daemon.diff
+++ b/debian/patches/shutup-daemon.diff
@@ -2,7 +2,7 @@ From: Thorsten Glaser <tg at mirbsd.org>
 Subject: don’t spit on the console when starting
 --- a/common/log.c
 +++ b/common/log.c
-@@ -383,11 +383,6 @@ internal_config_read_logging(int file, s
+@@ -387,11 +387,6 @@ internal_config_read_logging(int file, s
      /* try to create path if not exist */
      g_create_path(lc->log_file);
  
@@ -16,7 +16,7 @@ Subject: don’t spit on the console when starting
  
 --- a/sesman/sesman.c
 +++ b/sesman/sesman.c
-@@ -149,6 +149,12 @@ main(int argc, char **argv)
+@@ -209,6 +209,12 @@ main(int argc, char **argv)
  
      if (1 == argc)
      {
@@ -31,11 +31,11 @@ Subject: don’t spit on the console when starting
          daemon = 1;
 --- a/xrdp/xrdp.c
 +++ b/xrdp/xrdp.c
-@@ -544,7 +544,6 @@ main(int argc, char **argv)
- 
-         if (0 != pid)
-         {
--            g_writeln("process %d started ok", pid);
+@@ -560,7 +560,6 @@ main(int argc, char **argv)
+                    or systemd cannot detect xrdp daemon couldn't start properly */
+                 g_exit(1);
+             }
+-            g_writeln("daemon process %d started ok", pid);
              /* exit, this is the main process */
              g_deinit();
              g_exit(0);
diff --git a/debian/patches/sockpath.diff b/debian/patches/sockpath.diff
deleted file mode 100644
index 341629c..0000000
--- a/debian/patches/sockpath.diff
+++ /dev/null
@@ -1,264 +0,0 @@
-From: Thorsten Glaser <tg at mirbsd.org>
-Subject: change location of the socket path to something less racy
- also, rely on the initscript to create it with correct permissions and ownership
---- a/common/file_loc.h
-+++ b/common/file_loc.h
-@@ -46,23 +46,23 @@
- #endif
- 
- #if !defined(XRDP_CHANSRV_STR)
--#define XRDP_CHANSRV_STR "/tmp/.xrdp/xrdp_chansrv_socket_%d"
-+#define XRDP_CHANSRV_STR "/var/run/xrdp/sockdir/xrdp_chansrv_socket_%d"
- #endif
- 
- #if !defined(CHANSRV_PORT_OUT_STR)
--#define CHANSRV_PORT_OUT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d"
-+#define CHANSRV_PORT_OUT_STR "/var/run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_%d"
- #endif
- 
- #if !defined(CHANSRV_PORT_IN_STR)
--#define CHANSRV_PORT_IN_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
-+#define CHANSRV_PORT_IN_STR "/var/run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_%d"
- #endif
- 
- #if !defined(CHANSRV_API_STR)
--#define CHANSRV_API_STR "/tmp/.xrdp/xrdpapi_%d"
-+#define CHANSRV_API_STR "/var/run/xrdp/sockdir/xrdpapi_%d"
- #endif
- 
- #if !defined(XRDP_X11RDP_STR)
--#define XRDP_X11RDP_STR "/tmp/.xrdp/xrdp_display_%d"
-+#define XRDP_X11RDP_STR "/var/run/xrdp/sockdir/xrdp_display_%d"
- #endif
- 
- #endif
---- a/common/os_calls.c
-+++ b/common/os_calls.c
-@@ -111,18 +111,10 @@ g_rm_temp_dir(void)
- int APP_CC
- g_mk_temp_dir(const char *app_name)
- {
--    if (!g_directory_exist("/tmp/.xrdp"))
-+    if (!g_directory_exist("/var/run/xrdp/sockdir"))
-     {
--        if (!g_create_dir("/tmp/.xrdp"))
--        {
--            /* if failed, still check if it got created by someone else */
--            if (!g_directory_exist("/tmp/.xrdp"))
--            {
--                printf("g_mk_temp_dir: g_create_dir failed\n");
-+                printf("g_mk_temp_dir: /var/run/xrdp/sockdir does not exist\n");
-                 return 1;
--            }
--        }
--        g_chmod_hex("/tmp/.xrdp", 0x3777);
-     }
-     return 0;
- }
---- a/docs/man/xrdp-chansrv.8
-+++ b/docs/man/xrdp-chansrv.8
-@@ -30,10 +30,10 @@ Dynamic Virtual Channel
- 
- .SH FILES
- .TP
--.I /tmp/.xrdp/xrdp_chansrv_socket_*
-+.I /var/run/xrdp/sockdir/xrdp_chansrv_socket_*
- UNIX socket used by external programs to implement channels.
- .TP
--.I /tmp/.xrdp/xrdp_api_*
-+.I /var/run/xrdp/sockdir/xrdp_api_*
- UNIX socket used by \fBxrdp\-chansrv\fP to communicate with \fBxrdp\-sesman\fP.
- .TP
- .I $XDG_DATA_HOME/xrdp/xrdp-chansrv.log
---- a/docs/man/xrdp-dis.1
-+++ b/docs/man/xrdp-dis.1
-@@ -16,7 +16,7 @@ to get the default host and display numb
- 
- .SH FILES
- .TP
--.I /tmp/.xrdp/xrdp_disconnect_display_*
-+.I /var/run/xrdp/sockdir/xrdp_disconnect_display_*
- UNIX socket used to communicate with the \fBxrdp\fP(8) session manager.
- 
- .SH KNOWN ISSUES
---- a/instfiles/xrdp.service
-+++ b/instfiles/xrdp.service
-@@ -8,8 +8,11 @@ Type=forking
- PIDFile=/var/run/xrdp.pid
- EnvironmentFile=-/etc/sysconfig/xrdp
- EnvironmentFile=-/etc/default/xrdp
-+PermissionsStartOnly=true
-+ExecStartPre=/bin/sh /usr/share/xrdp/socksetup
- ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS
- ExecStop=/usr/sbin/xrdp $XRDP_OPTIONS --kill
-+ExecStopPost=/bin/rm -rf /var/run/xrdp/sockdir
- 
- [Install]
- WantedBy=multi-user.target
---- a/sesman/chansrv/pulse/module-xrdp-sink.c
-+++ b/sesman/chansrv/pulse/module-xrdp-sink.c
-@@ -84,7 +84,7 @@ PA_MODULE_USAGE(
- #define DEFAULT_SINK_NAME "xrdp-sink"
- #define BLOCK_USEC 30000
- //#define BLOCK_USEC (PA_USEC_PER_SEC * 2)
--#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_out_socket_%d"
-+#define CHANSRV_PORT_STR "/var/run/xrdp/sockdir/xrdp_chansrv_audio_out_socket_%d"
- 
- struct userdata {
-     pa_core *core;
---- a/sesman/chansrv/pulse/module-xrdp-source.c
-+++ b/sesman/chansrv/pulse/module-xrdp-source.c
-@@ -72,7 +72,7 @@ PA_MODULE_USAGE(
- #define DEFAULT_SOURCE_NAME "xrdp-source"
- #define DEFAULT_LATENCY_TIME 10
- #define MAX_LATENCY_USEC 1000
--#define CHANSRV_PORT_STR "/tmp/.xrdp/xrdp_chansrv_audio_in_socket_%d"
-+#define CHANSRV_PORT_STR "/var/run/xrdp/sockdir/xrdp_chansrv_audio_in_socket_%d"
- 
- struct userdata {
-     pa_core *core;
---- a/sesman/sessvc/sessvc.c
-+++ b/sesman/sessvc/sessvc.c
-@@ -55,14 +55,14 @@ chansrv_cleanup(int pid)
- {
-     char text[256];
- 
--    g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_main_term", pid);
-+    g_snprintf(text, 255, "/var/run/xrdp/sockdir/xrdp_chansrv_%8.8x_main_term", pid);
- 
-     if (g_file_exist(text))
-     {
-         g_file_delete(text);
-     }
- 
--    g_snprintf(text, 255, "/tmp/.xrdp/xrdp_chansrv_%8.8x_thread_done", pid);
-+    g_snprintf(text, 255, "/var/run/xrdp/sockdir/xrdp_chansrv_%8.8x_thread_done", pid);
- 
-     if (g_file_exist(text))
-     {
---- a/sesman/tools/dis.c
-+++ b/sesman/tools/dis.c
-@@ -50,7 +50,7 @@ int main(int argc, char **argv)
-     dis = strtol(display + 1, &p, 10);
-     memset(&sa, 0, sizeof(sa));
-     sa.sun_family = AF_UNIX;
--    sprintf(sa.sun_path, "/tmp/.xrdp/xrdp_disconnect_display_%d", dis);
-+    sprintf(sa.sun_path, "/var/run/xrdp/sockdir/xrdp_disconnect_display_%d", dis);
- 
-     if (access(sa.sun_path, F_OK) != 0)
-     {
---- a/xorg/X11R7.6/rdp/rdpmain.c
-+++ b/xorg/X11R7.6/rdp/rdpmain.c
-@@ -769,7 +769,7 @@ ddxGiveUp(void)
-     {
-         sprintf(unixSocketName, "/tmp/.X11-unix/X%s", display);
-         unlink(unixSocketName);
--        sprintf(unixSocketName, "/tmp/.xrdp/xrdp_disconnect_display_%s", display);
-+        sprintf(unixSocketName, "/var/run/xrdp/sockdir/xrdp_disconnect_display_%s", display);
-         unlink(unixSocketName);
- 
-         if (g_uds_data[0] != 0)
-@@ -823,7 +823,7 @@ ddxUseMsg(void)
-     ErrorF("X11rdp specific options\n");
-     ErrorF("-geometry WxH          set framebuffer width & height\n");
-     ErrorF("-depth D               set framebuffer depth\n");
--    ErrorF("-uds                   create and listen on /tmp/.xrdp/xrdp_display_x\n");
-+    ErrorF("-uds                   create and listen on /var/run/xrdp/sockdir/xrdp_display_x\n");
-     ErrorF("\n");
-     exit(1);
- }
---- a/xorg/X11R7.6/rdp/rdpup.c
-+++ b/xorg/X11R7.6/rdp/rdpup.c
-@@ -1234,15 +1234,10 @@ rdpup_init(void)
-     char *ptext;
-     int i;
- 
--    if (!g_directory_exist("/tmp/.xrdp"))
-+    if (!g_directory_exist("/var/run/xrdp/sockdir"))
-     {
--        if (!g_create_dir("/tmp/.xrdp"))
--        {
--            LLOGLN(0, ("rdpup_init: g_create_dir failed"));
-+            LLOGLN(0, ("rdpup_init: /var/run/xrdp/sockdir does not exist"));
-             return 0;
--        }
--
--        g_chmod_hex("/tmp/.xrdp", 0x3777);
-     }
- 
-     i = atoi(display);
-@@ -1266,7 +1261,7 @@ rdpup_init(void)
- 
-     if (g_use_uds)
-     {
--        g_sprintf(g_uds_data, "/tmp/.xrdp/xrdp_display_%s", display);
-+        g_sprintf(g_uds_data, "/var/run/xrdp/sockdir/xrdp_display_%s", display);
- 
-         if (g_listen_sck == 0)
-         {
-@@ -1304,7 +1299,7 @@ rdpup_init(void)
- 
-     if (g_dis_listen_sck != 0)
-     {
--        g_sprintf(text, "/tmp/.xrdp/xrdp_disconnect_display_%s", display);
-+        g_sprintf(text, "/var/run/xrdp/sockdir/xrdp_disconnect_display_%s", display);
- 
-         if (g_tcp_local_bind(g_dis_listen_sck, text) == 0)
-         {
---- a/xorgxrdp/module/rdpClientCon.c
-+++ b/xorgxrdp/module/rdpClientCon.c
-@@ -1166,17 +1166,10 @@ rdpClientConInit(rdpPtr dev)
- {
-     int i;
- 
--    if (!g_directory_exist("/tmp/.xrdp"))
-+    if (!g_directory_exist("/var/run/xrdp/sockdir"))
-     {
--        if (!g_create_dir("/tmp/.xrdp"))
--        {
--            if (!g_directory_exist("/tmp/.xrdp"))
--            {
--                LLOGLN(0, ("rdpup_init: g_create_dir failed"));
-+                LLOGLN(0, ("rdpup_init: /var/run/xrdp/sockdir does not exist"));
-                 return 0;
--            }
--        }
--        g_chmod_hex("/tmp/.xrdp", 0x3777);
-     }
-     i = atoi(display);
-     if (i < 1)
-@@ -1184,7 +1177,7 @@ rdpClientConInit(rdpPtr dev)
-         LLOGLN(0, ("rdpClientConInit: can not run at display < 1"));
-         return 0;
-     }
--    g_sprintf(dev->uds_data, "/tmp/.xrdp/xrdp_display_%s", display);
-+    g_sprintf(dev->uds_data, "/var/run/xrdp/sockdir/xrdp_display_%s", display);
-     if (dev->listen_sck == 0)
-     {
-         unlink(dev->uds_data);
---- a/xrdp/xrdp.ini
-+++ b/xrdp/xrdp.ini
-@@ -137,10 +137,10 @@ xrdpvr=true
- tcutils=true
- 
- ; for debugging xrdp, in section xrdp1, change port=-1 to this:
--#port=/tmp/.xrdp/xrdp_display_10
-+#port=/var/run/xrdp/sockdir/xrdp_display_10
- 
- ; for debugging xrdp, add following line to section xrdp1
--#chansrvport=/tmp/.xrdp/xrdp_chansrv_socket_7210
-+#chansrvport=/var/run/xrdp/sockdir/xrdp_chansrv_socket_7210
- 
- 
- ;
---- a/xrdpapi/xrdpapi.c
-+++ b/xrdpapi/xrdpapi.c
-@@ -144,7 +144,7 @@ WTSVirtualChannelOpenEx(unsigned int Ses
-     memset(&s, 0, sizeof(struct sockaddr_un));
-     s.sun_family = AF_UNIX;
-     bytes = sizeof(s.sun_path);
--    snprintf(s.sun_path, bytes - 1, "/tmp/.xrdp/xrdpapi_%d", wts->display_num);
-+    snprintf(s.sun_path, bytes - 1, "/var/run/xrdp/sockdir/xrdpapi_%d", wts->display_num);
-     s.sun_path[bytes - 1] = 0;
-     bytes = sizeof(struct sockaddr_un);
- 
diff --git a/debian/patches/systemd.diff b/debian/patches/systemd.diff
index 76f1196..ab26dd2 100644
--- a/debian/patches/systemd.diff
+++ b/debian/patches/systemd.diff
@@ -1,45 +1,33 @@
 Subject: Fixes to systemd service files
 From: Dominik George <nik at naturalnet.de>
 Forwarded: https://github.com/neutrinolabs/xrdp/pull/646
---- a/instfiles/xrdp-sesman.service
-+++ b/instfiles/xrdp-sesman.service
-@@ -1,12 +1,14 @@
- [Unit]
- Description=xrdp session manager
--After=syslog.target network.target
-+Documentation=man:xrdp-sesman(8) man:sesman.ini(5)
-+After=network.target
- StopWhenUnneeded=true
--BindTo=xrdp.service
-+BindsTo=xrdp.service
+--- a/instfiles/xrdp-sesman.service.in
++++ b/instfiles/xrdp-sesman.service.in
+@@ -7,7 +7,8 @@ BindsTo=xrdp.service
  
  [Service]
  Type=forking
--PIDFile=/var/run/xrdp-sesman.pid
-+PIDFile=/run/xrdp/xrdp-sesman.pid
+-PIDFile=@localstatedir@/run/xrdp-sesman.pid
++PIDFile=@localstatedir@/run/xrdp/xrdp-sesman.pid
 +RuntimeDirectory=xrdp
- EnvironmentFile=-/etc/sysconfig/xrdp
- EnvironmentFile=-/etc/default/xrdp
- ExecStart=/usr/sbin/xrdp-sesman $SESMAN_OPTIONS
---- a/instfiles/xrdp.service
-+++ b/instfiles/xrdp.service
-@@ -1,13 +1,17 @@
- [Unit]
- Description=xrdp daemon
-+Documentation=man:xrdp(8) man:xrdp.ini(5)
- Requires=xrdp-sesman.service
--After=syslog.target network.target xrdp-sesman.service
-+After=network.target xrdp-sesman.service
+ EnvironmentFile=- at sysconfdir@/sysconfig/xrdp
+ EnvironmentFile=- at sysconfdir@/default/xrdp
+ ExecStart=@sbindir@/xrdp-sesman $SESMAN_OPTIONS
+--- a/instfiles/xrdp.service.in
++++ b/instfiles/xrdp.service.in
+@@ -6,9 +6,14 @@ After=network.target xrdp-sesman.service
  
  [Service]
  Type=forking
--PIDFile=/var/run/xrdp.pid
-+PIDFile=/run/xrdp/xrdp.pid
+-PIDFile=@localstatedir@/run/xrdp.pid
++PIDFile=@localstatedir@/run/xrdp/xrdp.pid
 +RuntimeDirectory=xrdp
- EnvironmentFile=-/etc/sysconfig/xrdp
- EnvironmentFile=-/etc/default/xrdp
+ EnvironmentFile=- at sysconfdir@/sysconfig/xrdp
+ EnvironmentFile=- at sysconfdir@/default/xrdp
 +User=xrdp
 +Group=xrdp
- PermissionsStartOnly=true
- ExecStartPre=/bin/sh /usr/share/xrdp/socksetup
- ExecStart=/usr/sbin/xrdp $XRDP_OPTIONS
++PermissionsStartOnly=true
++ExecStartPre=/bin/sh /usr/share/xrdp/socksetup
+ ExecStart=@sbindir@/xrdp $XRDP_OPTIONS
+ ExecStop=@sbindir@/xrdp $XRDP_OPTIONS --kill
+ 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-remote/xrdp.git



More information about the pkg-remote-commits mailing list