From 7faee02d0d351c5c039e8f1be7e82ce3a93cbe96 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Mon, 10 Dec 2007 11:30:37 -0800 Subject: Remove the char[1024] strings from dynconfig. Replace them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05) --- source3/winbindd/idmap.c | 2 +- source3/winbindd/winbindd.c | 8 ++++---- source3/winbindd/winbindd_cm.c | 2 +- source3/winbindd/winbindd_dual.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index d2c13ab8b7..af8ec17b4e 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -333,7 +333,7 @@ NTSTATUS idmap_init(void) DEBUG(0, ("WARNING: idmap backend uses obsolete" " and deprecated 'idmap_' prefix.\n" "Please replace 'idmap_%s' by '%s' in" - " %s\n", q, q, dyn_CONFIGFILE)); + " %s\n", q, q, get_dyn_CONFIGFILE())); compat_backend = talloc_strdup(idmap_ctx, q); } else { compat_backend = talloc_strdup(idmap_ctx, diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c index 53571d6002..598ec8e428 100644 --- a/source3/winbindd/winbindd.c +++ b/source3/winbindd/winbindd.c @@ -63,13 +63,13 @@ static bool reload_services_file(void) if (lp_loaded()) { const char *fname = lp_configfile(); - if (file_exist(fname,NULL) && !strcsequal(fname,dyn_CONFIGFILE)) { - strlcpy(dyn_CONFIGFILE,fname,sizeof(dyn_CONFIGFILE)); + if (file_exist(fname,NULL) && !strcsequal(fname,get_dyn_CONFIGFILE())) { + set_dyn_CONFIGFILE(fname); } } reopen_logs(); - ret = lp_load(dyn_CONFIGFILE,False,False,True,True); + ret = lp_load(get_dyn_CONFIGFILE(),False,False,True,True); reopen_logs(); load_interfaces(); @@ -1088,7 +1088,7 @@ int main(int argc, char **argv, char **envp) if (!override_logfile) { char *logfile = NULL; if (asprintf(&logfile,"%s/log.winbindd", - dyn_LOGFILEBASE) > 0) { + get_dyn_LOGFILEBASE()) > 0) { lp_set_logfile(logfile); SAFE_FREE(logfile); } diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c index b64937da23..3f6544965d 100644 --- a/source3/winbindd/winbindd_cm.c +++ b/source3/winbindd/winbindd_cm.c @@ -209,7 +209,7 @@ static bool fork_child_dc_connect(struct winbindd_domain *domain) if (!override_logfile) { char *logfile; - if (asprintf(&logfile, "%s/log.winbindd-dc-connect", dyn_LOGFILEBASE) > 0) { + if (asprintf(&logfile, "%s/log.winbindd-dc-connect", get_dyn_LOGFILEBASE()) > 0) { lp_set_logfile(logfile); SAFE_FREE(logfile); reopen_logs(); diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c index 91e60cca36..1e76c12d4b 100644 --- a/source3/winbindd/winbindd_dual.c +++ b/source3/winbindd/winbindd_dual.c @@ -472,12 +472,12 @@ void setup_domain_child(struct winbindd_domain *domain, { if (explicit_logfile != NULL) { if (asprintf(&child->logfilename, "%s/log.winbindd-%s", - dyn_LOGFILEBASE, explicit_logfile) < 0) { + get_dyn_LOGFILEBASE(), explicit_logfile) < 0) { smb_panic("Internal error: asprintf failed"); } } else if (domain != NULL) { if (asprintf(&child->logfilename, "%s/log.wb-%s", - dyn_LOGFILEBASE, domain->name) < 0) { + get_dyn_LOGFILEBASE(), domain->name) < 0) { smb_panic("Internal error: asprintf failed"); } } else { -- cgit