This revision fixes the resource leak and possible buffer overflow due to incorrect
sizeof(buf) argument passed to extattr_set_{file/fd/link}. Approach is to set the
extended attribute authorname to NULL and pass the size_t nbytes argument as 0.
CID List:
CID 1393489
CID 1393501
CID 1393509
CID 1393510
CID 1393514
CID 1393515
CID 1393516
CID 1393517
CID 1393518
CID 1393519
Any specific reason to write the or statement as two separate if clauses?
I believe in other parts we do it ((true & x & y & z) | (false & a & b &c )) - as multiline checks;
I don't like them both get executed "always", so at the very least, an "else" just before the 2nd if would be good.
The logic looks ok to me.