From 98d5707ceb5147ac46c6e9b8a7ce3c92cbfb5dfb Mon Sep 17 00:00:00 2001 From: Pavel <68122101+red-prig@users.noreply.github.com> Date: Sun, 20 Jul 2025 20:09:18 +0300 Subject: [PATCH] + --- sys/vfs/vfs_syscalls.pas | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/sys/vfs/vfs_syscalls.pas b/sys/vfs/vfs_syscalls.pas index 8aa14053..d2aa2c17 100644 --- a/sys/vfs/vfs_syscalls.pas +++ b/sys/vfs/vfs_syscalls.pas @@ -1915,25 +1915,42 @@ begin hook(nd.ni_vp, @sb); end; end; + NDFREE(@nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); VFS_UNLOCK_GIANT(vfslocked); + if (error<>0) then begin Exit(error); end; + //error:=priv_check(td,683); + error:=EPERM; + if (error<>0) then + begin + sb.st_dev :=0; + sb.st_ino :=0; + sb.st_nlink :=0; + sb.st_uid :=0; + sb.st_gid :=0; + sb.st_rdev :=0; + sb.st_flags :=0; + sb.st_gen :=0; + sb.st_lspare:=0; + end; + sbp^:=sb; Exit(0); end; function kern_statat(flag,fd:Integer;path:PChar; - pathseg:uio_seg;sbp:p_stat):Integer; + pathseg:uio_seg;sbp:p_stat):Integer; inline; begin Exit(kern_statat_vnhook(flag, fd, path, pathseg, sbp, nil)); end; -function kern_stat(path:PChar;pathseg:uio_seg;sbp:p_stat):Integer; +function kern_stat(path:PChar;pathseg:uio_seg;sbp:p_stat):Integer; inline; begin Exit(kern_statat(0, AT_FDCWD, path, pathseg, sbp)); end;