summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-06 18:14:56 +0000
committerJeremy Allison <jra@samba.org>1998-04-06 18:14:56 +0000
commit724cab4d08d631c0afaac5e77356ca5336562eb0 (patch)
tree011014dca41623544ab82532571702171cbd485c /source3
parentf9c698b5eb6cd979591473bfab9ce1b9b71bb3fe (diff)
downloadsamba-724cab4d08d631c0afaac5e77356ca5336562eb0.tar.gz
samba-724cab4d08d631c0afaac5e77356ca5336562eb0.tar.bz2
samba-724cab4d08d631c0afaac5e77356ca5336562eb0.zip
loadparm.c: Cause IPC$ comment to be evaluated at runtime, rather than
load time (patch from "Marty Leisner" <leisner@sdsp.mc.xerox.com>. server.c: Patch from Josef Hinteregger <joehtg@joehtg.co.at> - string could be overwritten when find_service() called recursively. Jeremy. (This used to be commit cf15b3bd74a262e7af3d739a83ef7b43df4935e5)
Diffstat (limited to 'source3')
-rw-r--r--source3/param/loadparm.c2
-rw-r--r--source3/smbd/server.c12
2 files changed, 11 insertions, 3 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 20479bf96d..837632788e 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -1232,7 +1232,7 @@ static BOOL lp_add_ipc(void)
if (i < 0)
return(False);
- sprintf(comment,"IPC Service (%s)",lp_serverstring());
+ sprintf(comment,"IPC Service (%s)", Globals.szServerString );
string_set(&iSERVICE(i).szPath,tmpdir());
string_set(&iSERVICE(i).szUsername,"");
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 8166021fc2..d0b0304430 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -2214,8 +2214,16 @@ int find_service(char *service)
/* just possibly it's a default service? */
if (iService < 0)
{
- char *defservice = lp_defaultservice();
- if (defservice && *defservice && !strequal(defservice,service)) {
+ char *pdefservice = lp_defaultservice();
+ if (pdefservice && *pdefservice && !strequal(pdefservice,service)) {
+ /*
+ * We need to do a local copy here as lp_defaultservice()
+ * returns one of the rotating lp_string buffers that
+ * could get overwritten by the recursive find_service() call
+ * below. Fix from Josef Hinteregger <joehtg@joehtg.co.at>.
+ */
+ pstring defservice;
+ pstrcpy(defservice, pdefservice);
iService = find_service(defservice);
if (iService >= 0) {
string_sub(service,"_","/");