[newlib-cygwin/main] Cygwin: mknod: disable creating special files on NFS

Corinna Vinschen corinna@sourceware.org
Fri Aug 25 12:40:17 GMT 2023


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d085592daa5f89ccc9f5b86b2ca26199e7516d61

commit d085592daa5f89ccc9f5b86b2ca26199e7516d61
Author:     Corinna Vinschen <corinna@vinschen.de>
AuthorDate: Fri Aug 25 14:39:04 2023 +0200
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Fri Aug 25 14:39:04 2023 +0200

    Cygwin: mknod: disable creating special files on NFS
    
    This simply doesn't work (yet?) but leaves unusable files behind.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/syscalls.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index e4b3dd2f3c62..52b9c9a8be91 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -3294,6 +3294,12 @@ mknod (const char *path, mode_t mode, dev_t dev)
 	  __leave;
 	}
 
+      if (w32path.fs_is_nfs ())
+	{
+	  set_errno (EPERM);
+	  __leave;
+	}
+
       return mknod_worker (w32path, mode, major, minor);
     }
   __except (EFAULT)


More information about the Cygwin-cvs mailing list