r11921: samr_open_domain can only open "our" domain and BUILTIN.
authorVolker Lendecke <vlendec@samba.org>
Sat, 26 Nov 2005 21:35:43 +0000 (21:35 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:36 +0000 (11:05 -0500)
Volker
(This used to be commit 049920ce4f78723bc884c46b2ee4ef22f25c482c)

source3/rpc_server/srv_samr_nt.c

index ec2bc3fe4af88d260283dd6097b2429c25d44d6a..ac774355a73bf35c786f876392283358395ab121 100644 (file)
@@ -562,6 +562,11 @@ NTSTATUS _samr_open_domain(pipes_struct *p, SAMR_Q_OPEN_DOMAIN *q_u, SAMR_R_OPEN
        if ( !NT_STATUS_IS_OK(status) )
                return status;
 
+       if (!sid_check_is_domain(&q_u->dom_sid.sid) &&
+           !sid_check_is_builtin(&q_u->dom_sid.sid)) {
+               return NT_STATUS_NO_SUCH_DOMAIN;
+       }
+
        /* associate the domain SID with the (unique) handle. */
        if ((info = get_samr_info_by_sid(&q_u->dom_sid.sid))==NULL)
                return NT_STATUS_NO_MEMORY;