have to check mode of descriptor being duped, not the new one
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 13 Nov 1989 02:14:51 +0000 (18:14 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Mon, 13 Nov 1989 02:14:51 +0000 (18:14 -0800)
SCCS-vsn: sys/kern/kern_descrip.c 7.7

usr/src/sys/kern/kern_descrip.c

index e932326..9f34a37 100644 (file)
@@ -14,7 +14,7 @@
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  *
- *     @(#)kern_descrip.c      7.6 (Berkeley) %G%
+ *     @(#)kern_descrip.c      7.7 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -455,7 +455,7 @@ fdopen(dev, mode, type)
         * but this entire driver is a real kludge anyway.
         */
        rwmode = mode & (FREAD|FWRITE);
         * but this entire driver is a real kludge anyway.
         */
        rwmode = mode & (FREAD|FWRITE);
-       if ((fp->f_flag & rwmode) != rwmode)
+       if ((wfp->f_flag & rwmode) != rwmode)
                return (EACCES);
        /* 
         * Dup the file descriptor. 
                return (EACCES);
        /* 
         * Dup the file descriptor.