Module Name: src
Committed By: pgoyette
Date: Tue Feb 5 09:34:38 UTC 2019
Modified Files:
src/sys/kern: vfs_syscalls.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.522 -r1.523 src/sys/kern/vfs_syscalls.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/vfs_syscalls.c
diff -u src/sys/kern/vfs_syscalls.c:1.522 src/sys/kern/vfs_syscalls.c:1.523
--- src/sys/kern/vfs_syscalls.c:1.522 Tue Feb 5 08:53:18 2019
+++ src/sys/kern/vfs_syscalls.c Tue Feb 5 09:34:38 2019
@@ -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 @@ do_sys_openat(lwp_t *l, int fdat, const
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);