NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55815: tar opens device files




> On Jun 5, 2021, at 10:30 AM, Jason Thorpe <thorpej%me.com@localhost> wrote:
> 
> Sorry, I was looking at your example of:
> 
> 	fd =3D open(...);
> 	fstat(...);
> 	if (device)
> 		bail;
> 
> What's the point if stat'ing the path if opening with O_REGULAR fails?  =
> Isn't the point here to prevent tar from opening device files?
> 
> -- thorpej
> 

That has no issue. The problem is that if it is a device you need a separate
stat(2). But even if we solve that, we still need to really open the file to get
extended attributes (ACLs). There is always the dump(8) solution (go under
the hood) :-)

christos

Attachment: signature.asc
Description: Message signed with OpenPGP



Home | Main Index | Thread Index | Old Index