s3-samr: fix _samr_LookupNames return code.
authorGünther Deschner <gd@samba.org>
Tue, 25 Nov 2008 11:19:35 +0000 (12:19 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 25 Nov 2008 14:39:51 +0000 (15:39 +0100)
Guenther

source3/rpc_server/srv_samr_nt.c

index 3cc86edd62a05c11579fd8bbe52acbe8b7bc338b..ba9d911c2bf666eb521cf05237ad6ab909997116 100644 (file)
@@ -1794,6 +1794,7 @@ NTSTATUS _samr_LookupNames(pipes_struct *p,
        DOM_SID pol_sid;
        uint32  acc_granted;
        struct samr_Ids rids, types;
        DOM_SID pol_sid;
        uint32  acc_granted;
        struct samr_Ids rids, types;
+       uint32_t num_mapped = 0;
 
        DEBUG(5,("_samr_LookupNames: %d\n", __LINE__));
 
 
        DEBUG(5,("_samr_LookupNames: %d\n", __LINE__));
 
@@ -1841,10 +1842,18 @@ NTSTATUS _samr_LookupNames(pipes_struct *p,
                }
 
                if (type[i] != SID_NAME_UNKNOWN) {
                }
 
                if (type[i] != SID_NAME_UNKNOWN) {
-                       status = NT_STATUS_OK;
+                       num_mapped++;
                }
        }
 
                }
        }
 
+       if (num_mapped == num_rids) {
+               status = NT_STATUS_OK;
+       } else if (num_mapped == 0) {
+               status = NT_STATUS_NONE_MAPPED;
+       } else {
+               status = STATUS_SOME_UNMAPPED;
+       }
+
        rids.count = num_rids;
        rids.ids = rid;
 
        rids.count = num_rids;
        rids.ids = rid;