Re: [dev] [sbase] [PATCH 1/4] tar: Don't crash when get{pw,gr}uid fails

From: <random832_AT_fastmail.us>
Date: Sat, 01 Nov 2014 18:16:17 -0400

On Sat, Nov 1, 2014, at 16:57, Dimitris Papastamos wrote:
> On Sat, Nov 01, 2014 at 08:36:37PM +0000, Michael Forney wrote:
> > - snprintf(h->uname, sizeof h->uname, "%s", pw->pw_name);
> > - snprintf(h->gname, sizeof h->gname, "%s", gr->gr_name);
> > + snprintf(h->uname, sizeof h->uname, "%s", pw ? pw->pw_name : "");
> > + snprintf(h->gname, sizeof h->gname, "%s", gr ? gr->gr_name : "");
>
> The patches look good, thanks!
>
> Just a small clarification on this one, do other tar implementations
> do the same here?

Yes. I looked at heirloom (both tar and cpio), 4.4BSD pax, GNU tar, and
star. Heirloom prints an error, none of the rest do, and all seem to put
in an empty string (or do nothing and the field is initialized earlier
with null bytes).
Received on Sat Nov 01 2014 - 23:16:17 CET

This archive was generated by hypermail 2.3.0 : Sat Nov 01 2014 - 23:24:08 CET