summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-12-08 00:25:04 +0000
committerLuke Leighton <lkcl@samba.org>1998-12-08 00:25:04 +0000
commit8308c000b2022769644ed8ea1fc772776257c99b (patch)
treed579da06e4af858bf3174345a1c3db97374ec1c4 /source3/rpc_server
parent4323fd4072854069eb9a3fe0dc0c33fb06b19335 (diff)
downloadsamba-8308c000b2022769644ed8ea1fc772776257c99b.tar.gz
samba-8308c000b2022769644ed8ea1fc772776257c99b.tar.bz2
samba-8308c000b2022769644ed8ea1fc772776257c99b.zip
adding srvsvc pipe.
(This used to be commit d06d6369942828ec89e90f99bd0d0d3f91d61d13)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe.c1
-rw-r--r--source3/rpc_server/srv_samr.c18
-rw-r--r--source3/rpc_server/srv_svcctl.c140
3 files changed, 157 insertions, 2 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index 1ad4cb6b9e..d9483deb86 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -347,6 +347,7 @@ static struct api_cmd api_fd_commands[] =
{ "samr", "lsass", api_samr_rpc },
{ "srvsvc", "ntsvcs", api_srvsvc_rpc },
{ "wkssvc", "ntsvcs", api_wkssvc_rpc },
+ { "svcctl", "ntsvcs", api_svcctl_rpc },
{ "NETLOGON", "lsass", api_netlog_rpc },
{ "winreg", "winreg", api_reg_rpc },
{ NULL, NULL, NULL }
diff --git a/source3/rpc_server/srv_samr.c b/source3/rpc_server/srv_samr.c
index 82dea29d9a..39a9b7591a 100644
--- a/source3/rpc_server/srv_samr.c
+++ b/source3/rpc_server/srv_samr.c
@@ -518,7 +518,7 @@ static void samr_reply_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u,
DEBUG(10,("add member on Domain SID\n"));
become_root(True);
- r_e.status = add_alias_member(alias_rid, &q_u->sid) ? 0x0 : 0xC0000000 | NT_STATUS_ACCESS_DENIED;
+ r_e.status = add_alias_member(alias_rid, &q_u->sid.sid) ? 0x0 : 0xC0000000 | NT_STATUS_ACCESS_DENIED;
unbecome_root(True);
}
else if (sid_equal(&alias_sid, &global_sid_S_1_5_20))
@@ -526,7 +526,7 @@ static void samr_reply_add_aliasmem(SAMR_Q_ADD_ALIASMEM *q_u,
DEBUG(10,("add member on BUILTIN SID\n"));
become_root(True);
- r_e.status = add_builtin_member(alias_rid, &q_u->sid) ? 0x0 : 0xC0000000 | NT_STATUS_ACCESS_DENIED;
+ r_e.status = add_builtin_member(alias_rid, &q_u->sid.sid) ? 0x0 : 0xC0000000 | NT_STATUS_ACCESS_DENIED;
unbecome_root(True);
}
else
@@ -2234,6 +2234,20 @@ static void samr_reply_query_dom_info(SAMR_Q_QUERY_DOMAIN_INFO *q_u,
{
switch (q_u->switch_value)
{
+ case 0x06:
+ {
+ switch_value = 0x6;
+ make_unk_info6(&ctr.info.inf6);
+
+ break;
+ }
+ case 0x07:
+ {
+ switch_value = 0x7;
+ make_unk_info7(&ctr.info.inf7);
+
+ break;
+ }
case 0x02:
{
switch_value = 0x2;
diff --git a/source3/rpc_server/srv_svcctl.c b/source3/rpc_server/srv_svcctl.c
new file mode 100644
index 0000000000..6ae8a5c873
--- /dev/null
+++ b/source3/rpc_server/srv_svcctl.c
@@ -0,0 +1,140 @@
+
+/*
+ * Unix SMB/Netbios implementation.
+ * Version 1.9.
+ * RPC Pipe client / server routines
+ * Copyright (C) Andrew Tridgell 1992-1997,
+ * Copyright (C) Luke Kenneth Casson Leighton 1996-1997,
+ * Copyright (C) Paul Ashton 1997.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#include "includes.h"
+#include "nterr.h"
+
+extern int DEBUGLEVEL;
+
+
+/*******************************************************************
+ svc_reply_unknown_1
+ ********************************************************************/
+static void svc_reply_close(SVC_Q_CLOSE *q_r,
+ prs_struct *rdata)
+{
+ SVC_R_CLOSE r_u;
+
+ /* set up the REG unknown_1 response */
+ bzero(r_u.pol.data, POL_HND_SIZE);
+
+ /* close the policy handle */
+ if (close_lsa_policy_hnd(&(q_r->pol)))
+ {
+ r_u.status = 0;
+ }
+ else
+ {
+ r_u.status = 0xC0000000 | NT_STATUS_OBJECT_NAME_INVALID;
+ }
+
+ DEBUG(5,("svc_unknown_1: %d\n", __LINE__));
+
+ /* store the response in the SMB stream */
+ svc_io_r_close("", &r_u, rdata, 0);
+
+ DEBUG(5,("svc_unknown_1: %d\n", __LINE__));
+}
+
+/*******************************************************************
+ api_svc_close
+ ********************************************************************/
+static void api_svc_close( uint16 vuid, prs_struct *data,
+ prs_struct *rdata )
+{
+ SVC_Q_CLOSE q_r;
+ svc_io_q_close("", &q_r, data, 0);
+ svc_reply_close(&q_r, rdata);
+}
+
+
+/*******************************************************************
+ svc_reply_open_policy
+ ********************************************************************/
+static void svc_reply_open_policy(SVC_Q_OPEN_POLICY *q_u,
+ prs_struct *rdata)
+{
+ uint32 status = 0;
+ POLICY_HND pol;
+ SVC_R_OPEN_POLICY r_u;
+ fstring name;
+
+ DEBUG(5,("svc_open_policy: %d\n", __LINE__));
+
+ if (status == 0x0 && !open_lsa_policy_hnd(&pol))
+ {
+ status = 0xC000000 | NT_STATUS_TOO_MANY_SECRETS; /* ha ha very droll */
+ }
+
+ fstrcpy(name, unistr2_to_str(&q_u->uni_srv_name));
+
+ if (status == 0x0)
+ {
+ DEBUG(5,("svc_open_policy: %s\n", name));
+ /* lkcl XXXX do a check on the name, here */
+ }
+
+ if (status == 0x0 && !set_lsa_policy_reg_name(&pol, name))
+ {
+ status = 0xC000000 | NT_STATUS_TOO_MANY_SECRETS; /* ha ha very droll */
+ }
+
+ make_svc_r_open_policy(&r_u, &pol, status);
+
+ /* store the response in the SMB stream */
+ svc_io_r_open_policy("", &r_u, rdata, 0);
+
+ DEBUG(5,("svc_open_policy: %d\n", __LINE__));
+}
+
+/*******************************************************************
+ api_svc_open_policy
+ ********************************************************************/
+static void api_svc_open_policy( uint16 vuid, prs_struct *data,
+ prs_struct *rdata )
+{
+ SVC_Q_OPEN_POLICY q_u;
+ svc_io_q_open_policy("", &q_u, data, 0);
+ svc_reply_open_policy(&q_u, rdata);
+}
+
+/*******************************************************************
+ array of \PIPE\svcctl operations
+ ********************************************************************/
+static struct api_struct api_svc_cmds[] =
+{
+ { "SVC_CLOSE" , SVC_CLOSE , api_svc_close },
+ { "SVC_OPEN_POLICY" , SVC_OPEN_POLICY , api_svc_open_policy },
+ { NULL, 0 , NULL }
+};
+
+/*******************************************************************
+ receives a svcctl pipe and responds.
+ ********************************************************************/
+BOOL api_svcctl_rpc(pipes_struct *p, prs_struct *data)
+{
+ return api_rpcTNP(p, "api_svc_rpc", api_svc_cmds, data);
+}
+