src/server/safs/cgi.c

changeset 618
e42a8de6d66f
parent 617
01228719b3ce
child 621
956c03c25edd
equal deleted inserted replaced
617:01228719b3ce 618:e42a8de6d66f
75 protocol_status(sn, rq, 400, NULL); 75 protocol_status(sn, rq, 400, NULL);
76 return REQ_ABORTED; 76 return REQ_ABORTED;
77 } 77 }
78 } 78 }
79 79
80 // using stat, not vfs_stat, because running scripts/executables works only 80 // running scripts/executables only works with the sys fs
81 // with the sys fs 81 // however we still use vfs_stat to run ACL checks
82 if(!vfs_is_sys(rq->vfs)) { 82 if(!vfs_is_sys(rq->vfs)) {
83 log_ereport(LOG_WARN, "send-cgi: VFS setting ignored"); 83 log_ereport(LOG_WARN, "send-cgi: VFS setting ignored");
84 } 84 }
85 85
86 VFSContext *vfs = vfs_request_context(sn, rq);
86 struct stat s; 87 struct stat s;
87 if(stat(path, &s)) { 88 if(vfs_stat(vfs, path, &s)) {
88 int statuscode = util_errno2status(errno); 89 int statuscode = util_errno2status(errno);
89 protocol_status(sn, rq, statuscode, NULL); 90 protocol_status(sn, rq, statuscode, NULL);
90 return REQ_ABORTED; 91 return REQ_ABORTED;
91 } 92 }
92 if(S_ISDIR(s.st_mode)) { 93 if(S_ISDIR(s.st_mode)) {

mercurial