mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
s3:idmap_cache: improve checks for format of value string in idmap_cache_find_sid2unixid()
Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri May 18 16:34:27 CEST 2012 on sn-devel-104
This commit is contained in:
parent
0c3137c2e1
commit
7db637483b
@ -55,7 +55,22 @@ bool idmap_cache_find_sid2unixid(const struct dom_sid *sid, struct unixid *id,
|
||||
|
||||
DEBUG(10, ("Parsing value for key [%s]: value=[%s]\n", key, value));
|
||||
|
||||
if (value[0] == '\0') {
|
||||
DEBUG(0, ("Failed to parse value for key [%s]: "
|
||||
"value is empty\n", key));
|
||||
ret = false;
|
||||
goto done;
|
||||
}
|
||||
|
||||
tmp_id.id = strtol(value, &endptr, 10);
|
||||
|
||||
if ((value == endptr) && (tmp_id.id == 0)) {
|
||||
DEBUG(0, ("Failed to parse value for key [%s]: value[%s] does "
|
||||
"not start with a number\n", key, value));
|
||||
ret = false;
|
||||
goto done;
|
||||
}
|
||||
|
||||
DEBUG(10, ("Parsing value for key [%s]: id=[%llu], endptr=[%s]\n",
|
||||
key, (unsigned long long)tmp_id.id, endptr));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user