The Samba-Bugzilla – Attachment 7106 Details for
Bug 8610
libsmbclient: No method to set the smb.conf path
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to use SMB_CONF environment entry as first choice
x.patch (text/plain), 1.57 KB, created by
Derrell Lipman
on 2011-11-16 01:51:14 UTC
(
hide
)
Description:
Patch to use SMB_CONF environment entry as first choice
Filename:
MIME Type:
Creator:
Derrell Lipman
Created:
2011-11-16 01:51:14 UTC
Size:
1.57 KB
patch
obsolete
>diff --git a/source3/libsmb/libsmb_context.c b/source3/libsmb/libsmb_context.c >index 6c78cb9..0a73071 100644 >--- a/source3/libsmb/libsmb_context.c >+++ b/source3/libsmb/libsmb_context.c >@@ -44,6 +44,7 @@ SMBC_module_init(void * punused) > { > bool conf_loaded = False; > char *home = NULL; >+ char *conf = NULL; > TALLOC_CTX *frame = talloc_stackframe(); > > load_case_tables_library(); >@@ -52,17 +53,29 @@ SMBC_module_init(void * punused) > > /* Here we would open the smb.conf file if needed ... */ > >- home = getenv("HOME"); >- if (home) { >- char *conf = NULL; >- if (asprintf(&conf, "%s/.smb/smb.conf", home) > 0) { >- if (lp_load_client(conf)) { >- conf_loaded = True; >- } else { >- DEBUG(5, ("Could not load config file: %s\n", >- conf)); >+ conf = getenv("SMB_CONF"); >+ if (conf) { >+ if (lp_load_client(conf)) { >+ conf_loaded = True; >+ } else { >+ DEBUG(5, ("Could not load config file: %s\n", >+ conf)); >+ } >+ } >+ >+ if (!conf_loaded) { >+ home = getenv("HOME"); >+ if (home) { >+ char *conf = NULL; >+ if (asprintf(&conf, "%s/.smb/smb.conf", home) > 0) { >+ if (lp_load_client(conf)) { >+ conf_loaded = True; >+ } else { >+ DEBUG(5, ("Could not load config file: %s\n", >+ conf)); >+ } >+ SAFE_FREE(conf); > } >- SAFE_FREE(conf); > } > } >
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 8610
: 7106