Fixed winbindd to finally stop leaving log. file droppings :-).
Jeremy.
time_t newer_than = 0;
int archive_level = 0;
-extern pstring debugf;
-
BOOL translation = False;
static BOOL have_ip;
extern char tar_type;
pstring term_code;
pstring new_name_resolve_order;
+ pstring logfile;
char *p;
int rc = 0;
port = atoi(optarg);
break;
case 'l':
- slprintf(debugf,sizeof(debugf)-1, "%s.client",optarg);
+ slprintf(logfile,sizeof(logfile)-1, "%s.client",optarg);
+ lp_set_logfile(logfile);
break;
case 'h':
usage(pname);
#include "includes.h"
-extern pstring debugf;
-
int ClientNMB = -1;
int ClientDGRAM = -1;
int global_nmb_port = -1;
{
char *p;
pstring dname;
- pstrcpy( dname, debugf );
+ pstrcpy( dname, lp_logfile() );
if ((p=strrchr_m(dname,'/')))
*p=0;
pstrcat( dname, "/corefiles" );
extern char *optarg;
extern BOOL append_log;
BOOL opt_interactive = False;
+ pstring logfile;
append_log = True; /* Default, override with '-o' option. */
sys_srandom(time(NULL) ^ sys_getpid());
- slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
+ slprintf(logfile, sizeof(logfile)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
/* this is for people who can't start the program correctly */
while (argc > 1 && (*argv[1] != '-'))
strupper(global_myname);
break;
case 'l':
- slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", optarg);
+ slprintf(logfile, sizeof(logfile)-1, "%s/log.nmbd", optarg);
+ lp_set_logfile(logfile);
break;
case 'a':
append_log = True;
#include "winbindd.h"
-extern pstring debugf;
-
/* List of all connected clients */
struct winbindd_cli_state *client_list;
static BOOL reload_services_file(BOOL test)
{
BOOL ret;
+ pstring logfile;
if (lp_loaded()) {
pstring fname;
}
}
+ snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
+
reopen_logs();
ret = lp_load(dyn_CONFIGFILE,False,False,True);
+ snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
+
reopen_logs();
load_interfaces();
{
char *p;
pstring dname;
- pstrcpy( dname, debugf );
+ pstrcpy( dname, lp_logfile() );
if ((p=strrchr(dname,'/')))
*p=0;
pstrcat( dname, "/corefiles" );
{
extern pstring global_myname;
extern fstring global_myworkgroup;
+ pstring logfile;
int accept_sock;
BOOL interactive = False;
int opt, new_debuglevel = -1;
CatchSignal(SIGUSR1, SIG_IGN);
fault_setup((void (*)(void *))fault_quit );
- snprintf(debugf, sizeof(debugf), "%s/log.winbindd", dyn_LOGFILEBASE);
+ snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
/* Initialise for running in non-root mode */
}
}
- snprintf(debugf, sizeof(debugf), "%s/log.winbindd", dyn_LOGFILEBASE);
+ snprintf(logfile, sizeof(logfile), "%s/log.winbindd", dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
setup_logging("winbindd", interactive);
reopen_logs();
return False;
}
+/***********************************************************
+ Allow daemons such as winbindd to fix their logfile name.
+************************************************************/
+void lp_set_logfile(const char *name)
+{
+ extern pstring debugf;
+ pstrcpy(Globals.szLogFile, name);
+ pstrcpy(debugf, name);
+}
#include "includes.h"
#include "rpcclient.h"
-extern pstring debugf;
-
DOM_SID domain_sid;
/* List to hold groups of commands */
break;
case 'l':
- slprintf(debugf, sizeof(debugf) - 1, "%s.client", optarg);
+ slprintf(logfile, sizeof(logfile) - 1, "%s.client", optarg);
+ lp_set_logfile(logfile);
interactive = False;
break;
struct cli_state cli;
NTSTATUS result;
int opt;
- extern pstring debugf;
+ pstring logfile;
BOOL interactive = False, do_smbpasswd_output = False;
BOOL verbose = False;
uint32 low_serial = 0;
/* Initialise samba */
- slprintf(debugf, sizeof(debugf) - 1, "%s/log.%s", dyn_LOGFILEBASE,
+ slprintf(logfile, sizeof(logfile) - 1, "%s/log.%s", dyn_LOGFILEBASE,
"samsync");
+ lp_set_logfile(logfile);
setup_logging("samsync", interactive);
#include "includes.h"
-extern pstring debugf;
extern fstring global_myworkgroup;
extern pstring global_myname;
{
char *p;
pstring dname;
- pstrcpy(dname,debugf);
+ pstrcpy(dname,lp_logfile());
if ((p=strrchr_m(dname,'/'))) *p=0;
pstrcat(dname,"/corefiles");
mkdir(dname,0700);
int main(int argc,char *argv[])
{
extern BOOL append_log;
+ extern char *optarg;
/* shall I run as a daemon */
BOOL is_daemon = False;
BOOL specified_logfile = False;
int port = SMB_PORT;
int opt;
- extern char *optarg;
+ pstring logfile;
#ifdef HAVE_SET_AUTH_PARAMETERS
set_auth_parameters(argc,argv);
case 'l':
specified_logfile = True;
- slprintf(debugf, sizeof(debugf)-1, "%s/log.smbd", optarg);
+ slprintf(logfile, sizeof(logfile)-1, "%s/log.smbd", optarg);
+ lp_set_logfile(logfile);
break;
case 'a':
append_log = True;
if(!specified_logfile) {
- slprintf(debugf, sizeof(debugf)-1, "%s/log.smbd",
+ slprintf(logfile, sizeof(logfile)-1, "%s/log.smbd",
dyn_LOGFILEBASE);
+ lp_set_logfile(logfile);
}
pstrcpy(remote_machine, "smbd");
extern pstring user_socket_options;
-extern pstring debugf;
-
extern file_info def_finfo;
#define CNV_LANG(s) dos2unix_format(s,False)
enum client_action cli_action = CLIENT_NONE;
int nprocs = 1;
int numops = 100;
+ pstring logfile;
struct client_info cli_info;
case 'l':
{
- slprintf(debugf, sizeof(debugf)-1,
+ slprintf(logfile, sizeof(logfile)-1,
"%s.client",optarg);
+ lp_set_logfile(logfile);
break;
}