Bug 36717 - Remotely mounted USB drives are not cleaned up properly
Remotely mounted USB drives are not cleaned up properly
Status: CLOSED FIXED
Product: Univention Corporate Client (UCC)
Classification: Unclassified
Component: Terminal services
UCC 2.0
Other Linux
: P5 normal
: UCC 2.0-errata
Assigned To: Moritz Muehlenhoff
Erik Damrose
:
Depends on:
Blocks: 37202
  Show dependency treegraph
 
Reported: 2014-11-14 16:51 CET by Michael Grandjean
Modified: 2014-12-08 12:47 CET (History)
1 user (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2014-11-14 16:51:41 CET
This also applies to UCC 2.0

+++ This bug was initially created as a clone of Bug #36716 +++

When plugging in a USB pendrive the partitions are mounted to /run/drives and then shown in drive Z: in the remote session:

> root@ucc-veriton:~# ls -l /run/drives/
> insgesamt 4
> drwxr-xr-x 2 root root   40 Nov 14 16:27 usbdisk-sdb
> drwxrwxrwx 1 root root 4096 Nov 14 16:27 usbdisk-sdb1

If one unplugs the USB pendrive, sdb1 is removed, but sdb is not:

root@ucc-veriton:~# ls -l /run/drives/
insgesamt 0
drwxr-xr-x 2 root root 40 Nov 14 16:27 usbdisk-sdb

Thus, sdb is also still visible in the remote session, although the pendrive is not available anymore (see attached screenshot).

I don't see the necessity to mount sdb in the first place: it's always empty and the needed data partitions are always followed by a digit (e.g. sdb1). 

For a customer I adapted the blacklisting for ram and loop devices to also blacklist exact matches of 'sda', 'sdb', 'sdc' ... (Ticket#2014110321000159)

I have seen this in Citrix XenApp sessions where sdb doesn't seem to disappear at all and in RDP sessions, where sdb disappeared after a couple if minutes. 
I used at least two different USB pen drives and different combinations of fat32, ntfs, formatted with gparted and formatted with windows.
Comment 1 Moritz Muehlenhoff univentionstaff 2014-12-05 12:30:19 CET
This has been fixed in univention-ucc-remote-mount. 

Since there might be rare cases where the old behaviour might be desired, I added the UCR variable ucc/mount/fullpartition; if it is set to "true" the old behaviour is kept.
Comment 2 Moritz Muehlenhoff univentionstaff 2014-12-05 12:31:22 CET
YAML file: 2014-12-05-univention-ucc-remote-mount.yaml
Comment 3 Erik Damrose univentionstaff 2014-12-05 17:01:37 CET
Verified
Comment 4 Moritz Muehlenhoff univentionstaff 2014-12-08 12:47:23 CET
http://errata.univention.de/ucc/2.0/7.html