Hi,

Here is a simple patch that let CFengine create classes from FQDN in a
recursive way:

"laptop1.room13.facility3.site2.company.com"

will now be translated into the following clases :

laptop1.room13.facility3.site2.company.com
room13.facility3.site2.company.com
facility3.site2.company.com
site2.company.com
company.com
com

Please tell me if you find this stupid/useful and if you can add it to
the CVS.


Thx





--- cfengine-2.1.14/src/nameinfo.c	2005-02-08 12:50:02.000000000 +0100
+++ cfengine-2.1.14_subdomain/src/nameinfo.c	2005-05-02 17:46:08.000000000 +0200
@@ -139,10 +139,23 @@
    {
    if (*sp2 == '.')
       {
+/*
       *sp2 = '\0';
       Debug("Truncating fully qualified hostname %s to %s\n",VSYSNAME.nodename,sp);
       break;
+*/
+      if (*(sp2+1) != '\0')
+        {
+        Debug("Definning domain #%s#\n",(sp2+1));
+        AddClassToHeap(CanonifyName(sp2+1));
+        }
+      else
+        {
+        Debug("Domain rejected\n");
+        }
+
       }
+
    }
 
  

_______________________________________________
Bug-cfengine mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-cfengine

Reply via email to