Module Name: src Committed By: martin Date: Fri Jun 11 12:54:23 UTC 2021
Modified Files: src/sys/kern: kern_exec.c Log Message: Fix the order of handling of posix_spawn attributes and file actions. The standard is explicit about it and it matters if e.g. RESETIDS is used as an attribute and file actions depend on the group rights for opening a file. To generate a diff of this commit: cvs rdiff -u -r1.505 -r1.506 src/sys/kern/kern_exec.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/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.505 src/sys/kern/kern_exec.c:1.506 --- src/sys/kern/kern_exec.c:1.505 Sun May 2 10:23:55 2021 +++ src/sys/kern/kern_exec.c Fri Jun 11 12:54:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.505 2021/05/02 10:23:55 martin Exp $ */ +/* $NetBSD: kern_exec.c,v 1.506 2021/06/11 12:54:22 martin Exp $ */ /*- * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.505 2021/05/02 10:23:55 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.506 2021/06/11 12:54:22 martin Exp $"); #include "opt_exec.h" #include "opt_execfmt.h" @@ -2260,13 +2260,13 @@ spawn_return(void *arg) rw_enter(&p->p_reflock, RW_WRITER); have_reflock = true; - /* handle posix_spawn_file_actions */ - error = handle_posix_spawn_file_actions(spawn_data->sed_actions); + /* handle posix_spawnattr */ + error = handle_posix_spawn_attrs(attrs, spawn_data->sed_parent); if (error) goto report_error; - /* handle posix_spawnattr */ - error = handle_posix_spawn_attrs(attrs, spawn_data->sed_parent); + /* handle posix_spawn_file_actions */ + error = handle_posix_spawn_file_actions(spawn_data->sed_actions); if (error) goto report_error;