]> 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>
Wed, 2 Oct 2002 01:48:51 +0000 (01:48 +0000)
committerNickolai Zeldovich <kolya@mit.edu>
Wed, 2 Oct 2002 01:48:51 +0000 (01:48 +0000)
instead of silently creating a regular file.

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

index 55a14f659221071cdc1ff35a0fadf05fa56628c6..2ed66a508bde64259746510dd4f1b083980f2d87 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 c4ae09377e4a257aebed990c8eabb63b242b2b3e..e3e90a3f7abad4b71ce93d6c48cb838804e9905f 100644 (file)
@@ -99,14 +99,18 @@ int afs_create(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, enum vcexcl a
        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;