Package: xrdp
Version: 0.6.0-1
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu trusty ubuntu-patch

Dear Maintainer,
If xrdp already exists as a user the package fails to install with the
following error message:

Setting up xrdp (0.6.0-1) ...
adduser: The user `xrdp' already exists. Exiting.
dpkg: error processing xrdp (--configure):
 subprocess installed post-installation script returned error exit status 1

This patch checks if the user already exists and doesn't re-create the user.

I'm not sure if this is the best approach, as an existing user might not
have the correct setup to use this package.

Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500,
'precise')
Architecture: amd64 (x86_64)

Kernel: Linux 3.8.0-35-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

diff -Nru xrdp-0.6.0/debian/changelog xrdp-0.6.0/debian/changelog
diff -Nru xrdp-0.6.0/debian/postinst xrdp-0.6.0/debian/postinst
--- xrdp-0.6.0/debian/postinst	2012-09-29 08:04:03.000000000 -0500
+++ xrdp-0.6.0/debian/postinst	2014-01-10 09:34:35.000000000 -0600
@@ -10,8 +10,8 @@
 ADDUSER="/usr/sbin/adduser"
 
 [ -d /var/run/xrdp ] || mkdir -p /var/run/xrdp
-$ADDUSER --system --disabled-password --disabled-login --home /var/run/xrdp \
-         --no-create-home --quiet --group $XRDP
+id -u $XRDP &>/dev/null || $ADDUSER --system --disabled-password \
+    --disabled-login --home /var/run/xrdp --no-create-home --quiet --group $XRDP
 
 $CHOWN -R $XRDP:$XRDP /etc/xrdp
 

Reply via email to