From owner-svn-src-all@freebsd.org Fri Feb 8 14:23:28 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABBB714E2252; Fri, 8 Feb 2019 14:23:28 +0000 (UTC) (envelope-from nashkaminski@gmail.com) Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4A684E5B; Fri, 8 Feb 2019 14:23:28 +0000 (UTC) (envelope-from nashkaminski@gmail.com) Received: by mail-wr1-x429.google.com with SMTP id r2so3721705wrv.10; Fri, 08 Feb 2019 06:23:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FeArLLQnqHCv2jkhvvfoCXeKFQLRa16+vbfK33WWZ28=; b=ZRdhp+DNdzOTW3EXDmfxYRgLpTQN8FMdkL65kVu/EiwAO+ILY1Ihz8wopvrUID3seK EvVb5DpGmDjQ0yuQ8q15s6A+iZfxLR75FOi21QQgIOnP3BG2eryl9MfsEEjTBb/zmuc0 O5ThxEnfGU6j2LvQsAhucexB5pws5Ll5mX/Xi9LLtm/i8RkjR7Dtghbf1wyaW764VkSm 7WuXnW5veTO9apuqBCi2qKtx5klM0UAvwuq+LFVFIDoA7SPEjsLPGOuA6kWXzvpmVdTR DduseOOGSDYSbLG4iYDSVxDRQ8S9AHUKdYju9ZQWpRjG9gscQrO0kuzKgfG9ekUojjOb BgWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FeArLLQnqHCv2jkhvvfoCXeKFQLRa16+vbfK33WWZ28=; b=KMTcim+/uCDpOtLDL15M1LvB2hgcNQ8h0EWW+0tC89hzqLeFR0CI4zRKEgUhpqi4IA k+g7SqaCvLH90AiocANhb/cZoXEILr5EfsyTi9njIf2roMakbJzrDoXvNjoCA6hY60Iu bxPN/gv5PH7dz2n+xjqVnnc8KbDxm0/QN4ndsakCQ0ScN8yNqkJke7cPMkNfjFsfsN+i Ve59grYr3rVzI2wdOPCyNrGDvuepu8QEUl4n23Fhw16D1KT0GxkTWyS/ZCo4Zzd24zVu Rux4qGrM9BB6Envsv04ryVIKySTwzX3r+L5PKRWVGx6cBLmiX1b3uWX0XvnLwzENEgtM sHMA== X-Gm-Message-State: AHQUAuZRg1lpuXVnmaDGDjCxF00XjSsMZ3nmUSI+Uy+4OWKn3wfa20op TLZFzO1oaaaSlzZ0L2SHhQ5wQmak0YRUFjR+b/+NfQ== X-Google-Smtp-Source: AHgI3Ia+UNJD7J0T294gSGVf91xQuuCtXkR8kd/WRFnAfaC2UNcfdrr6GG894ydC2SHlJEau6gYAYGnvO8XQyQbPBLk= X-Received: by 2002:adf:e284:: with SMTP id v4mr16285476wri.26.1549635806677; Fri, 08 Feb 2019 06:23:26 -0800 (PST) MIME-Version: 1.0 References: <201902080736.x187a8LM002846@repo.freebsd.org> <20190208132301.GA5715@stack.nl> In-Reply-To: <20190208132301.GA5715@stack.nl> From: Nash Kaminski Date: Fri, 8 Feb 2019 08:23:15 -0600 Message-ID: Subject: Re: svn commit: r343896 - head/sbin/dhclient To: Jilles Tjoelker Cc: Konstantin Belousov , Ryan Moeller , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 1E4A684E5B X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-0.99)[-0.992,0]; NEURAL_HAM_SHORT(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2019 14:23:29 -0000 I would be in favor of Jilles' implementation as well, since fundamentally dhclient just tests for zero/nonzero exit status and therefore what is critical is making sure such status is nonzero in *any* failure case of dhclient-script, including abnormal termination via signal. - Nash On Fri, Feb 8, 2019, 7:23 AM Jilles Tjoelker On Fri, Feb 08, 2019 at 07:36:08AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Fri Feb 8 07:36:08 2019 > > New Revision: 343896 > > URL: https://svnweb.freebsd.org/changeset/base/343896 > > > Log: > > Correctly return exit status from the exited process. > > > This is also OpenBSD rev. 1.117, as pointed out by > > Ryan Moeller . > > > Submitted by: Nash Kaminski > > MFC after: 1 week > > > Modified: > > head/sbin/dhclient/dhclient.c > > > Modified: head/sbin/dhclient/dhclient.c > > > ============================================================================== > > --- head/sbin/dhclient/dhclient.c Fri Feb 8 06:19:28 2019 > (r343895) > > +++ head/sbin/dhclient/dhclient.c Fri Feb 8 07:36:08 2019 > (r343896) > > @@ -2348,7 +2348,7 @@ priv_script_go(void) > > if (ip) > > script_flush_env(ip->client); > > > > - return (wstatus & 0xff); > > + return WEXITSTATUS(wstatus); > > } > > > > void > > This is probably a big improvement in practice, but it is still wrong if > the script exits on a signal. POSIX does not say what the WEXITSTATUS > macro returns in this case and in practice 0 is a common value. Perhaps > you want > > return WIFEXITED(wstatus) ? WEXITSTATUS(wstatus) : 128 + WTERMSIG(wstatus); > > imitating what the shell does to translate a wait status into 8 bits? > > -- > Jilles Tjoelker >