summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2005-11-26 21:35:43 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:36 -0500
commitfcf14ebee21378064187dd4389c01d8eaea3ca2a (patch)
tree38bc5e7db96cab0d4a891a55f4128c1b8f6a7b0e
parentd36eb68cb5be37423a98eb1a122c14f45d4fdaa0 (diff)
downloadsamba-fcf14ebee21378064187dd4389c01d8eaea3ca2a.tar.gz
samba-fcf14ebee21378064187dd4389c01d8eaea3ca2a.tar.bz2
samba-fcf14ebee21378064187dd4389c01d8eaea3ca2a.zip
r11921: samr_open_domain can only open "our" domain and BUILTIN.
Volker (This used to be commit 049920ce4f78723bc884c46b2ee4ef22f25c482c)
-rw-r--r--source3/rpc_server/srv_samr_nt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index ec2bc3fe4a..ac774355a7 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -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;