use vfs_stat instead of stat in send_cgi

Fri, 31 Oct 2025 21:15:19 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Fri, 31 Oct 2025 21:15:19 +0100
changeset 618
e42a8de6d66f
parent 617
01228719b3ce
child 619
4e2bac64c950

use vfs_stat instead of stat in send_cgi

src/server/safs/cgi.c file | annotate | diff | comparison | revisions
--- a/src/server/safs/cgi.c	Thu Oct 30 16:59:31 2025 +0100
+++ b/src/server/safs/cgi.c	Fri Oct 31 21:15:19 2025 +0100
@@ -77,14 +77,15 @@
         }
     }
     
-    // using stat, not vfs_stat, because running scripts/executables works only
-    // with the sys fs
+    // running scripts/executables only works with the sys fs
+    // however we still use vfs_stat to run ACL checks
     if(!vfs_is_sys(rq->vfs)) {
         log_ereport(LOG_WARN, "send-cgi: VFS setting ignored");
     }
     
+    VFSContext *vfs = vfs_request_context(sn, rq);
     struct stat s;
-    if(stat(path, &s)) {
+    if(vfs_stat(vfs, path, &s)) {
         int statuscode = util_errno2status(errno);
         protocol_status(sn, rq, statuscode, NULL);
         return REQ_ABORTED;

mercurial