Date: Mon, 12 Dec 2016 11:04:09 -0800 From: Devin Teske <dteske@freebsd.org> To: Bartek Rutkowski <robak@FreeBSD.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Devin Teske <dteske@FreeBSD.org> Subject: Re: svn commit: r309921 - head/bin/dd Message-ID: <D7B305BE-D0DE-4F76-B9AF-B03F2C33C928@freebsd.org> In-Reply-To: <201612121856.uBCIuePK077524@repo.freebsd.org> References: <201612121856.uBCIuePK077524@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <robak@FreeBSD.org> = 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 <pawel.biernacki@gmail.com> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?D7B305BE-D0DE-4F76-B9AF-B03F2C33C928>