Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libperfuse Catch open without FREAD|FWRITE (it should no...



details:   https://anonhg.NetBSD.org/src/rev/c85affea7041
branches:  trunk
changeset: 788768:c85affea7041
user:      manu <manu%NetBSD.org@localhost>
date:      Fri Jul 19 07:32:35 2013 +0000

description:
Catch open without FREAD|FWRITE (it should not happen)

diffstat:

 lib/libperfuse/ops.c |  6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diffs (20 lines):

diff -r 49c90ea0e692 -r c85affea7041 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Fri Jul 19 06:43:20 2013 +0000
+++ b/lib/libperfuse/ops.c      Fri Jul 19 07:32:35 2013 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.61 2013/07/18 09:01:20 manu Exp $ */
+/*  $NetBSD: ops.c,v 1.62 2013/07/19 07:32:35 manu Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -1391,6 +1391,10 @@
                if (pnd->pnd_flags & PND_RFH)
                        mode &= ~FREAD;
                break;
+       default:
+               DWARNX("open without either FREAD nor FWRITE");
+               error = EPERM;
+               goto out;
        }
        
        /*



Home | Main Index | Thread Index | Old Index