Roxen.git/
server/
modules/
filesystems/
filesystem.pike
Branch:
Tag:
Non-build tags
All tags
No tags
2004-05-14
2004-05-14 21:21:22 by Martin Stjernholm <mast@lysator.liu.se>
204529048a7bb0d811b5621cd9adccf98fb50b7e (
19
lines) (+
17
/-
2
)
[
Show
|
Annotate
]
Branch:
5.2
Added unlock_file with proper access checks.
Rev: server/modules/filesystems/filesystem.pike:1.145
7:
inherit "module"; inherit "socket";
-
constant cvs_version= "$Id: filesystem.pike,v 1.
144
2004/05/14
16
:
54
:22
anders
Exp $";
+
constant cvs_version= "$Id: filesystem.pike,v 1.
145
2004/05/14
21
:
21
:22
mast
Exp $";
constant thread_safe=1; #include <module.h>
410:
return 0; }
+
mapping(string:mixed) unlock_file(string path, DAVLock lock, RequestID|int(0..0) id)
+
{
+
if (!query("put")) return 0;
+
if(query("check_auth") && (!id || (!id->conf->authenticate( id ) )) ) {
+
TRACE_LEAVE("PUT: Permission denied");
+
return
+
// FIXME: Sane realm.
+
Roxen.http_auth_required("foo",
+
"<h1>Permission to 'PUT' files denied</h1>");
+
}
+
unregister_lock(path, lock, id);
+
return 0;
+
}
+
int dir_filter_function(string f, RequestID id) { if(f[0]=='.' && !dotfiles) return 0;
1327:
if(!code) {
-
SIMPLE_TRACE_LEAVE("MOVE: Move failed (
errno:
%
d
)", err_code);
+
SIMPLE_TRACE_LEAVE("MOVE: Move failed (%
s
)",
strerror (
err_code)
)
;
return errno_to_status (err_code, 1, id); } TRACE_LEAVE("MOVE: Success");