Roxen.git / server / base_server / configuration.pike

version» Context lines:

Roxen.git/server/base_server/configuration.pike:1843:    return 0;    }    }       // path = id->not_query;    if (!has_suffix(path, "/")) path += "/";    mapping(string:mixed) ret =    Roxen.http_dav_error(Protocols.HTTP.DAV_LOCKED, "lock-token-submitted");    foreach(locks;;DAVLock lock) {    TRACE_ENTER(sprintf("Checking lock %O against %O.", lock, path), 0); -  if (has_prefix(path, lock->path)) { +  // NB: We can't perform a string comparison here, as we don't +  // know whether the path is case-sensitive or not. But as +  // we know that all lock paths are on the path to or through +  // `path`, a comparison of the string lengths is sufficient. +  if (sizeof(lock->path) <= sizeof(path)) {    TRACE_LEAVE("Direct lock.");    TRACE_LEAVE("Locked.");    return ret;    }    if (lock->is_file) {    id->set_status_for_path(lock->path[..<1], ret);    } else {    id->set_status_for_path(lock->path, ret);    }    TRACE_LEAVE("Added to multi status.");