Nathan Scott wrote:
Hmm, to my mind its pretty straightforward and doesn't really warrant
special mention in the man pages, but I guess its confusing to some.

Without a mention, it can break scripts. I happened across it, but for example, I have a script that retrieves an attribute, modifies it and writes it back. Simplifying this down, I'm expecting the following to work:

setfattr -n user.DOSATTRIB -v $(getfattr --only-values -n user.DOSATTRIB foo) foo

According to the manpage as it is, this should work in all cases. However, it breaks if the existing value starts 0x. This may not happen during testing (though it did in this case when used for samba). Do you see what I mean?

I think that setfattr really needs a --no-escape option or something. Otherwise my script has to pass everything it gets out of getfattr through sed before going to setfattr, which is ugly. setfattr should really be able to take exactly what getfattr returns.

 > An admin would at least try the "obvious" way above, surely...?

I tried a few combinations, but didn't get any joy. I even dug through the source and couldn't see a way of escaping it.

Guess not - can you suggest some suitable words that I could add
to the man page to explain this?  thanks.

Is there anything else that is parsed, for example octal? I'm not sure how accurate the following is, as I don't know the logic that setfattr is following:

       -v value, --value=value
Specifies the new value for the extended attribute. If _value_ begins with 0x, then it is taken to be in hexadecimal encoding. To insert a literal value of this form, escape it by surrounding it with double quotes (you may need your shell to escape this).

Thanks,
Robie.


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to