** Description changed:

+ [Impact]
+ 
+ On Ubuntu 22.04, xrdp can fail to configure during install or upgrade:
+ 
+     Setting up xrdp (0.9.17-2ubuntu3) ...
+     ln: failed to create symbolic link '/etc/xrdp/cert.pem': File exists
+     dpkg: error processing package xrdp (--configure):
+      installed xrdp package post-installation script subprocess returned 
error exit status 1
+ 
+ debian/xrdp.postinst guards default TLS cert/key creation with a single
+ "test -e /etc/xrdp/cert.pem":
+ 
+     test -e /etc/xrdp/cert.pem || (
+         make-ssl-cert generate-default-snakeoil
+         ln -s /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/xrdp/cert.pem
+         ln -s /etc/ssl/private/ssl-cert-snakeoil.key /etc/xrdp/key.pem
+     )
+ 
+ This is not idempotent:
+ 
+  * test -e follows symlinks, so it is false for a dangling cert.pem symlink.
+    The block then runs, make-ssl-cert recreates the targets, and "ln -s ... 
/etc/xrdp/cert.pem" fails with "File exists".
+  * If cert.pem is missing but key.pem already exists, the key.pem ln -s fails 
the same way.
+ 
+ [Test Plan]
+ 
+ Run on each target series, comparing the maintainer script before and
+ after the patch.
+ 
+ Before the patch:
+ 
+     sudo apt-get update
+     sudo apt-get install -y ssl-cert xrdp
+     sudo rm -f /etc/ssl/certs/ssl-cert-snakeoil.pem
+     sudo rm -f /etc/ssl/private/ssl-cert-snakeoil.key
+     sudo mkdir -p /etc/xrdp
+     sudo ln -snf /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/xrdp/cert.pem
+     sudo ln -snf /etc/ssl/private/ssl-cert-snakeoil.key /etc/xrdp/key.pem
+     sudo apt-get install -y --reinstall xrdp
+ 
+ Expected (buggy) result:
+ 
+     ln: failed to create symbolic link '/etc/xrdp/cert.pem': File exists
+ 
+ After the patch:
+ 
+     sudo apt-get install -y ssl-cert xrdp
+     sudo rm -f /etc/ssl/certs/ssl-cert-snakeoil.pem
+     sudo rm -f /etc/ssl/private/ssl-cert-snakeoil.key
+     sudo mkdir -p /etc/xrdp
+     sudo ln -snf /etc/ssl/certs/ssl-cert-snakeoil.pem /etc/xrdp/cert.pem
+     sudo ln -snf /etc/ssl/private/ssl-cert-snakeoil.key /etc/xrdp/key.pem
+     sudo apt-get install -y --reinstall xrdp
+     test -e /etc/xrdp/cert.pem
+     test -e /etc/xrdp/key.pem
+ 
+ Expected (fixed) result:
+ 
+  * Install/configure succeeds.
+  * /etc/xrdp/cert.pem and /etc/xrdp/key.pem exist.
+  * Reinstalling the package succeeds again.
+ 
+ Administrator-provided file preservation:
+ 
+     sudo rm -f /etc/xrdp/cert.pem /etc/xrdp/key.pem
+     echo custom-cert | sudo tee /etc/xrdp/cert.pem >/dev/null
+     echo custom-key  | sudo tee /etc/xrdp/key.pem >/dev/null
+     sudo apt-get install -y --reinstall xrdp
+     grep -q custom-cert /etc/xrdp/cert.pem && grep -q custom-key 
/etc/xrdp/key.pem
+ 
+ Expected: reconfigure succeeds and the custom cert/key files are left
+ untouched.
+ 
+ [Where problems could occur]
+ 
+ The change touches only debian/xrdp.postinst, in the default TLS cert/key 
symlink creation.
+ It runs at "configure" and writes only /etc/xrdp/cert.pem and 
/etc/xrdp/key.pem, so a regression could only appear at install/upgrade:
+ 
+  * default cert/key symlinks not created on a clean install
+  * an existing admin-provided cert/key file or symlink being overwritten
+ 
+ [Other Info]
+ 
+ Forwarded to Debian:
+ https://salsa.debian.org/debian-remote-team/xrdp/-/merge_requests/18
+ 
+ [Original Descption]
+ 
  I can't upgrade xrdp on this computer
  
  ProblemType: Package
  DistroRelease: Ubuntu 22.04
  Package: xrdp 0.9.17-2ubuntu3
  ProcVersionSignature: Ubuntu 5.15.0-27.28-generic 5.15.30
  Uname: Linux 5.15.0-27-generic x86_64
  ApportVersion: 2.20.11-0ubuntu82.8
  Architecture: amd64
  CasperMD5CheckResult: unknown
  Date: Sat Jun 14 16:56:23 2025
  DuplicateSignature:
-  package:xrdp:0.9.17-2ubuntu3
-  Setting up xrdp (0.9.17-2ubuntu3) ...
-  ln: failed to create symbolic link '/etc/xrdp/cert.pem': File exists
-  dpkg: error processing package xrdp (--configure):
-   installed xrdp package post-installation script subprocess returned error 
exit status 1
+  package:xrdp:0.9.17-2ubuntu3
+  Setting up xrdp (0.9.17-2ubuntu3) ...
+  ln: failed to create symbolic link '/etc/xrdp/cert.pem': File exists
+  dpkg: error processing package xrdp (--configure):
+   installed xrdp package post-installation script subprocess returned error 
exit status 1
  ErrorMessage: installed xrdp package post-installation script subprocess 
returned error exit status 1
  Python3Details: /usr/bin/python3.10, Python 3.10.12, python3-minimal, 
3.10.6-1~22.04.1
  PythonDetails: N/A
  RebootRequiredPkgs: Error: path contained symlinks.
  RelatedPackageVersions:
-  dpkg 1.21.1ubuntu2.3
-  apt  2.4.14
+  dpkg 1.21.1ubuntu2.3
+  apt  2.4.14
  SourcePackage: xrdp
  Title: package xrdp 0.9.17-2ubuntu3 failed to install/upgrade: installed xrdp 
package post-installation script subprocess returned error exit status 1
  UpgradeStatus: No upgrade log present (probably fresh install)
  mtime.conffile..etc.xrdp.sesman.ini: 2022-05-05T23:10:13.436962
  mtime.conffile..etc.xrdp.xrdp.ini: 2022-05-05T23:10:13.428962

** Changed in: xrdp (Ubuntu Jammy)
     Assignee: (unassigned) => Seyeong Kim (seyeongkim)

** Changed in: xrdp (Ubuntu Resolute)
     Assignee: (unassigned) => Seyeong Kim (seyeongkim)

** Changed in: xrdp (Ubuntu Noble)
     Assignee: (unassigned) => Seyeong Kim (seyeongkim)

** Changed in: xrdp (Ubuntu Jammy)
       Status: New => In Progress

** Changed in: xrdp (Ubuntu Noble)
       Status: New => In Progress

** Changed in: xrdp (Ubuntu Resolute)
       Status: New => In Progress

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2114620

Title:
  package xrdp 0.9.17-2ubuntu3 failed to install/upgrade: installed xrdp
  package post-installation script subprocess returned error exit status
  1

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/2114620/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to