The Samba-Bugzilla – Attachment 9246 Details for
Bug 8935
Unable to map drive when "default service" is assign in smb.conf file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Raw patch for 3.6.x
look (text/plain), 4.57 KB, created by
Jeremy Allison
on 2013-09-27 13:51:58 UTC
(
hide
)
Description:
Raw patch for 3.6.x
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2013-09-27 13:51:58 UTC
Size:
4.57 KB
patch
obsolete
>diff --git a/source3/include/proto.h b/source3/include/proto.h >index 7303e76..53b91dd 100644 >--- a/source3/include/proto.h >+++ b/source3/include/proto.h >@@ -1713,7 +1713,7 @@ int lp_parm_enum(int snum, const char *type, const char *option, > char *canonicalize_servicename(TALLOC_CTX *ctx, const char *src); > bool lp_add_home(const char *pszHomename, int iDefaultService, > const char *user, const char *pszHomedir); >-int lp_add_service(const char *pszService, int iDefaultService); >+int lp_add_default_service(const char *pszService, int iDefaultService); > bool lp_add_printer(const char *pszPrintername, int iDefaultService); > bool lp_parameter_is_valid(const char *pszParmName); > bool lp_parameter_is_global(const char *pszParmName); >diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c >index dd63339..69a7d9d 100644 >--- a/source3/param/loadparm.c >+++ b/source3/param/loadparm.c >@@ -384,6 +384,7 @@ struct global { > int ismb2_max_write; > int ismb2_max_trans; > int ismb2_max_credits; >+ int iMaxDefaultServices; > char *ncalrpc_dir; > }; > >@@ -395,6 +396,7 @@ static struct global Globals; > struct service { > bool valid; > bool autoloaded; >+ bool from_default_service; > int usershare; > struct timespec usershare_last_mod; > char *szService; >@@ -540,6 +542,7 @@ struct service { > static struct service sDefault = { > True, /* valid */ > False, /* not autoloaded */ >+ false, /* not from a default service */ > 0, /* not a usershare */ > {0, }, /* No last mod time */ > NULL, /* szService */ >@@ -4024,6 +4027,15 @@ static struct parm_struct parm_table[] = { > .flags = FLAG_ADVANCED, > }, > { >+ .label = "max default services", >+ .type = P_INTEGER, >+ .p_class = P_GLOBAL, >+ .ptr = &Globals.iMaxDefaultServices, >+ .special = NULL, >+ .enum_list = NULL, >+ .flags = FLAG_ADVANCED, >+ }, >+ { > .label = "message command", > .type = P_STRING, > .p_class = P_GLOBAL, >@@ -5493,6 +5505,8 @@ static void init_globals(bool reinit_globals) > Globals.ismb2_max_trans = DEFAULT_SMB2_MAX_TRANSACT; > Globals.ismb2_max_credits = DEFAULT_SMB2_MAX_CREDITS; > >+ Globals.iMaxDefaultServices = 10; >+ > string_set(&Globals.ncalrpc_dir, get_dyn_NCALRPCDIR()); > > /* Now put back the settings that were set with lp_set_cmdline() */ >@@ -6373,6 +6387,10 @@ static void free_service(struct service *pservice) > DEBUG(5, ("free_service: Freeing service %s\n", > pservice->szService)); > >+ if (pservice->from_default_service) { >+ Globals.iMaxDefaultServices += 1; >+ } >+ > free_parameters(pservice); > > string_free(&pservice->szService); >@@ -6585,16 +6603,24 @@ bool lp_add_home(const char *pszHomename, int iDefaultService, > } > > /*************************************************************************** >- Add a new service, based on an old one. >+ Add a new service, based on the default service > ***************************************************************************/ > >-int lp_add_service(const char *pszService, int iDefaultService) >+int lp_add_default_service(const char *pszService, int iDefaultService) > { >- if (iDefaultService < 0) { >- return add_a_service(&sDefault, pszService); >+ int ret; >+ >+ if (Globals.iMaxDefaultServices == 0) { >+ return -1; > } > >- return (add_a_service(ServicePtrs[iDefaultService], pszService)); >+ ret = add_a_service(ServicePtrs[iDefaultService], pszService); >+ if (ret < 0) { >+ return -1; >+ } >+ ServicePtrs[iDefaultService]->from_default_service = true; >+ Globals.iMaxDefaultServices -= 1; >+ return ret; > } > > /*************************************************************************** >diff --git a/source3/smbd/service.c b/source3/smbd/service.c >index a22b0df..0364316 100644 >--- a/source3/smbd/service.c >+++ b/source3/smbd/service.c >@@ -402,6 +402,7 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out) > * below. Fix from Josef Hinteregger <joehtg@joehtg.co.at>. > */ > char *defservice = talloc_strdup(ctx, pdefservice); >+ char *def_service_out = NULL; > > if (!defservice) { > goto fail; >@@ -415,17 +416,18 @@ int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out) > goto fail; > } > >- iService = find_service(ctx, defservice, p_service_out); >- if (!*p_service_out) { >+ iService = find_service(ctx, defservice, &def_service_out); >+ if (!def_service_out) { > TALLOC_FREE(defservice); > iService = -1; > goto fail; > } > if (iService >= 0) { > all_string_sub(*p_service_out, "_","/",0); >- iService = lp_add_service(*p_service_out, iService); >+ iService = lp_add_default_service(*p_service_out, iService); > } > TALLOC_FREE(defservice); >+ TALLOC_FREE(def_service_out); > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8935
: 9246 |
11964