Skip to content
  • Iain Lane's avatar
    Fix trashing on overlayfs · 1152d99d
    Iain Lane authored
    In order to determine whether to trash a file to the home directory, we
    compare its st_dev to our home directory's st_dev field.
    
    This is the wrong thing to do on overlayfs when deleting files, because
    st_dev contains the ID of the filesystem providing the file (which can
    be the lower or upper filesystem), but directories always return the ID
    of the overlayfs. Thus the comparison fails and we are unable to trash
    the file.
    
    Fix this by checking st_dev of the parent directory when we are deleting
    a file.
    
    Also adjust `test_trash_not_supported` for this - make its st_dev check
    look at the parent directory's `st_dev` rather than the temporary file's
    own.
    
    Fixes #1027.
    1152d99d