The Samba-Bugzilla – Attachment 11702 Details for
Bug 10722
samba-tool crashes with uncaught exception when parsing include = /path/to/%U.conf in smb.conf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.3.next, 4.2.next.
0001-lib-param-handle-ignore-substitution-variable-in-smb.patch (text/plain), 2.45 KB, created by
Jeremy Allison
on 2015-12-09 19:17:55 UTC
(
hide
)
Description:
git-am fix for 4.3.next, 4.2.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2015-12-09 19:17:55 UTC
Size:
2.45 KB
patch
obsolete
>From 8c8bf0de8a3dedc968a76b875d872a2cfda1d97b Mon Sep 17 00:00:00 2001 >From: Quentin Gibeaux <qgibeaux@iris-tech.fr> >Date: Thu, 29 Oct 2015 13:48:27 +0100 >Subject: [PATCH] lib/param: handle (ignore) substitution variable in smb.conf > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=10722 > >The function handle_include returns false when trying to include >files that have a substitution variable in filename (like %U), >this patch makes handle_include to ignore this case, to make >samba-tool work when there is such include in samba's configuration. > >Error was : > root@ubuntu:/usr/local/samba# grep 'include.*%U' etc/smb.conf > include = %U.conf > root@ubuntu:/usr/local/samba# ./bin/samba-tool user list > Can't find include file %U.conf > ERROR(runtime): uncaught exception - Unable to load default file > >Signed-off-by: Quentin Gibeaux <qgibeaux@iris-tech.fr> >Reviewed-by: Michael Adam <obnox@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> > >Autobuild-User(master): Jeremy Allison <jra@samba.org> >Autobuild-Date(master): Wed Dec 9 02:05:30 CET 2015 on sn-devel-104 > >(cherry picked from commit 3c6ea3293c6aac67bc442f47185fd494714e4806) >--- > lib/param/loadparm.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) > >diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c >index 7b75f13..cbd2a4c 100644 >--- a/lib/param/loadparm.c >+++ b/lib/param/loadparm.c >@@ -1109,6 +1109,8 @@ bool handle_include(struct loadparm_context *lp_ctx, struct loadparm_service *se > const char *pszParmValue, char **ptr) > { > char *fname; >+ const char *substitution_variable_substring; >+ char next_char; > > if (lp_ctx->s3_fns) { > return lp_ctx->s3_fns->lp_include(lp_ctx, service, pszParmValue, ptr); >@@ -1123,6 +1125,22 @@ bool handle_include(struct loadparm_context *lp_ctx, struct loadparm_service *se > if (file_exist(fname)) > return pm_process(fname, do_section, lpcfg_do_parameter, lp_ctx); > >+ /* >+ * If the file doesn't exist, we check that it isn't due to variable >+ * substitution >+ */ >+ substitution_variable_substring = strchr(fname, '%'); >+ >+ if (substitution_variable_substring != NULL) { >+ next_char = substitution_variable_substring[1]; >+ if ((next_char >= 'a' && next_char <= 'z') >+ || (next_char >= 'A' && next_char <= 'Z')) { >+ DEBUG(2, ("Tried to load %s but variable substitution in " >+ "filename, ignoring file.\n", fname)); >+ return true; >+ } >+ } >+ > DEBUG(2, ("Can't find include file %s\n", fname)); > > return false; >-- >2.6.0.rc2.230.g3dd15c0 >
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
Flags:
jra
:
review?
(
obnox
)
Actions:
View
Attachments on
bug 10722
:
10116
|
10170
|
10171
|
10257
|
11420
|
11551
|
11552
|
11553
|
11554
|
11555
| 11702