s3-lsa: allow to lookup BUILTIN\ in lsa_LookupNames.
[ira/wip.git] / source3 / passdb / lookup_sid.c
index 4f8d6a4759dc193a7ba4d14987160c93228f8119..1fcd94c059dd22204a6363bfcccb472a5880d55f 100644 (file)
@@ -86,6 +86,14 @@ bool lookup_name(TALLOC_CTX *mem_ctx,
        if ((flags & LOOKUP_NAME_BUILTIN) &&
            strequal(domain, builtin_domain_name()))
        {
+               if (strlen(name) == 0) {
+                       /* Swap domain and name */
+                       tmp = name; name = domain; domain = tmp;
+                       sid_copy(&sid, &global_sid_Builtin);
+                       type = SID_NAME_DOMAIN;
+                       goto ok;
+               }
+
                /* Explicit request for a name in BUILTIN */
                if (lookup_builtin_name(name, &rid)) {
                        sid_copy(&sid, &global_sid_Builtin);