git.samba.org
/
kamenim
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7147c84
)
s4:ldb: be more strict in parsing ldb time strings
author
Stefan Metzmacher
<metze@samba.org>
Mon, 11 Jan 2010 12:11:48 +0000
(13:11 +0100)
committer
Stefan Metzmacher
<metze@samba.org>
Wed, 13 Jan 2010 13:51:59 +0000
(14:51 +0100)
metze
source4/lib/ldb/common/ldb_msg.c
patch
|
blob
|
history
diff --git
a/source4/lib/ldb/common/ldb_msg.c
b/source4/lib/ldb/common/ldb_msg.c
index 9b33d7e3519c3e088ee610a6f819894a73e0f937..cb8d4a8d9ae6c991099053b2811e729ae59b38d4 100644
(file)
--- 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 (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;
&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;
{
struct tm tm;
- if (v == NULL || !v->data || v->length < 1
4
) {
+ if (v == NULL || !v->data || v->length < 1
7
) {
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
}
memset(&tm, 0, sizeof(tm));
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;
&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 (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%02u
Z",
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
return 0;
&tm.tm_year, &tm.tm_mon, &tm.tm_mday,
&tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) {
return 0;