tech-kern archive

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

Re: ffsv2 extattr support



On Fri, Jun 20, 2014 at 9:11 AM, Thomas Schmitt <scdbackup%gmx.net@localhost> 
wrote:
>
> One peculiarity shows up:
>
> extattr_get_link(2) et.al. return the attribute content with
> a trailing 0-byte.
> This 0-byte seems to be a bug-or-feature of setextattr(1).
>
> I overwrote an extattr in the ISO filesystem by xorriso means
> without a trailing 0-byte. Then i extracted it into the FFSv1
> filesystem and recorded it by xorriso again. No 0-byte appeared.
> So the extattr_*(2) functions and xorriso are not the ones
> who created those 0s.
>
> Neither FreeBSD nor Linux show trailing 0-bytes with their
> cleartext extattr/xattr.
>
> I care for portability of attributes in namespace "user".
> So it would be interesting to know whether the convention on
> NetBSD is to have a 0-byte at the end of attribute content.
> extattr(9) specifies "nul-terminated character string" for
> names. But content is usually regarded as binary data, governed
> by the length value and not by a terminating character.
>
> If the 0-byte is convention, then i would consider to strip
> it when recording and to add it when restoring.
> But that would be feasible only if namespace "user" is reserved
> for C character strings rather than byte arrays.

This looks like a bug to me, attribute values need to be binary. I
have some tests which run on Linux and FreeBSD but I haven't run them
on NetBSD yet due to my current systems not having support (would be
nice if tmpfs had support).

Justin


Home | Main Index | Thread Index | Old Index