summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-03-13 00:31:07 +0000
committerJeremy Allison <jra@samba.org>2001-03-13 00:31:07 +0000
commitd3ec09326b27dd00b1f67a7ce48bc9817a313735 (patch)
treeacf925081e3580efb83a73163c54c1ea3b954656 /source3
parentea35aae3bfad9c73a6768abcd76726b26b6c4f9a (diff)
downloadsamba-d3ec09326b27dd00b1f67a7ce48bc9817a313735.tar.gz
samba-d3ec09326b27dd00b1f67a7ce48bc9817a313735.tar.bz2
samba-d3ec09326b27dd00b1f67a7ce48bc9817a313735.zip
Added ADMIN$ share as alias for IPC$ except no guest connect. AS/U wants
to do RPC calls down this treeid. Jeremy. (This used to be commit 83133bab0ed59e303a183fd91812165f08e88484)
Diffstat (limited to 'source3')
-rw-r--r--source3/param/loadparm.c12
-rw-r--r--source3/smbd/service.c6
2 files changed, 10 insertions, 8 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 0593d2d190..eafed8172a 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1803,10 +1803,10 @@ int lp_add_service(char *pszService, int iDefaultService)
/***************************************************************************
add the IPC service
***************************************************************************/
-static BOOL lp_add_ipc(void)
+static BOOL lp_add_ipc(char *ipc_name, BOOL guest_ok)
{
pstring comment;
- int i = add_a_service(&sDefault, "IPC$");
+ int i = add_a_service(&sDefault, ipc_name);
if (i < 0)
return (False);
@@ -1823,7 +1823,7 @@ static BOOL lp_add_ipc(void)
iSERVICE(i).bAvailable = True;
iSERVICE(i).bRead_only = True;
iSERVICE(i).bGuest_only = False;
- iSERVICE(i).bGuest_ok = True;
+ iSERVICE(i).bGuest_ok = guest_ok;
iSERVICE(i).bPrint_ok = False;
iSERVICE(i).bBrowseable = sDefault.bBrowseable;
@@ -3244,8 +3244,10 @@ BOOL lp_load(char *pszFname, BOOL global_only, BOOL save_defaults,
lp_add_auto_services(lp_auto_services());
- if (add_ipc)
- lp_add_ipc();
+ if (add_ipc) {
+ lp_add_ipc("IPC$", True);
+ lp_add_ipc("ADMIN$", False);
+ }
set_server_role();
set_default_server_announce_type();
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 02405e8dda..2c03d4e514 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -234,7 +234,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
snum = find_service(service);
if (snum < 0) {
- if (strequal(service,"IPC$")) {
+ if (strequal(service,"IPC$") || strequal(service,"ADMIN$")) {
DEBUG(3,("refusing IPC connection\n"));
*ecode = ERRnoipc;
return NULL;
@@ -284,7 +284,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
}
/* you can only connect to the IPC$ service as an ipc device */
- if (strequal(service,"IPC$"))
+ if (strequal(service,"IPC$") || strequal(service,"ADMIN$"))
pstrcpy(dev,"IPC");
if (*dev == '?' || !*dev) {
@@ -386,7 +386,7 @@ connection_struct *make_connection(char *service,char *user,char *password, int
conn->service = snum;
conn->used = True;
conn->printer = (strncmp(dev,"LPT",3) == 0);
- conn->ipc = (strncmp(dev,"IPC",3) == 0);
+ conn->ipc = ((strncmp(dev,"IPC",3) == 0) || strequal(dev,"ADMIN$"));
conn->dirptr = NULL;
conn->veto_list = NULL;
conn->hide_list = NULL;