summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-06 17:41:47 +0000
committerJeremy Allison <jra@samba.org>2001-04-06 17:41:47 +0000
commit3874261774ef9b56461602b4aea3cf4e7b9cc5a0 (patch)
tree48fd16e3932124e1c62a63a418c1f32520ca7213 /source3/rpc_server
parentfd4c525d5832d80fc7684255f94c606bb83c0e28 (diff)
downloadsamba-3874261774ef9b56461602b4aea3cf4e7b9cc5a0.tar.gz
samba-3874261774ef9b56461602b4aea3cf4e7b9cc5a0.tar.bz2
samba-3874261774ef9b56461602b4aea3cf4e7b9cc5a0.zip
Added stub function for NET_SHARE_ADD. Once this is implemented to call a hook
function (same for NET_SHARE_DELETE and NET_SHARE_SET) we will be able to manage the shares section in smb.conf via NT server manager........ This should enhance the friendliness of Samba in NT-only shops by an order of magnitude. Jeremy. (This used to be commit a2cd5f2ba11164a17622b96374ab43070f9ed691)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_srvsvc.c31
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c40
2 files changed, 71 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c
index 95896f36c8..d588298c88 100644
--- a/source3/rpc_server/srv_srvsvc.c
+++ b/source3/rpc_server/srv_srvsvc.c
@@ -258,6 +258,36 @@ static BOOL api_srv_net_share_set_info(pipes_struct *p)
}
/*******************************************************************
+ RPC to add share information. Use the SET wire format.
+********************************************************************/
+
+static BOOL api_srv_net_share_add(pipes_struct *p)
+{
+ SRV_Q_NET_SHARE_ADD q_u;
+ SRV_R_NET_SHARE_ADD r_u;
+ prs_struct *data = &p->in_data.data;
+ prs_struct *rdata = &p->out_data.rdata;
+
+ ZERO_STRUCT(q_u);
+ ZERO_STRUCT(r_u);
+
+ /* Unmarshall the net server add info. */
+ if(!srv_io_q_net_share_add("", &q_u, data, 0)) {
+ DEBUG(0,("api_srv_net_share_add: Failed to unmarshall SRV_Q_NET_SHARE_ADD.\n"));
+ return False;
+ }
+
+ r_u.status = _srv_net_share_add(p, &q_u, &r_u);
+
+ if(!srv_io_r_net_share_add("", &r_u, rdata, 0)) {
+ DEBUG(0,("api_srv_net_share_add: Failed to marshall SRV_R_NET_SHARE_ADD.\n"));
+ return False;
+ }
+
+ return True;
+}
+
+/*******************************************************************
api_srv_net_remote_tod
********************************************************************/
@@ -294,6 +324,7 @@ struct api_struct api_srv_cmds[] =
{ "SRV_NETSESSENUM" , SRV_NETSESSENUM , api_srv_net_sess_enum },
{ "SRV_NETSHAREENUM_ALL" , SRV_NETSHAREENUM_ALL , api_srv_net_share_enum_all },
{ "SRV_NETSHAREENUM" , SRV_NETSHAREENUM , api_srv_net_share_enum },
+ { "SRV_NET_SHARE_ADD" , SRV_NET_SHARE_ADD , api_srv_net_share_add },
{ "SRV_NET_SHARE_GET_INFO", SRV_NET_SHARE_GET_INFO, api_srv_net_share_get_info },
{ "SRV_NET_SHARE_SET_INFO", SRV_NET_SHARE_SET_INFO, api_srv_net_share_set_info },
{ "SRV_NETFILEENUM" , SRV_NETFILEENUM , api_srv_net_file_enum },
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 82a299d18e..acb8846db6 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -994,6 +994,46 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
}
/*******************************************************************
+ Net share add. Stub for now. JRA.
+********************************************************************/
+
+uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_SHARE_ADD *r_u)
+{
+ uint32 status = NT_STATUS_NOPROBLEMO;
+
+ DEBUG(5,("_srv_net_share_add: %d\n", __LINE__));
+
+ r_u->switch_value = q_u->info_level;
+
+ switch (q_u->info_level) {
+ case 1:
+ status = ERROR_ACCESS_DENIED;
+ break;
+ case 2:
+ status = ERROR_ACCESS_DENIED;
+ break;
+ case 502:
+ /* we set sd's here. FIXME. JRA */
+ status = ERROR_ACCESS_DENIED;
+ break;
+ case 1005:
+ status = ERROR_ACCESS_DENIED;
+ break;
+ default:
+ DEBUG(5,("_srv_net_share_add: unsupported switch value %d\n", q_u->info_level));
+ status = NT_STATUS_INVALID_INFO_CLASS;
+ break;
+ }
+
+ r_u->switch_value = 0;
+ r_u->status = status;
+
+ DEBUG(5,("_srv_net_share_add: %d\n", __LINE__));
+
+ return r_u->status;
+}
+
+/*******************************************************************
time of day
********************************************************************/