[SCM] Samba Shared Repository - branch master updated

Matthias Dieter Wallnöfer mdw at samba.org
Sun Oct 18 10:17:13 MDT 2009


The branch, master has been updated
       via  d673b49... s4:ldb_msg_check_string_attribute - add a comment about the result values
       via  9d097fa... Revert "s4:ldb_msg - Use LDB constants on results"
      from  718d280... s3:configure: fix avahi activation

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit d673b49dfcd75f723b39fbc914d69caae4b96237
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Oct 18 18:13:17 2009 +0200

    s4:ldb_msg_check_string_attribute - add a comment about the result values

commit 9d097fa0e0ccb558a55f65376fedeb041c4d57ac
Author: Matthias Dieter Wallnöfer <mwallnoefer at yahoo.de>
Date:   Sun Oct 18 18:00:59 2009 +0200

    Revert "s4:ldb_msg - Use LDB constants on results"
    
    This reverts commit 56a8baff3df6a5120b6c7bbca771dfb7c6934fd5.
    Simo pointed out that I was wrong here.

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

Summary of changes:
 source4/lib/ldb/common/ldb_msg.c |   13 +++++++++----
 source4/lib/ldb/include/ldb.h    |    9 +++++++++
 2 files changed, 18 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index 0917325..a8ea52b 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -890,22 +890,27 @@ void ldb_dump_results(struct ldb_context *ldb, struct ldb_result *result, FILE *
 	}
 }
 
-int ldb_msg_check_string_attribute(const struct ldb_message *msg, const char *name, const char *value)
+/*
+  checks for a string attribute. Returns "1" on match and otherwise "0".
+*/
+int ldb_msg_check_string_attribute(const struct ldb_message *msg,
+				   const char *name, const char *value)
 {
 	struct ldb_message_element *el;
 	struct ldb_val val;
 	
 	el = ldb_msg_find_element(msg, name);
 	if (el == NULL) {
-		return LDB_SUCCESS;
+		return 0;
 	}
 
 	val.data = discard_const_p(uint8_t, value);
 	val.length = strlen(value);
 
 	if (ldb_msg_find_val(el, &val)) {
-		return LDB_ERR_OPERATIONS_ERROR;
+		return 1;
 	}
 
-	return LDB_SUCCESS;
+	return 0;
 }
+
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 69d052b..2511fec 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -1807,6 +1807,15 @@ struct ldb_message *ldb_msg_diff(struct ldb_context *ldb,
 				 struct ldb_message *msg1,
 				 struct ldb_message *msg2);
 
+/**
+   Tries to find a certain string attribute in a message
+
+   \param msg the message to check
+   \param name attribute name
+   \param value attribute value
+
+   \return 1 on match and 0 otherwise.
+*/
 int ldb_msg_check_string_attribute(const struct ldb_message *msg,
 				   const char *name,
 				   const char *value);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list