The Samba-Bugzilla – Attachment 11964 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]
[patch] updated patch for 4.4.x
0001-param-Added-max-default-services-to-restore-behavior.patch (text/plain), 6.43 KB, created by
Guillaume Xavier Taillon (mail address dead)
on 2016-04-05 16:58:00 UTC
(
hide
)
Description:
[patch] updated patch for 4.4.x
Filename:
MIME Type:
Creator:
Guillaume Xavier Taillon (mail address dead)
Created:
2016-04-05 16:58:00 UTC
Size:
6.43 KB
patch
obsolete
>From bd2f5d072aeef03993cc92afdcb00bce16320768 Mon Sep 17 00:00:00 2001 >From: Guillaume Xavier Taillon <gtaillon@ca.ibm.com> >Date: Tue, 22 Mar 2016 10:45:49 -0400 >Subject: [PATCH] param:Added "max default services" to restore behavior of > "default service" > >Updated patch for master of original raw patch for 3.6 from Jeremy Allison. > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=8935 >Signed-off-by: Guillaume Xavier Taillon <gtaillon@ca.ibm.com> >--- > docs-xml/smbdotconf/misc/defaultservice.xml | 7 ++++--- > docs-xml/smbdotconf/misc/maxdefaultservices.xml | 13 +++++++++++++ > lib/param/loadparm.h | 1 + > source3/include/proto.h | 2 +- > source3/param/loadparm.c | 25 ++++++++++++++++++++----- > source3/param/service.c | 8 +++++--- > 6 files changed, 44 insertions(+), 12 deletions(-) > create mode 100644 docs-xml/smbdotconf/misc/maxdefaultservices.xml > >diff --git a/docs-xml/smbdotconf/misc/defaultservice.xml b/docs-xml/smbdotconf/misc/defaultservice.xml >index 788506f..f80febb 100644 >--- a/docs-xml/smbdotconf/misc/defaultservice.xml >+++ b/docs-xml/smbdotconf/misc/defaultservice.xml >@@ -10,9 +10,10 @@ > be found. Note that the square brackets are <emphasis>NOT</emphasis> > given in the parameter value (see example below).</para> > >- <para>There is no default value for this parameter. If this >- parameter is not given, attempting to connect to a nonexistent >- service results in an error.</para> >+ <para>There is no default value for this parameter. If this >+ parameter is not given, or if <smbconfoption >+ name="max default services"/> is not more than 0, attempting to >+ connect to a nonexistent service results in an error.</para> > > <para> > Typically the default service would be a <smbconfoption name="guest ok"/>, <smbconfoption >diff --git a/docs-xml/smbdotconf/misc/maxdefaultservices.xml b/docs-xml/smbdotconf/misc/maxdefaultservices.xml >new file mode 100644 >index 0000000..6b802f6 >--- /dev/null >+++ b/docs-xml/smbdotconf/misc/maxdefaultservices.xml >@@ -0,0 +1,13 @@ >+<samba:parameter name="max default services" >+ context="G" >+ type="integer" >+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc"> >+<description> >+ <para>This parameter specifies how many shares a client can connect >+ to by using <smbconfoption name="default service"/></para>. If set >+ to zero (the default) no connections are allowed using the default >+ service.</para> >+</description> >+<value type="default">0</value> >+<value type="example">15</value> >+</samba:parameter> >diff --git a/lib/param/loadparm.h b/lib/param/loadparm.h >index b453aca..b8ee867 100644 >--- a/lib/param/loadparm.h >+++ b/lib/param/loadparm.h >@@ -243,6 +243,7 @@ enum case_handling {CASE_LOWER,CASE_UPPER}; > #define DEFAULT_SMB2_MAX_CREDITS 8192 > > #define LOADPARM_EXTRA_LOCALS \ >+ bool from_default_service \ > int usershare; \ > struct timespec usershare_last_mod; \ > char *szService; \ >diff --git a/source3/include/proto.h b/source3/include/proto.h >index dc8fee9..d906a6e 100644 >--- a/source3/include/proto.h >+++ b/source3/include/proto.h >@@ -925,7 +925,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 1f8e578..5bee46e 100644 >--- a/source3/param/loadparm.c >+++ b/source3/param/loadparm.c >@@ -113,6 +113,7 @@ static struct loadparm_service sDefault = > { > .valid = true, > .autoloaded = false, >+ .from_default_service = false, > .usershare = 0, > .usershare_last_mod = {0, 0}, > .szService = NULL, >@@ -1326,6 +1327,10 @@ static void free_service(struct loadparm_service *pservice) > DEBUG(5, ("free_service: Freeing service %s\n", > pservice->szService)); > >+ if (pservice->from_default_service) { >+ Globals.max_default_services += 1; >+ } >+ > free_parameters(pservice); > > lpcfg_string_free(&pservice->szService); >@@ -1529,16 +1534,26 @@ 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.max_default_services == 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.max_default_services -= 1; >+ >+ return ret; > } > > /*************************************************************************** >diff --git a/source3/param/service.c b/source3/param/service.c >index b21be60..a88dfa7 100644 >--- a/source3/param/service.c >+++ b/source3/param/service.c >@@ -207,6 +207,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; >@@ -220,17 +221,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); > } > } > >-- >1.8.3.1 >
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