NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/55815: tar opens device files
The following reply was made to PR bin/55815; it has been noted by GNATS.
From: Christos Zoulas <christos%zoulas.com@localhost>
To: Jason Thorpe <thorpej%me.com@localhost>
Cc: gnats-bugs%netbsd.org@localhost,
gnats-admin%netbsd.org@localhost,
netbsd-bugs%netbsd.org@localhost,
"martin%netbsd.org@localhost" <martin%NetBSD.org@localhost>
Subject: Re: bin/55815: tar opens device files
Date: Sat, 5 Jun 2021 10:18:11 -0400
--Apple-Mail=_C26A2F85-84A1-4D72-9B09-A7FC762DBF12
Content-Type: multipart/alternative;
boundary="Apple-Mail=_E9450DEF-2453-4F17-A8CE-22FF42309949"
--Apple-Mail=_E9450DEF-2453-4F17-A8CE-22FF42309949
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=utf-8
>=20
> If we=E2=80=99re talking about =E2=80=9Censure the file we=E2=80=99re =
opening is a regular file=E2=80=9D, won=E2=80=99t O_REGULAR do that you =
want?
Yes, but that suffers from TOCTOA too:
if (open(path, O_REGULAR) =3D=3D -1)
fstat(path, &st);
But that's probably good enough.
christos
--Apple-Mail=_E9450DEF-2453-4F17-A8CE-22FF42309949
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=utf-8
<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;" class=3D""><br =
class=3D""><div><blockquote type=3D"cite" class=3D""><div class=3D""><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;" class=3D""><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: =
12px; font-style: normal; font-variant-caps: normal; font-weight: =
normal; letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;" class=3D"">If we=E2=80=99re talking about =
=E2=80=9Censure the file we=E2=80=99re opening is a regular file=E2=80=9D,=
won=E2=80=99t O_REGULAR do that you want?</span><br style=3D"caret-color:=
rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: =
normal; font-variant-caps: normal; font-weight: normal; letter-spacing: =
normal; text-align: start; text-indent: 0px; text-transform: none; =
white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none;" class=3D""></div></blockquote><br =
class=3D""></div><div>Yes, but that suffers from TOCTOA =
too:</div><div><br class=3D""></div><div>if (open(path, O_REGULAR) =3D=3D =
-1)</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</span>fstat(path, &st);</div><div><br class=3D""></div><div>But =
that's probably good enough.</div><div><br =
class=3D""></div><div>christos</div><br class=3D""></body></html>=
--Apple-Mail=_E9450DEF-2453-4F17-A8CE-22FF42309949--
--Apple-Mail=_C26A2F85-84A1-4D72-9B09-A7FC762DBF12
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP
-----BEGIN PGP SIGNATURE-----
Comment: GPGTools - http://gpgtools.org
iF0EARECAB0WIQS+BJlbqPkO0MDBdsRxESqxbLM7OgUCYLuHpAAKCRBxESqxbLM7
OrpqAJ432v6SryzMNwDsTgSbB38g62jMkACffT0kQjFwNnB4Ivb88g3Nv/u+3sE=
=ERwl
-----END PGP SIGNATURE-----
--Apple-Mail=_C26A2F85-84A1-4D72-9B09-A7FC762DBF12--
Home |
Main Index |
Thread Index |
Old Index