src/server/webdav/webdav.c

changeset 56
c6cf20b09043
parent 51
b28cf69f42e8
child 58
66c22e54aa90
--- a/src/server/webdav/webdav.c	Sun Mar 17 12:47:59 2013 +0100
+++ b/src/server/webdav/webdav.c	Sun Mar 17 17:54:20 2013 +0100
@@ -36,6 +36,7 @@
 #include "../util/pblock.h"
 #include "../util/date.h"
 
+#include "../daemon/vfs.h"
 #include "../daemon/protocol.h"
 
 #include "davparser.h"
@@ -158,12 +159,12 @@
 int webdav_mkcol(pblock *pb, Session *sn, Request *rq) {
     char *ppath = pblock_findkeyval(pb_key_ppath, rq->vars);
     
-    int status = 201;
-    if(mkdir(ppath, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH) != 0) {
-        status = 403;
+    VFSContext *vfs = vfs_request_context(sn, rq);
+    if(vfs_mkdir(vfs, ppath)) {
+        return REQ_ABORTED;
     }
     
-    protocol_status(sn, rq, status, NULL);
+    protocol_status(sn, rq, 201, NULL);
     pblock_removekey(pb_key_content_type, rq->srvhdrs);
     pblock_nninsert("content-length", 0, rq->srvhdrs);
     http_start_response(sn, rq);

mercurial