1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

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 commit is contained in:
Jeremy Allison
-
parent e6a083451f
commit cf15b3bd74
2 changed files with 11 additions and 3 deletions

View File

@ -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,"");

View File

@ -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,"_","/");