summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_reg.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2001-08-23 23:25:34 +0000
committerSimo Sorce <idra@samba.org>2001-08-23 23:25:34 +0000
commit8ef7ddba65f326df69d3ff247491a0df1fa89578 (patch)
treedb8d4a3598f771de03ce2a56e14bc04e8f350858 /source3/rpc_server/srv_reg.c
parentc50da047a1a7c64d3017f9d4b12391f384205072 (diff)
downloadsamba-8ef7ddba65f326df69d3ff247491a0df1fa89578.tar.gz
samba-8ef7ddba65f326df69d3ff247491a0df1fa89578.tar.bz2
samba-8ef7ddba65f326df69d3ff247491a0df1fa89578.zip
so let admins shutdown their samba servers remotely if they want :-)
(This used to be commit 6391fd7bdab07c83e9eed02e761db09918e60302)
Diffstat (limited to 'source3/rpc_server/srv_reg.c')
-rw-r--r--source3/rpc_server/srv_reg.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_reg.c b/source3/rpc_server/srv_reg.c
index 2a0e2d172c..105230a22f 100644
--- a/source3/rpc_server/srv_reg.c
+++ b/source3/rpc_server/srv_reg.c
@@ -134,6 +134,32 @@ static BOOL api_reg_info(pipes_struct *p)
return True;
}
+/*******************************************************************
+ api_reg_shutdown
+ ********************************************************************/
+
+static BOOL api_reg_shutdown(pipes_struct *p)
+{
+ REG_Q_SHUTDOWN q_u;
+ REG_R_SHUTDOWN r_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ ZERO_STRUCT(q_u);
+ ZERO_STRUCT(r_u);
+
+ /* grab the reg shutdown */
+ if(!reg_io_q_shutdown("", &q_u, data, 0))
+ return False;
+
+ r_u.status = _reg_shutdown(p, &q_u, &r_u);
+
+ if(!reg_io_r_shutdown("", &r_u, rdata, 0))
+ return False;
+
+ return True;
+}
+
/*******************************************************************
array of \PIPE\reg operations
@@ -144,6 +170,8 @@ static struct api_struct api_reg_cmds[] =
{ "REG_OPEN_ENTRY" , REG_OPEN_ENTRY , api_reg_open_entry },
{ "REG_OPEN" , REG_OPEN_HKLM , api_reg_open },
{ "REG_INFO" , REG_INFO , api_reg_info },
+ { "REG_SHUTDOWN" , REG_SHUTDOWN , api_reg_shutdown },
+/* { "REG_ABORT_SHUTDOWN", REG_ABORT_SHUTDOWN, api_reg_abrot_shutdown }, */
{ NULL, 0 , NULL }
};