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!

标签:Ubuntu

已有 3 条评论

  1. hello hello

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

  2. 咸鱼大佬新年快乐!

  3. Anonymous Anonymous

    你的博客有多久没更新了啊,看来真的是很咸鱼呀→U→
    莫非是有了个特别可爱的女票之类的?。。。(啊不对程序员怎么会有女朋友……

添加新评论