you are correct, the below example can easily be rewritten using '.|!' operators, but more complex class definitions can look pretty ugly using only '.|!' operators. The deletion operator '-' is often much more convenient.
Note that the bug exists even if you replace '-linux' with '[EMAIL PROTECTED]' If I remember correctly, the documentation is also not correct in regard to the use of the deletion operator '-'. Last time I looked at the code, '-@' was used for netgroups and '-' for classes --- Eric Sorenson <[EMAIL PROTECTED]> wrote: > Stefan - I concur that this behavior is not correct, > but was > unfamiliar with the 'minus' notation so I re-read > the groups section > of the documentation. Based on the docs, I would > only expect the > minus to work with NIS netgroups, not arbitrary > classes. A more > conventional syntax for what you want (which does in > fact work > correctly) would be: > > groups: > testclass_1 = ( any ) > testclass = ( !linux ) > > On Sep 19, 2007, at 5:33 PM, Stefan Wipf wrote: > > > the following sample config produces some very > > unexpected and dangerous behavior: > > > > groups: > > testclass_1 = ( any ) > > testclass = ( any -linux ) > > > > one would expect that this configuration would > only > > set class 'testclass_1' on linux machines. But the > > exact opposite is true, under the current > > implementation of the '-' syntax, 'testclass_1' > does > > _not_ get set on linux machines, but instead > > 'testclass' gets set. > > To be more specific, when cfengine parses the > config > > for linux machines, first 'testclass_1' gets > > activated, then 'testclass' gets activated and > finally > > 'testclass_1' gets deactivated as cfengine simply > > deletes the first class it finds that starts with > the > > string 'testclass' rather than matching the class > > string exactly. > > > > We are running 2.1.21 > > Has this been fixed in later releases? > > > > > > FIX: > > replace all occurrences of 'DeleteItemStarting' > with > > 'DeleteItemLiteral' in convinstall.c and install.c > > > - Eric Sorenson - N37 17.255 W121 55.738 - > http://ahpook.vox.com/ - > > > > ____________________________________________________________________________________ Building a website is a piece of cake. Yahoo! Small Business gives you all the tools to get online. http://smallbusiness.yahoo.com/webhosting _______________________________________________ Bug-cfengine mailing list [email protected] https://cfengine.org/mailman/listinfo/bug-cfengine
