Improperly handled symlinks almost made me delete my root file system :)))
So, I have some Wine prefixes. Wine creates a directory called dosdevices
.
Here is what one looks like (locally):
total 40
lrwxrwxrwx 1 raingloom raingloom 8 Jan 22 20:29 a:: -> /dev/fd0
lrwxrwxrwx 1 raingloom raingloom 10 Jan 22 20:48 com1 -> /dev/ttyS0
lrwxrwxrwx 1 raingloom raingloom 10 Jan 22 20:48 com2 -> /dev/ttyS1
lrwxrwxrwx 1 raingloom raingloom 10 Jan 22 20:48 com3 -> /dev/ttyS2
lrwxrwxrwx 1 raingloom raingloom 10 Jan 22 20:48 com4 -> /dev/ttyS3
lrwxrwxrwx 1 raingloom raingloom 10 Jan 22 20:29 c: -> ../drive_c
lrwxrwxrwx 1 raingloom raingloom 29 Jan 22 20:29 d: -> /run/media/raingloom/Flatout2
lrwxrwxrwx 1 raingloom raingloom 8 Jan 22 20:29 d:: -> /dev/sr0
lrwxrwxrwx 1 raingloom raingloom 8 Jan 22 20:48 lpt1 -> /dev/lp0
lrwxrwxrwx 1 raingloom raingloom 1 Jan 22 20:29 z: -> /
Here is another one, mounted via GVFS/SFTP:
ls: cannot access 'com1': Input/output error
ls: cannot access 'com2': Input/output error
ls: cannot access 'com3': Input/output error
ls: cannot access 'com4': Input/output error
total 1
?????????? ? ? ? ? ? com1
?????????? ? ? ? ? ? com2
?????????? ? ? ? ? ? com3
?????????? ? ? ? ? ? com4
drwxr-xr-x 1 raingloom raingloom 78 Mar 3 2018 c:
drwxr-xr-x 1 raingloom raingloom 194 Dec 31 04:11 z:
Now, I don't know if this is a bug in GVFS or in SFTP but when someone runs rm -r
on a dosdevices
directory, they start getting permission errors because For SOME REASON rm
started removing /var
. Well, the reason is the above. That's not a symlink, it doesn't show up as a different file system, it's not a hardlink either.
This is a pretty fricking serious bug so I suggest disabling symlinks until this is fixed. This can lead to major data loss.