summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-05-16 17:49:47 +0200
committerMichael Adam <obnox@samba.org>2012-05-18 14:44:15 +0200
commitecb24fd459ca6d1c25cc23ffb1e7694bcc280fef (patch)
treebc941ec76e3b09be9fb5485081035280ab5ce8cd /source3/lib
parentf5ca3f11e47e48d195616f813b5b2c9e8255c6cd (diff)
downloadsamba-ecb24fd459ca6d1c25cc23ffb1e7694bcc280fef.tar.gz
samba-ecb24fd459ca6d1c25cc23ffb1e7694bcc280fef.tar.bz2
samba-ecb24fd459ca6d1c25cc23ffb1e7694bcc280fef.zip
s3:idmap_cache: improve debug messages in idmap_cache_find_sid2unixid()
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/idmap_cache.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/source3/lib/idmap_cache.c b/source3/lib/idmap_cache.c
index 3669e93e58..8bad6e4eab 100644
--- a/source3/lib/idmap_cache.c
+++ b/source3/lib/idmap_cache.c
@@ -53,9 +53,12 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
TALLOC_FREE(key);
return false;
}
+
+ DEBUG(10, ("Parsing value for key [%s]: value=[%s]\n", key, value));
+
tmp_id.id = strtol(value, &endptr, 10);
- DEBUG(10, ("Parsing result of %s, endptr=%s, id=%llu\n",
- key, endptr, (unsigned long long)tmp_id.id));
+ DEBUG(10, ("Parsing value for key [%s]: id=[%llu], endptr=[%s]\n",
+ key, (unsigned long long)tmp_id.id, endptr));
ret = (*endptr == ':');
if (ret) {
@@ -73,23 +76,39 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
break;
case '\0':
+ TALLOC_FREE(key);
+ SAFE_FREE(value);
+ DEBUG(0, ("FAILED to parse value for key [%s] "
+ "(id=[%llu], endptr=[%s]): "
+ "no type character after colon\n",
+ key, (unsigned long long)tmp_id.id, endptr));
+ return false;
default:
TALLOC_FREE(key);
SAFE_FREE(value);
- DEBUG(0, ("FAILED Parsing result of %s, endptr=%s, id=%llu\n", key, endptr, (unsigned long long)tmp_id.id));
+ DEBUG(0, ("FAILED to parse value for key [%s] "
+ "(id=[%llu], endptr=[%s]): "
+ "illegal type character '%c'\n",
+ key, (unsigned long long)tmp_id.id, endptr,
+ endptr[1]));
return false;
}
if (endptr[2] != '\0') {
TALLOC_FREE(key);
SAFE_FREE(value);
- DEBUG(0, ("FAILED (2) Parsing result of %s, endptr=%s, id=%llu\n", key, endptr, (unsigned long long)tmp_id.id));
+ DEBUG(0, ("FAILED to parse value for key [%s] "
+ "(id=[%llu], endptr=[%s]): "
+ "more than 1 type character after colon\n",
+ key, (unsigned long long)tmp_id.id, endptr));
return false;
}
*id = tmp_id;
*expired = (timeout <= time(NULL));
} else {
- DEBUG(0, ("FAILED (3) Parsing result of %s, value=%s\n", key, value));
+ DEBUG(0, ("FAILED to parse value for key [%s] (value=[%s]): "
+ "colon missing after id=[%llu]\n",
+ key, value, (unsigned long long)tmp_id.id));
}
TALLOC_FREE(key);
SAFE_FREE(value);