permissions and the flags include O_TRUNC|O_SHLOCK.
ok deraadt@
-/* $OpenBSD: vfs_syscalls.c,v 1.298 2018/07/30 15:16:27 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.299 2018/07/30 17:21:37 anton Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
if (localtrunc) {
if ((fp->f_flag & FWRITE) == 0)
error = EACCES;
- else if (vp->v_mount->mnt_flag & MNT_RDONLY)
+ else if (vp->v_mount && (vp->v_mount->mnt_flag & MNT_RDONLY))
error = EROFS;
else if (vp->v_type == VDIR)
error = EISDIR;