Branch: Tag:

2018-03-29

2018-03-29 09:22:49 by Karl Gustav Sterneberg <kg@roxen.com>

Filesystem [WebDAV]: Fixed move for case insensitive fs.

1474:    }    TRACE_LEAVE("Overwrite allowed.");    if (overwrite || (size > -1)) { +  Stdio.Stat src_st = stat_file(f, id); +  Stdio.Stat dst_st = stat_file(new_uri, id); +  // Check that src and dst refers to different inodes. +  // Needed on case insensitive filesystems. +  if (src_st->mode != dst_st->mode || +  src_st->size != dst_st->size || +  src_st->ino != dst_st->ino || +  src_st->dev != dst_st->dev) {    TRACE_ENTER(sprintf("Deleting destination: %O...\n", new_uri), 0);    mapping(string:mixed) res = recurse_delete_files(new_uri, id);    if (res && (!sizeof (res) || res->error >= 300)) {
1485:    return ([]);    }    TRACE_LEAVE("Recursive delete ok."); +  }    } else {    privs = 0;    TRACE_LEAVE("MOVE: Cannot overwrite directory");