Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/external/bsd/dhcpcd/dist/src/script.c,v rcsdiff: /ftp/cvs/cvsroot/src/external/bsd/dhcpcd/dist/src/script.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.1.1.15 retrieving revision 1.1.1.16 diff -u -p -r1.1.1.15 -r1.1.1.16 --- src/external/bsd/dhcpcd/dist/src/script.c 2020/04/13 15:42:21 1.1.1.15 +++ src/external/bsd/dhcpcd/dist/src/script.c 2020/05/31 12:50:47 1.1.1.16 @@ -108,6 +108,8 @@ script_exec(char *const *argv, char *con posix_spawnattr_setsigmask(&attr, &defsigs); for (i = 0; i < dhcpcd_signals_len; i++) sigaddset(&defsigs, dhcpcd_signals[i]); + for (i = 0; i < dhcpcd_signals_ignore_len; i++) + sigaddset(&defsigs, dhcpcd_signals_ignore[i]); posix_spawnattr_setsigdefault(&attr, &defsigs); #endif errno = 0; @@ -250,8 +252,10 @@ make_env(struct dhcpcd_ctx *ctx, const s fp = NULL; tmpfd = mkstemp(tmpfile); - if (tmpfd == -1) - goto eexit; + if (tmpfd == -1) { + logerr("%s: mkstemp", __func__); + return -1; + } unlink(tmpfile); fp = fdopen(tmpfd, "w+"); if (fp == NULL) { @@ -689,7 +693,7 @@ script_runreason(const struct interface int status = 0; struct fd_list *fd; - if (ifp->options->script == NULL && + if (ctx->script == NULL && TAILQ_FIRST(&ifp->ctx->control_fds) == NULL) return 0; @@ -699,23 +703,23 @@ script_runreason(const struct interface return -1; } - if (ifp->options->script == NULL) + if (ctx->script == NULL) goto send_listeners; - argv[0] = ifp->options->script; + argv[0] = ctx->script; argv[1] = NULL; logdebugx("%s: executing `%s' %s", ifp->name, argv[0], reason); #ifdef PRIVSEP if (ctx->options & DHCPCD_PRIVSEP) { - if (ps_root_script(ifp, + if (ps_root_script(ctx, ctx->script_buf, ctx->script_buflen) == -1) logerr(__func__); goto send_listeners; } #endif - status = script_run(ctx, argv); + script_run(ctx, argv); send_listeners: /* Send to our listeners */ @@ -732,23 +736,3 @@ send_listeners: return status; } - -#ifdef PRIVSEP -int -script_runchroot(struct dhcpcd_ctx *ctx, char *script) -{ - char *argv[2]; - - /* Make our env */ - if (make_env(ctx, NULL, "CHROOT") == -1) { - logerr(__func__); - return -1; - } - - argv[0] = script; - argv[1] = NULL; - logdebugx("executing `%s' %s", argv[0], "CHROOT"); - - return script_run(ctx, argv); -} -#endif