[augeas-devel] adjustment to the krb5.aug lense
Pat Riehecky
riehecky at fnal.gov
Fri Aug 3 18:36:23 UTC 2012
On 08/02/2012 02:43 AM, Raphaël Pinson wrote:
> On Thu, Aug 2, 2012 at 9:32 AM, Raphaël Pinson
> <raphael.pinson at camptocamp.com <mailto:raphael.pinson at camptocamp.com>>
> wrote:
>
> On Wed, Aug 1, 2012 at 5:06 PM, Pat Riehecky <riehecky at fnal.gov
> <mailto:riehecky at fnal.gov>> wrote:
>
> On 08/01/2012 09:22 AM, Raphaël Pinson wrote:
>
> Hi Pat,
>
> Sorry for the long delay in replying to you.
>
>
> No worries, I've been busy too!
>
>
>
> On Thu, Apr 19, 2012 at 11:47 PM, Pat Riehecky
> <riehecky at fnal.gov <mailto:riehecky at fnal.gov>
> <mailto:riehecky at fnal.gov <mailto:riehecky at fnal.gov>>> wrote:
>
>
> (Apologies for the return of this old thread, but the
> history
> seemed to help provide context)
>
> I've almost got this working the way I think it should
> and reading
> my site's krb5.conf. The only remaining issue I'm
> running into is
> with 'default_tgs_enctypes'. I'd love to get it into
> a sequence,
> but I can't seem to figure out how. The attached
> patch gets me
> really close, where I've got a sequence called 'type'
> under
> default_tgs_enctypes, but the extra part of the tree
> seems to be
> extra rather than useful, plus it seems to make
> setting those
> things a bit messy when it wasn't before - Was
> /files/etc/krb5.conf/libdefaults/default_tgs_enctypes
> = 'thing' my
> changes make
>
> /files/etc/krb5.conf/libdefaults/default_tgs_enctypes/type[x]
> =
> 'thing' which is not right.....
>
>
>
> The patch you attached leads to an ambiguity:
>
> $ augparse -I . krb5.aug
> Syntax error in lens definition
> krb5.aug:49.0-53.87:Failed to compile libdefaults
> krb5.aug:47.26-.71:exception: ambiguous iteration
> Iterated regexp:
> /([a-zA-Z0-9]+-[a-zA-Z0-9]+-[a-zA-Z0-9]+)([ \t,]*)/
> 'A-A-AAA-A-A' can be split into
> 'A-A-A|=|AA-A-A'
>
> and
> 'A-A-AA|=|A-A-A'
>
> Iterated lens: krb5.aug:47.26-.70:
>
> Hmmm, this is quite the puzzle.
>
> When one value is specified ('A-A-A') it is followed by a new
> line, read terminates, no problem. When multiples are set
> they are delimited by spaces, tabs, commas, or a combination
> of all three. However, the one at the end may or may not have
> a trailing delimiter. So I'm not sure I can enforce
> delimiters to separate the items.
>
> Currently the third item ('A-A-B', the B) seems to be limited
> to 3 or 4 characters with a minimum of 3, but it appears that
> a smaller one is possible. Grumble.... All of these appear
> to be valid entries: rc4-hmac arcfour-hmac arcfour-hmac-md5
> aes128-cts des3-cbc-sha1 rc4-hmac des-cbc-md5 des-cbc-crc
>
> Can augeas do word boundaries? Most of my regex is perl style
> rather than POSIX That should solve the ambiguity but my
> googling is only turning up perl style....
>
>
>
> I think what you want is Build.opt_list (see all lenses using it,
> there's many):
>
> Build.opt_list enctype_re valsep
>
>
>
>
> To be more specific, this passes:
>
> let valsep = del /[ \t,]+/ " "
>
> let enctype_list (kw:regexp) (sep:lens) = [ indent . key kw .
> sep . Build.opt_list [ label "type" . store
> enctype_re] valsep . (comment|eol) ]
>
>
>
> Now you should really write some unit tests in test_krb5.aug to ensure
> that your changes actually bring the features you want.
>
Thanks for all the help!
How does this look?
Pat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aug_krb5_update.patch
Type: text/x-patch
Size: 5272 bytes
Desc: aug_krb5_update.patch
URL: <http://listman.redhat.com/archives/augeas-devel/attachments/20120803/c3785701/attachment.bin>
More information about the augeas-devel
mailing list