From owner-svn-src-all@freebsd.org Mon Dec 12 19:04:11 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06BE8C72E75; Mon, 12 Dec 2016 19:04:11 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED90E15F0; Mon, 12 Dec 2016 19:04:10 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=60292 helo=[10.0.0.102]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1cGVL6-000PBn-9i; Mon, 12 Dec 2016 18:28:40 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r309921 - head/bin/dd From: Devin Teske In-Reply-To: <201612121856.uBCIuePK077524@repo.freebsd.org> Date: Mon, 12 Dec 2016 11:04:09 -0800 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske Content-Transfer-Encoding: quoted-printable Message-Id: References: <201612121856.uBCIuePK077524@repo.freebsd.org> To: Bartek Rutkowski X-Mailer: Apple Mail (2.2104) Sender: devin@shxd.cx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Mon, 12 Dec 2016 19:04:11 -0000 Yay! =46rom someone whom has tried 2>&- >&- on a dd run to be surprised to = find the status information go into the destination output file... Thank you! > On Dec 12, 2016, at 10:56 AM, Bartek Rutkowski = wrote: >=20 > Author: robak (ports committer) > Date: Mon Dec 12 18:56:40 2016 > New Revision: 309921 > URL: https://svnweb.freebsd.org/changeset/base/309921 >=20 > Log: > Fix regression when stdin/out/err fds are are overridden by shell. >=20 > Submitted by: Pawel Biernacki > Reported by: ngie > Approved by: ngie > Sponsored by: Mysterious Code Ltd. > Differential Revision: https://reviews.freebsd.org/D8543 >=20 > Modified: > head/bin/dd/dd.c >=20 > Modified: head/bin/dd/dd.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/bin/dd/dd.c Mon Dec 12 18:55:41 2016 (r309920) > +++ head/bin/dd/dd.c Mon Dec 12 18:56:40 2016 (r309921) > @@ -142,8 +142,6 @@ setup(void) > in.fd =3D open(in.name, O_RDONLY, 0); > if (in.fd =3D=3D -1) > err(1, "%s", in.name); > - if (caph_limit_stdin() =3D=3D -1) > - err(1, "unable to limit capability rights"); > } >=20 > getfdtype(&in); > @@ -176,8 +174,6 @@ setup(void) > } > if (out.fd =3D=3D -1) > err(1, "%s", out.name); > - if (caph_limit_stdout() =3D=3D -1) > - err(1, "unable to limit capability rights"); > } >=20 > getfdtype(&out); > @@ -188,6 +184,16 @@ setup(void) > errno !=3D ENOSYS) > err(1, "unable to limit capability rights"); >=20 > + if (in.fd !=3D STDIN_FILENO && out.fd !=3D STDIN_FILENO) { > + if (caph_limit_stdin() =3D=3D -1) > + err(1, "unable to limit capability rights"); > + } > + > + if (in.fd !=3D STDOUT_FILENO && out.fd !=3D STDOUT_FILENO) { > + if (caph_limit_stdout() =3D=3D -1) > + err(1, "unable to limit capability rights"); > + } > + > if (in.fd !=3D STDERR_FILENO && out.fd !=3D STDERR_FILENO) { > if (caph_limit_stderr() =3D=3D -1) > err(1, "unable to limit capability rights"); >=20