s3-lsa: Fix Bug #6263. Unexpected LookupSids reply crashes XP pre-SP3.
authorGünther Deschner <gd@samba.org>
Wed, 15 Apr 2009 23:42:35 +0000 (01:42 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 15 Apr 2009 23:46:29 +0000 (01:46 +0200)
LookupSids needs to bounce back string sids in case of NT_STATUS_NONE_MAPPED.

Guenther
(cherry picked from commit 597be402e40ff880b595ae49a8600b932365cbcb)

source/rpc_server/srv_lsa_nt.c

index 9d411eccb9d1624fa33b980595c1f555a9367df2..fd6cdfab0309fa38d0d2cd493d4678c4f97c20c3 100644 (file)
@@ -830,7 +830,15 @@ NTSTATUS _lsa_LookupSids(pipes_struct *p,
                                           &names,
                                           &mapped_count);
 
-       if (NT_STATUS_IS_ERR(status)) {
+       /* Only return here when there is a real error.
+          NT_STATUS_NONE_MAPPED is a special case as it indicates that none of
+          the requested sids could be resolved. Older versions of XP (pre SP3)
+          rely that we return with the string representations of those SIDs in
+          that case. If we don't, XP crashes - Guenther
+          */
+
+       if (NT_STATUS_IS_ERR(status) &&
+           !NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
                return status;
        }