Bug 36716 - Remotely mounted USB drives are not cleaned up properly
Remotely mounted USB drives are not cleaned up properly
Status: CLOSED WORKSFORME
Product: Z_Univention Corporate Client (UCC)
Classification: Unclassified
Component: Terminal services
UCC 1.0
Other Linux
: P5 normal
: ---
Assigned To: UCC maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-11-14 16:51 CET by Michael Grandjean
Modified: 2023-06-28 10:33 CEST (History)
2 users (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?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
sdb still visible although USB pendrive was removed (23.04 KB, image/png)
2014-11-14 16:53 CET, Michael Grandjean
Details
Patch - workaround for customer (826 bytes, patch)
2014-11-14 17:09 CET, Michael Grandjean
Details | Diff

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:00 CET
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 Michael Grandjean univentionstaff 2014-11-14 16:53:16 CET
Created attachment 6378 [details]
sdb still visible although USB pendrive was removed
Comment 2 Erik Damrose univentionstaff 2014-11-14 16:56:18 CET
Please add your patch to the script as an attachment to this bug
Comment 3 Michael Grandjean univentionstaff 2014-11-14 17:09:31 CET
Created attachment 6379 [details]
Patch - workaround for customer
Comment 4 Moritz Muehlenhoff univentionstaff 2014-12-05 12:34:14 CET
This won't be backported to UCC 1.0.