1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3:idmap_cache: improve debug messages in idmap_cache_find_sid2unixid()

This commit is contained in:
Michael Adam 2012-05-16 17:49:47 +02:00
parent f5ca3f11e4
commit ecb24fd459

View File

@ -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);