Fix Ubuntu can't move file to trash on symlink partition
Since 2015-04-23, Ubuntu applied a patch that try to fix trash on live CD, but it also introduces another bug.
In the patch, it will use the
stat from parent directory if the target isn't directory. The next code will try to find trash by
stat, and move the file into the trash. It's should work in most of case.
But think about this situation, If I made a symlink to folder on another partition, the file directly inside this folder and the symlink file of parent are not on the same partition. So the latter call to
g_rename will fail by crossed device.
This bug was existed on Launchpad for a long time, but still not be fixed. So I made a binary patch to fix it, you can get it on GitHub Gist. Just save it as script file, set the execute bit, and run. I hope my patch will help you!
已有 3 条评论