[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Jan 13 07:54:17 MST 2010


The branch, master has been updated
       via  8d4b913... s4:ldb: be more strict in parsing ldb time strings
      from  7147c84... selftest: Print reason when a test fails unexpectedly

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


- Log -----------------------------------------------------------------
commit 8d4b913ce24632eca2a6fc08ef8f553eaa9afa77
Author: Stefan Metzmacher <metze at samba.org>
Date:   Mon Jan 11 13:11:48 2010 +0100

    s4:ldb: be more strict in parsing ldb time strings
    
    metze

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

Summary of changes:
 source4/lib/ldb/common/ldb_msg.c |    8 ++++----
 1 files changed, 4 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 9b33d7e..cb8d4a8 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -820,7 +820,7 @@ time_t ldb_string_to_time(const char *s)
 	if (s == NULL) return 0;
 	
 	memset(&tm, 0, sizeof(tm));
-	if (sscanf(s, "%04u%02u%02u%02u%02u%02u", 
+	if (sscanf(s, "%04u%02u%02u%02u%02u%02u.0Z",
 		   &tm.tm_year, &tm.tm_mon, &tm.tm_mday, 
 		   &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
 		return 0;
@@ -839,13 +839,13 @@ int ldb_val_to_time(const struct ldb_val *v, time_t *t)
 {
 	struct tm tm;
 
-	if (v == NULL || !v->data || v->length < 14) {
+	if (v == NULL || !v->data || v->length < 17) {
 		return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
 	}
 
 	memset(&tm, 0, sizeof(tm));
 
-	if (sscanf((char *)v->data, "%04u%02u%02u%02u%02u%02u",
+	if (sscanf((char *)v->data, "%04u%02u%02u%02u%02u%02u.0Z",
 		   &tm.tm_year, &tm.tm_mon, &tm.tm_mday,
 		   &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
 		return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
@@ -899,7 +899,7 @@ time_t ldb_string_utc_to_time(const char *s)
 	if (s == NULL) return 0;
 	
 	memset(&tm, 0, sizeof(tm));
-	if (sscanf(s, "%02u%02u%02u%02u%02u%02u", 
+	if (sscanf(s, "%02u%02u%02u%02u%02u%02uZ",
 		   &tm.tm_year, &tm.tm_mon, &tm.tm_mday, 
 		   &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
 		return 0;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list