summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-19 15:15:09 -0800
committerJeremy Allison <jra@samba.org>2007-11-19 15:15:09 -0800
commit9a41314ce8582875e0ec59efb670279f39b42ce3 (patch)
tree8d32fb934b30f4080673338460029b489d4d6e2d /source3/nmbd/nmbd.c
parent551f9e7a6ccfefa48674f3b6a857485c60dfc2eb (diff)
downloadsamba-9a41314ce8582875e0ec59efb670279f39b42ce3.tar.gz
samba-9a41314ce8582875e0ec59efb670279f39b42ce3.tar.bz2
samba-9a41314ce8582875e0ec59efb670279f39b42ce3.zip
Remove pstring from nmbd.
Jeremy. (This used to be commit a317f70c229f7730279eaa323f7ebfd499257f76)
Diffstat (limited to 'source3/nmbd/nmbd.c')
-rw-r--r--source3/nmbd/nmbd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index beb178e59c..17e56b0756 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -287,8 +287,7 @@ static bool reload_nmbd_services(bool test)
set_remote_machine_name("nmbd", False);
if ( lp_loaded() ) {
- pstring fname;
- pstrcpy( fname,lp_configfile());
+ const char *fname = lp_configfile();
if (file_exist(fname,NULL) && !strcsequal(fname,dyn_CONFIGFILE)) {
pstrcpy(dyn_CONFIGFILE,fname);
test = False;
@@ -710,7 +709,6 @@ static bool open_sockets(bool isdaemon, int port)
static bool Fork = true;
static bool no_process_group;
static bool log_stdout;
- pstring logfile;
poptContext pc;
static char *p_lmhosts = dyn_LMHOSTSFILE;
int opt;
@@ -773,8 +771,12 @@ static bool open_sockets(bool isdaemon, int port)
sys_srandom(time(NULL) ^ sys_getpid());
if (!override_logfile) {
- slprintf(logfile, sizeof(logfile)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
+ char *logfile = NULL;
+ if (asprintf(&logfile, "%s/log.nmbd", dyn_LOGFILEBASE) < 0) {
+ exit(1);
+ }
lp_set_logfile(logfile);
+ SAFE_FREE(logfile);
}
fault_setup((void (*)(void *))fault_continue );