]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Return EINVAL when the user tries to create a FIFO under afs,
authorNickolai Zeldovich <kolya@mit.edu>
Thu, 14 Nov 2002 20:39:56 +0000 (20:39 +0000)
committerGarry Zacheiss <zacheiss@mit.edu>
Thu, 14 Nov 2002 20:39:56 +0000 (20:39 +0000)
instead of silently creating a regular file.

(cherry picked from commit 74ad450bc202101b99923e18828073ee7208320c)

src/afs/LINUX/osi_vfs.hin
src/afs/VNOPS/afs_vnop_create.c

index ee0588b91c53bac5261be8227a7ec47051f73885..90a572c1719bd8da8c9aa1ed253af43af65cbb95 100644 (file)
@@ -44,6 +44,7 @@ typedef struct vnode vnode_t;
 #define VCHR S_IFCHR
 #define VLNK S_IFLNK
 #define VSOCK S_IFSOCK
+#define VFIFO S_IFIFO
 
 /* vcexcl - used only by afs_create */
 enum vcexcl { EXCL, NONEXCL } ;
index 3a61d8ea82da875a02d54e5d744342b2608b7c10..dc97a69cddd554b38d194039ecbd5e321e5a9ef4 100644 (file)
@@ -106,14 +106,18 @@ afs_create(OSI_VC_ARG(adp), aname, attrs, aexcl, amode, avcp, acred)
        code = EINVAL;
        goto done;
     }
-#if    defined(AFS_SUN5_ENV)
-    if ((attrs->va_type == VBLK) || (attrs->va_type == VCHR)) {
-#else
-    if ((attrs->va_type == VBLK) || (attrs->va_type == VCHR) || (attrs->va_type == VSOCK)) {
+    switch (attrs->va_type) {
+    case VBLK:
+    case VCHR:
+#if    !defined(AFS_SUN5_ENV)
+    case VSOCK:
 #endif
-       /* We don't support special devices */
+    case VFIFO:
+       /* We don't support special devices or FIFOs */
        code = EINVAL;          
        goto done;
+    default:
+       ;
     }
     code = afs_EvalFakeStat(&adp, &fakestate, &treq);
     if (code) goto done;