Fix Ubuntu can't move file to trash on symlink partition

Post on: Category: 个人作品Tag: Ubuntu 2 Comments

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!

  1. hello hello March 15th, 2016 at 16:33

    你的博客有多久没更新了啊,看来真的是很忙啊

  2. liwanglin12 liwanglin12 January 27th, 2017 at 20:26

    咸鱼大佬新年快乐!

Reply:
Return Top