Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: crm by andrew from 
      ([email protected])
   2. Linux-HA CVS: include by andrew from 
      ([email protected])
   3. Linux-HA CVS: lib by andrew from 
      ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Fri, 31 Mar 2006 04:50:24 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: crm by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : crm

Dir     : linux-ha/crm/cib


Modified Files:
        io.c messages.c 


Log Message:
Code for calculating xml digests is now in the common library
When calculating a digest, sort the top-level fields
  - required when creating the hash of an operations parameters  
Standardized on one debug attribute and always ignore it in diffs
Removed timestamp code that did nothing anyway, we haven't wanted
  to add this to every field for a long time

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/io.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- io.c        10 Mar 2006 10:15:45 -0000      1.52
+++ io.c        31 Mar 2006 11:50:23 -0000      1.53
@@ -1,4 +1,4 @@
-/* $Id: io.c,v 1.52 2006/03/10 10:15:45 andrew Exp $ */
+/* $Id: io.c,v 1.53 2006/03/31 11:50:23 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -88,31 +88,6 @@
 #include <pwd.h>
 #include <grp.h>
 
-#include <clplumbing/md5.h>
-
-/* "c048eae664dba840e1d2060f00299e9d" */
-static char *
-calculate_cib_digest(crm_data_t *local_cib)
-{
-       int i = 0;
-       int digest_len = 16;
-       char *digest = NULL;
-       unsigned char *raw_digest = NULL;
-       char *buffer = dump_xml_formatted(local_cib);
-
-       CRM_DEV_ASSERT(buffer != NULL && strlen(buffer) > 0);
-
-       crm_malloc0(digest, sizeof(char) * (2 * digest_len + 1));
-       crm_malloc0(raw_digest, sizeof(char) * (digest_len + 1));
-       MD5((unsigned char *)buffer, strlen(buffer), raw_digest);
-         for(i = 0; i < digest_len; i++) {
-               sprintf(digest+(2*i), "%02x", raw_digest[i]);
-       }
-        crm_debug_2("Digest is: %s\n", digest);
-       crm_free(buffer);
-       crm_free(raw_digest);
-       return digest;
-}
 
 static gboolean
 validate_cib_digest(crm_data_t *local_cib)
@@ -126,7 +101,7 @@
        int start = 0, length = 0, read_len = 0;
 
        if(local_cib != NULL) {
-               digest = calculate_cib_digest(local_cib);
+               digest = calculate_xml_digest(local_cib);
        }
        
        s_res = stat(CIB_FILENAME ".sig", &buf);
@@ -175,7 +150,7 @@
        CRM_ASSERT(digest_strm != NULL);
 
        if(digest == NULL) {
-               digest = calculate_cib_digest(local_cib);
+               digest = calculate_xml_digest(local_cib);
                CRM_ASSERT(digest != NULL);
                local_digest = digest;
        }
@@ -605,7 +580,7 @@
                exit(LSB_EXIT_GENERIC);
        }
 
-       digest = calculate_cib_digest(the_cib);
+       digest = calculate_xml_digest(the_cib);
        crm_info("Wrote version %s.%s.%s of the CIB to disk (digest: %s)",
                 admin_epoch?admin_epoch:"0",
                 epoch?epoch:"0", updates?updates:"0", digest); 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/crm/cib/messages.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -3 -r1.69 -r1.70
--- messages.c  17 Mar 2006 01:09:01 -0000      1.69
+++ messages.c  31 Mar 2006 11:50:23 -0000      1.70
@@ -1,4 +1,4 @@
-/* $Id: messages.c,v 1.69 2006/03/17 01:09:01 andrew Exp $ */
+/* $Id: messages.c,v 1.70 2006/03/31 11:50:23 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -284,8 +284,6 @@
        char *old_value = NULL;
        int  int_value  = -1;
 
-       /* modify the timestamp */
-       set_node_tstamp(xml_obj);
        if(reset == FALSE && crm_element_value(xml_obj, field) != NULL) {
                old_value = crm_element_value_copy(xml_obj, field);
        }
@@ -772,8 +770,6 @@
                return cib_operation;
        }
 
-       set_node_tstamp(this_section);
-
        if(safe_str_eq(crm_element_name(xml_section), section)) {
                xml_child_iter(xml_section, a_child, 
                               rc = cib_ok;




------------------------------

Message: 2
Date: Fri, 31 Mar 2006 04:50:25 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: include by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : include

Dir     : linux-ha/include/crm/common


Modified Files:
        xml.h 


Log Message:
Code for calculating xml digests is now in the common library
When calculating a digest, sort the top-level fields
  - required when creating the hash of an operations parameters  
Standardized on one debug attribute and always ignore it in diffs
Removed timestamp code that did nothing anyway, we haven't wanted
  to add this to every field for a long time

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/include/crm/common/xml.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- xml.h       2 Feb 2006 08:58:58 -0000       1.40
+++ xml.h       31 Mar 2006 11:50:24 -0000      1.41
@@ -1,4 +1,4 @@
-/* $Id: xml.h,v 1.40 2006/02/02 08:58:58 andrew Exp $ */
+/* $Id: xml.h,v 1.41 2006/03/31 11:50:24 andrew Exp $ */
 /* 
  * Copyright (C) 2004 Andrew Beekhof <[EMAIL PROTECTED]>
  * 
@@ -155,7 +155,12 @@
 /*
  * Set a timestamp attribute on a_node
  */
-extern void set_node_tstamp(crm_data_t *a_node);
+extern void add_xml_tstamp(crm_data_t *a_node);
+
+/*
+ * 
+ */
+extern void purge_diff_markers(crm_data_t *a_node);
 
 /*
  * Returns a deep copy of src_node
@@ -213,7 +218,7 @@
        crm_data_t *parent, const char *node_name, const char *id);
 
 extern crm_data_t *subtract_xml_object(
-       crm_data_t *left, crm_data_t *right, gboolean suppress);
+       crm_data_t *left, crm_data_t *right, const char *marker);
 
 extern int add_xml_object(
        crm_data_t *parent, crm_data_t *target, const crm_data_t *update);
@@ -243,6 +248,8 @@
 
 extern gboolean xml_has_children(crm_data_t *root);                    
 
+extern char *calculate_xml_digest(crm_data_t *local_cib);
+
 #if XML_PARANOIA_CHECKS
 #  define crm_validate_data(obj) xml_validate(obj)
 #else




------------------------------

Message: 3
Date: Fri, 31 Mar 2006 04:50:25 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by andrew from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : andrew
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/crm/cib


Modified Files:
        cib_client.c 


Log Message:
Code for calculating xml digests is now in the common library
When calculating a digest, sort the top-level fields
  - required when creating the hash of an operations parameters  
Standardized on one debug attribute and always ignore it in diffs
Removed timestamp code that did nothing anyway, we haven't wanted
  to add this to every field for a long time

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/crm/cib/cib_client.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- cib_client.c        29 Mar 2006 14:23:11 -0000      1.52
+++ cib_client.c        31 Mar 2006 11:50:24 -0000      1.53
@@ -1267,7 +1267,7 @@
        if(update == NULL && update_section == NULL) {
                crm_debug_3("Creating a blank fragment");
                update = createEmptyCib();
-               crm_xml_add(cib, "debug_source", source);
+               crm_xml_add(cib, XML_ATTR_ORIGIN, source);
                return update;
 
        } else if(update == NULL) {
@@ -1284,13 +1284,13 @@
        
        if(whole_cib == FALSE) {
                cib = createEmptyCib();
-               crm_xml_add(cib, "debug_source", source);
+               crm_xml_add(cib, XML_ATTR_ORIGIN, source);
                object_root = get_object_root(update_section, cib);
                add_node_copy(object_root, update);
 
        } else {
                cib = copy_xml(update);
-               crm_xml_add(cib, "debug_source", source);
+               crm_xml_add(cib, XML_ATTR_ORIGIN, source);
        }
        
        crm_debug_3("Verifying created fragment");
@@ -1318,10 +1318,6 @@
        config = create_xml_node(cib_root, XML_CIB_TAG_CONFIGURATION);
        status = create_xml_node(cib_root, XML_CIB_TAG_STATUS);
 
-       set_node_tstamp(cib_root);
-       set_node_tstamp(config);
-       set_node_tstamp(status);
-       
 /*     crm_xml_add(cib_root, "version", "1"); */
        crm_xml_add(cib_root, "generated", XML_BOOLEAN_TRUE);
 




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 28, Issue 85
********************************************

Reply via email to