[augeas-devel] Having trouble differentiating quoted vs unquoted string

Matthew Palmer matt at anchor.net.au
Wed Aug 12 07:46:03 UTC 2009


Hi,

I'm writing a lens for SSH authorized_keys files, and I've hit a fairly
nasty snag in options parsing.  For those not aware, an options line in SSH
consists of a comma-separated list of key=value pairs (with some exceptions
that are irrelevant to the current discussion).  Because whitespace is the
separator between the options and the key type, if you want whitespace or
commas in your option value you need to quote it.  So you might have the
following in your authorized_keys file:

command="/usr/bin/foo fromble",something=somethingelse

Note that the quotes are valid in any event (so something="somethingelse" is
also valid), which makes life trickier...

I've reduced my problem to something quite trivial; writing a lens that will
successfully parse/write the following should solve my problem:

"quoted line"
"unecessarily_quoted_line"
unquotedline

Unfortunately, whatever I try I get an "overlapping lens in tree union.put"
error, which I understand the meaning of -- when trying to write a value in
the tree back to the file, augeas can't decide whether to use the quoted or
unquoted version.

My problem is that I can't work out how to work around it.  Does anyone have
any suggestions?

- Matt




More information about the augeas-devel mailing list