diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-20 17:18:16 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-20 17:18:16 -0800 |
commit | 66298d808034bb606478ff66aa156bda4e7e3f2a (patch) | |
tree | d331f5ab23f562fddfcbd1d278d60ff583ec09ff /source3/winbindd | |
parent | c049b8157d0bb4b5cd57b66740a26813be4f9eba (diff) | |
download | samba-66298d808034bb606478ff66aa156bda4e7e3f2a.tar.gz samba-66298d808034bb606478ff66aa156bda4e7e3f2a.tar.bz2 samba-66298d808034bb606478ff66aa156bda4e7e3f2a.zip |
More pstring elimination.
Jeremy.
(This used to be commit 15074de938539e7a9c527d9a6d81792adc2ac3d0)
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/winbindd.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 2167cfcdfc..4194b55894 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -61,9 +61,8 @@ static bool reload_services_file(void) bool ret; if (lp_loaded()) { - pstring fname; + const char *fname = lp_configfile(); - pstrcpy(fname,lp_configfile()); if (file_exist(fname,NULL) && !strcsequal(fname,dyn_CONFIGFILE)) { pstrcpy(dyn_CONFIGFILE,fname); } @@ -129,12 +128,14 @@ static void flush_caches(void) static void terminate(void) { - pstring path; + char *path = NULL; /* Remove socket file */ - pstr_sprintf(path, "%s/%s", - get_winbind_pipe_dir(), WINBINDD_SOCKET_NAME); - unlink(path); + if (asprintf(&path, "%s/%s", + get_winbind_pipe_dir(), WINBINDD_SOCKET_NAME) > 0) { + unlink(path); + SAFE_FREE(path); + } idmap_close(); @@ -983,7 +984,6 @@ static void process_loop(void) int main(int argc, char **argv, char **envp) { - pstring logfile; static bool is_daemon = False; static bool Fork = True; static bool log_stdout = False; @@ -1086,8 +1086,12 @@ int main(int argc, char **argv, char **envp) poptFreeContext(pc); if (!override_logfile) { - pstr_sprintf(logfile, "%s/log.winbindd", dyn_LOGFILEBASE); - lp_set_logfile(logfile); + char *logfile = NULL; + if (asprintf(&logfile,"%s/log.winbindd", + dyn_LOGFILEBASE) > 0) { + lp_set_logfile(logfile); + SAFE_FREE(logfile); + } } setup_logging("winbindd", log_stdout); reopen_logs(); |