Rdesktop crashes when removing USB key with LTSP

Bug #389614 reported by Jean-Michel Dault
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
rdesktop (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: rdesktop

- This bug has been heavily tested with 1.6.0-2ubuntu1 on Intrepid i386, but the package hasn't changed in Jaunty or Karmic.

When using LTSP in rdesktop mode, with rdesktop -r disk:disk=/media/root/ and as USB drive, it's possible to make rdesktop segfault under certain circumstances.

How to duplicate:
- Login to rdesktop
- Insert USB key
- Go to "My computer" or equivalent, go to "disk on <terminal>", and click on the directory containing the USB drive
- Press F5 until you see the files on the USB drive.
- Now, leave F5 pressed (it will refresh the file list continuously) and disconnect the USB drive. You will get a segfault.

The problem is in disk.c. Rdesktop does a "rewinddir(pdir)". Between the USB disconnect and the umounting of the directory, there is a state of uncertainty where pdir=0. Doing a rewinddir(0) causes a segfault.

If you add a simple condition, it fixes the problem.
                               if(pdir==0)
                                       return RD_STATUS_NO_SUCH_FILE;

Revision history for this message
Jean-Michel Dault (jmdault) wrote :

Patch included

Changed in rdesktop (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Jean-Michel,

The patch looks wrong as it no longer calls rewinddir() if pdir is non-zero.

Could you report this bug in the upstream project?
http://sourceforge.net/tracker/?group_id=24366&atid=381347

Thanks

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.