Source-Changes-HG archive

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

[src/trunk]: src/sys/kern If the openat_10 hook is present and it returns suc...



details:   https://anonhg.NetBSD.org/src/rev/92a4ff3275af
branches:  trunk
changeset: 448569:92a4ff3275af
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Feb 05 09:34:38 2019 +0000

description:
If the openat_10 hook is present and it returns success, continue with
the rest of the syscall; don't return prematurely, as we'll report
success (return value 0) but won't have set up the fd.

diffstat:

 sys/kern/vfs_syscalls.c |  13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (36 lines):

diff -r 441ea907cab1 -r 92a4ff3275af sys/kern/vfs_syscalls.c
--- a/sys/kern/vfs_syscalls.c   Tue Feb 05 09:29:19 2019 +0000
+++ b/sys/kern/vfs_syscalls.c   Tue Feb 05 09:34:38 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls.c,v 1.522 2019/02/05 08:53:18 pgoyette Exp $      */
+/*     $NetBSD: vfs_syscalls.c,v 1.523 2019/02/05 09:34:38 pgoyette Exp $      */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.522 2019/02/05 08:53:18 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.523 2019/02/05 09:34:38 pgoyette Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_fileassoc.h"
@@ -1636,12 +1636,13 @@
 
        if (path == NULL) {
                MODULE_CALL_HOOK(vfs_openat_10_hook, (&pb), enosys(), error);
-               if (error != ENOSYS)
+               if (error != 0 && error != ENOSYS)
+                       return error;
+       } else {
+               error = pathbuf_copyin(path, &pb);
+               if (error)
                        return error;
        }
-       error = pathbuf_copyin(path, &pb);
-       if (error)
-               return error;
 
        pathstring = pathbuf_stringcopy_get(pb);
 



Home | Main Index | Thread Index | Old Index