Branch: Tag:

2004-05-14

2004-05-14 21:42:47 by Martin Stjernholm <mast@lysator.liu.se>

Fixed several cases where the path to authenticated_user_id got
clobbered.

Rev: server/base_server/module.pike:1.211

1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2001, Roxen IS. - // $Id: module.pike,v 1.210 2004/05/14 21:18:04 mast Exp $ + // $Id: module.pike,v 1.211 2004/05/14 21:42:47 mast Exp $      #include <module_constants.h>   #include <module.h>
708:    TRACE_ENTER(sprintf("find_locks(%O, %O, %O, X)",    path, recursive, exclude_shared), this);    -  path = resource_id (path, id); +  string rsc = resource_id (path, id);       multiset(DAVLock) locks = (<>);    function(mapping(mixed:DAVLock):void) add_locks;
727:    locks |= mkmultiset (values (sub_locks));    };    -  if (file_locks[path]) { -  add_locks (file_locks[path]); +  if (file_locks[rsc]) { +  add_locks (file_locks[rsc]);    }       foreach(prefix_locks;    string prefix; mapping(mixed:DAVLock) sub_locks) { -  if (has_prefix(path, prefix)) { +  if (has_prefix(rsc, prefix)) {    add_locks (sub_locks);    break;    }
741:       if (recursive) {    LOOP_OVER_BOTH (string prefix, mapping(mixed:DAVLock) sub_locks, { -  if (has_prefix(prefix, path)) { +  if (has_prefix(prefix, rsc)) {    add_locks (sub_locks);    }    });
820:    return 0;    }    +  mixed auth_user = authenticated_user_id (path, id);    path = resource_id (path, id);    -  mixed auth_user = authenticated_user_id (path, id); -  +     if (DAVLock lock =    file_locks[path] && file_locks[path][auth_user] ||    prefix_locks[path] && prefix_locks[path][auth_user]) {
920:    TRACE_ENTER(sprintf("register_lock(%O, lock(%O), X).", path, lock->locktoken),    this);    ASSERT_IF_DEBUG (lock->locktype == "DAV:write"); -  path = resource_id (path, id); +     mixed auth_user = authenticated_user_id (path, id); -  +  path = resource_id (path, id);    if (lock->recursive) {    if (prefix_locks[path]) {    prefix_locks[path][auth_user] = lock;