purging swtpm-tools leaves /var/lib/swtpm-localca dir behind

Bug #1950986 reported by Christian Ehrhardt 
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
swtpm (Ubuntu)
New
Undecided
Unassigned

Bug Description

$ sudo apt remove --purge swtpm-tools
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages will be REMOVED:
  swtpm-tools*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 271 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 144994 files and directories currently installed.)
Removing swtpm-tools (0.6.1-0ubuntu4) ...
Processing triggers for man-db (2.9.4-2build1) ...
(Reading database ... 144975 files and directories currently installed.)
Purging configuration files for swtpm-tools (0.6.1-0ubuntu4) ...

$ sudo ls -laF /var/lib/swtpm-localca
total 56
drwxr-x--- 2 tss root 4096 Nov 15 13:43 ./
drwxr-xr-x 49 root root 4096 Nov 15 13:52 ../
-rwxr-xr-x 1 tss tss 0 Nov 15 13:43 .lock.swtpm-localca*
-rw-r--r-- 1 tss tss 5531 Nov 15 13:43 01.pem
-rw-r--r-- 1 tss tss 1 Nov 15 13:43 certserial
-rw-r--r-- 1 tss tss 48 Nov 15 13:43 index.txt
-rw-r--r-- 1 tss tss 21 Nov 15 13:43 index.txt.attr
-rw-r--r-- 1 tss tss 0 Nov 15 13:43 index.txt.old
-rw-r--r-- 1 tss tss 5531 Nov 15 13:43 issuercert.pem
-rw-r--r-- 1 tss tss 3 Nov 15 13:43 serial
-rw-r--r-- 1 tss tss 3 Nov 15 13:43 serial.old
-rw-r----- 1 tss tss 2459 Nov 15 13:43 signkey.pem
-rw-r--r-- 1 tss tss 1468 Nov 15 13:43 swtpm-localca-rootca-cert.pem
-rw-r----- 1 tss tss 2455 Nov 15 13:43 swtpm-localca-rootca-privkey.pem

That combined with the -d /var/lib/swtpm-localca in postinst will make it never
reach the new form (owned by swtpm) unless an admin manually fixes it.

                if ! [ -d $SWTPM_LOCALCA_DIR ]; then
                        mkdir -p $SWTPM_LOCALCA_DIR
                        chown swtpm:root $SWTPM_LOCALCA_DIR
                        chmod 0750 $SWTPM_LOCALCA_DIR
                fi

I'm not entirely sure, but since purge is meant to remove all data as well I'd
suggest here it would make sense to remove the directory on purge - opinions?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.