help-cfengine
[Top][All Lists]
Advanced

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

RE: Editfiles convergence bug


From: Andrews, Martin
Subject: RE: Editfiles convergence bug
Date: Tue, 18 Feb 2003 11:28:33 -0500

Special support for password entries seems wrong - though a relaxing of the
ReplaceAll might be in order. Also, I am interested in 
preserving some parts of the original line. There was a patch at one time
that allowed you to use matched sections from the regular expression in
replacement string. This would let you do preserve fields for the root entry
too - say:

  BeginGroupIfNoLineMatching "^root:<somepasswordhash>:"
    ReplaceAll "^root:[^:]*:(.*)" With "root:<somepasswordhash>:\1"
  EndGroup

What happend to that patch? Maybe not for this example, but I would like it
so I can add boot options to lilo.conf (or grub.conf) without wiping out
current boot options.

Martin

> -----Original Message-----
> From: David J. Bianco [mailto:bianco@jlab.org]
> Sent: Tuesday, February 18, 2003 10:05 AM
> To: help-cfengine@gnu.org
> Subject: Re: Editfiles convergence bug
> 
> 
> [moving this to help-cfengine since maybe it's not actually a bug]
> 
> On Fri, 2003-02-14 at 11:32, Adrian Phillips wrote:
> > >>>>> "David" == David J Bianco <bianco@jlab.org> writes:
> > 
> >     David> I've got a simple stanza like: BeginGroupIfNoLineMatching
> >     David> "^root:<somepasswordhash>:0:0" ReplaceAll 
> "^root:[^:]*:0:0"
> >     David> With "root:<somepasswordhash>:0:0" EndGroup
> > 
> >     David> In English, if the root password hash isn't 
> correct, I want
> >     David> to change the hash without mucking around with anything
> >     David> else in the line.  I think this should work, but when it
> >     David> runs, I get:
> > 
> > The obvious but tidiest work around is :-
> > 
> > root:[^s][^o][^m]....:
> > 
> > otherwise I think this is intended,
> 
> Unfortunately, this doesn't work either.  In the case where the old
> and new passwords happen to have at least one character in common and
> in the same position, the expression doesn't match. ie, "xejt2" and
> "fepl6" both have the 'e' in the second position.  
> 
> I wonder if it wouldn't be useful to add an "account" action to handle
> password file entries.  Hmmm...
> 
> account:
>       any::
>               root    uid=0
>                       gid=0
>                       homedir=/
>                       gecos="System Administrator"
>                       passwdhash="jklfd278h93k7"
>                       inform=yes
> 
> What do you guys think?
> 
>       David
> 
> 
> -- 
> David J. Bianco <bianco@jlab.org>
> Thomas Jefferson National Accelerator Facility
> 
> 
> 
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-cfengine
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]