summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-11 10:35:38 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-11 02:57:04 +0000
commited8ea4ed18f08bfc93190513f2a2e8e058655daf (patch)
treeccebab2f84ec3639a3681126893f7fcd6c337fbc /source4/ntvfs
parent0afb2995a2177afa2eb7b8f99887a39cdaf23a15 (diff)
downloadsamba-ed8ea4ed18f08bfc93190513f2a2e8e058655daf.tar.gz
samba-ed8ea4ed18f08bfc93190513f2a2e8e058655daf.tar.bz2
samba-ed8ea4ed18f08bfc93190513f2a2e8e058655daf.zip
s4-server: move the creation of the IPC$ share into ntvfs
the IPC$ share is only used by the ntvfs backends, and doesn't need to be created on every load of smb.conf. This fixes a problem with testparm showing the ipc$ share when it isn't defined in smb.conf. This also removes the admin$ share, which really shouldn't be on by default. The admin$ share is used for remote software installation, and normally exposes the c:\windows directory on a windows server. That makes no sense on Samba. If for some reason a admin$ share is needed, then the admin can create one as usual. Exposing /tmp via admin$ by default seems like a bad idea. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/ntvfs_base.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c
index d8d73e95fe..1b1a53361b 100644
--- a/source4/ntvfs/ntvfs_base.c
+++ b/source4/ntvfs/ntvfs_base.c
@@ -200,6 +200,30 @@ NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, struct share_config *scfg, e
return NT_STATUS_OK;
}
+/*
+ adds the IPC$ share, needed for RPC calls
+ */
+static NTSTATUS ntvfs_add_ipc_share(struct loadparm_context *lp_ctx)
+{
+ struct loadparm_service *ipc;
+
+ if (lpcfg_service(lp_ctx, "IPC$")) {
+ /* it has already been defined in smb.conf or elsewhere */
+ return NT_STATUS_OK;
+ }
+
+ ipc = lpcfg_add_service(lp_ctx, NULL, "IPC$");
+ NT_STATUS_HAVE_NO_MEMORY(ipc);
+
+ lpcfg_do_service_parameter(lp_ctx, ipc, "comment", "IPC Service");
+ lpcfg_do_service_parameter(lp_ctx, ipc, "path", "/dev/null");
+ lpcfg_do_service_parameter(lp_ctx, ipc, "ntvfs handler", "default");
+ lpcfg_do_service_parameter(lp_ctx, ipc, "browseable", "No");
+ lpcfg_do_service_parameter(lp_ctx, ipc, "fstype", "IPC");
+
+ return NT_STATUS_OK;
+}
+
NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
{
static bool initialized = false;
@@ -217,6 +241,8 @@ NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
run_init_functions(shared_init);
talloc_free(shared_init);
+
+ ntvfs_add_ipc_share(lp_ctx);
return NT_STATUS_OK;
}