s3:lib: validate domain name in lookup_wellknown_name()
authorRalph Boehme <slow@samba.org>
Thu, 15 Oct 2015 10:35:26 +0000 (12:35 +0200)
committerUri Simchoni <uri@samba.org>
Thu, 15 Oct 2015 17:56:14 +0000 (19:56 +0200)
commit23f674488a1f62fcc58bb94bed0abed98078b96d
tree1285f017a7c33971eeb53d6c376f9bb4dacb58b5
parent808f29cb2f9de47dcf78b380cc8767e9546e1954
s3:lib: validate domain name in lookup_wellknown_name()

If domain argument is not an empty string, only search the matching
wellknown domain name.

As the only wellknown domain with a name is "NT Authority", passing ""
to lookup_wellknown_name() will search all domains inlcuding "NT
Authority".

Passing "NT Authority" otoh will obviously only search that domain.

This change makes lookup_wellknown_name() behave like this:

in domain         | in name       | ok | out sid | out domain
========================================================
                    Dialup          +    S-1-5-1   NT Authority
NT Authority        Dialup          +    S-1-5-1   NT Authority
Creator Authority   Dialup          -    -         -
                    Creator Owner   +    S-1-3-0   ""
Creator Authority   Creator Owner   -    -         -
NT Authority        Creator Owner   -    -         -

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11555

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>
source3/lib/util_wellknown.c