mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
idmap_autorid: fix status code when trying to load range for an invalid input
The "sid" input needs to be verified (it can currently be a SID or "ALLOC"). When handing in string that is valid for other kinds of records, but not for the SID[#IDX]-->RANGE direction of mappings, like for instance a range number, then we get "NT_STATUS_INTERNAL_DB_CORRUPTION" because parse records finds the record, but it does not have the expected size... This patch fixes this problem by pre-validating the input before fetching the record from the database. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
066915f29d
commit
1524dc6006
@ -304,6 +304,12 @@ static NTSTATUS idmap_autorid_getrange_int(struct db_context *db,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!idmap_autorid_validate_sid(range->domsid)) {
|
||||
DEBUG(3, ("Invalid SID: '%s'\n", range->domsid));
|
||||
status = NT_STATUS_INVALID_PARAMETER;
|
||||
goto done;
|
||||
}
|
||||
|
||||
idmap_autorid_build_keystr(range->domsid, range->domain_range_index,
|
||||
keystr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user