From: Nickolai Zeldovich Date: Wed, 2 Oct 2002 01:48:51 +0000 (+0000) Subject: Return EINVAL when the user tries to create a FIFO under afs, X-Git-Tag: openafs-devel-1_3_50~588 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=74ad450bc202101b99923e18828073ee7208320c;p=packages%2Fo%2Fopenafs.git Return EINVAL when the user tries to create a FIFO under afs, instead of silently creating a regular file. --- diff --git a/src/afs/LINUX/osi_vfs.hin b/src/afs/LINUX/osi_vfs.hin index 55a14f659..2ed66a508 100644 --- a/src/afs/LINUX/osi_vfs.hin +++ b/src/afs/LINUX/osi_vfs.hin @@ -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 } ; diff --git a/src/afs/VNOPS/afs_vnop_create.c b/src/afs/VNOPS/afs_vnop_create.c index c4ae09377..e3e90a3f7 100644 --- a/src/afs/VNOPS/afs_vnop_create.c +++ b/src/afs/VNOPS/afs_vnop_create.c @@ -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;