The Samba-Bugzilla – Attachment 1507 Details for
Bug 3166
getenv(HOME) null pointer dereference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch I've applied to 3.0
look (text/plain), 2.18 KB, created by
Jeremy Allison
on 2005-10-13 11:08:14 UTC
(
hide
)
Description:
Patch I've applied to 3.0
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2005-10-13 11:08:14 UTC
Size:
2.18 KB
patch
obsolete
>Index: libsmb/libsmbclient.c >=================================================================== >--- libsmb/libsmbclient.c (revision 10968) >+++ libsmb/libsmbclient.c (working copy) >@@ -5539,6 +5539,7 @@ > > if (!smbc_initialized) { > /* Do some library wide intialisations the first time we get called */ >+ BOOL conf_loaded = False; > > /* Set this to what the user wants */ > DEBUGLEVEL = context->debug; >@@ -5547,16 +5548,22 @@ > > /* Here we would open the smb.conf file if needed ... */ > >- home = getenv("HOME"); >- >- slprintf(conf, sizeof(conf), "%s/.smb/smb.conf", home); >- > load_interfaces(); /* Load the list of interfaces ... */ > > in_client = True; /* FIXME, make a param */ > >- if (!lp_load(conf, True, False, False)) { >- >+ home = getenv("HOME"); >+ if (home) { >+ slprintf(conf, sizeof(conf), "%s/.smb/smb.conf", home); >+ if (lp_load(conf, True, False, False)) { >+ conf_loaded = True; >+ } else { >+ DEBUG(5, ("Could not load config file: %s\n", >+ conf)); >+ } >+ } >+ >+ if (!conf_loaded) { > /* > * Well, if that failed, try the dyn_CONFIGFILE > * Which points to the standard locn, and if that >@@ -5565,10 +5572,9 @@ > */ > > if (!lp_load(dyn_CONFIGFILE, True, False, False)) { >- DEBUG(5, ("Could not load either config file: " >- "%s or %s\n", >- conf, dyn_CONFIGFILE)); >- } else { >+ DEBUG(5, ("Could not load config file: %s\n", >+ dyn_CONFIGFILE)); >+ } else if (home) { > /* > * We loaded the global config file. Now lets > * load user-specific modifications to the
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 3166
: 1507