idmap_autorid: fix status code when trying to load range for an invalid input
authorMichael Adam <obnox@samba.org>
Tue, 5 Nov 2013 12:46:15 +0000 (13:46 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 7 Nov 2013 22:01:36 +0000 (14:01 -0800)
commit1524dc6006071d99d1a61c53301a25de91cda07d
tree8201a91ea161383a9cf7eeb85775a47858fc7579
parent066915f29d20676335a88e93d4148713ec37ace7
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>
source3/winbindd/idmap_autorid_tdb.c