mirror of
https://github.com/samba-team/samba.git
synced 2025-01-24 02:04:21 +03:00
Removed TimeInit() call from every client program (except for one place
in smbd/process.c where the timezone is reinitialised. Was replaced with check for a static is_initialised boolean.
This commit is contained in:
parent
8f01a8b078
commit
8fc772c9e5
@ -2450,8 +2450,6 @@ static int do_message_op(void)
|
||||
}
|
||||
}
|
||||
|
||||
TimeInit();
|
||||
|
||||
in_client = True; /* Make sure that we tell lp_load we are */
|
||||
|
||||
old_debug = DEBUGLEVEL;
|
||||
|
@ -827,8 +827,6 @@ static void parse_mount_smb(int argc, char **argv)
|
||||
else
|
||||
setenv("CLI_FORCE_ASCII", "true", 1);
|
||||
|
||||
TimeInit();
|
||||
|
||||
in_client = True; /* Make sure that we tell lp_load we are */
|
||||
|
||||
if (getenv("USER")) {
|
||||
|
@ -187,8 +187,6 @@ static int smb_print(struct cli_state *, char *, FILE *);
|
||||
|
||||
setup_logging("smbspool", True);
|
||||
|
||||
TimeInit();
|
||||
|
||||
in_client = True; /* Make sure that we tell lp_load we are */
|
||||
|
||||
if (!lp_load(dyn_CONFIGFILE, True, False, False))
|
||||
|
@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
|
||||
int serverzone=0;
|
||||
int extra_time_offset = 0;
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
@ -105,21 +104,36 @@ static int TimeZone(time_t t)
|
||||
|
||||
}
|
||||
|
||||
static BOOL done_serverzone_init;
|
||||
|
||||
/*******************************************************************
|
||||
init the time differences
|
||||
********************************************************************/
|
||||
void TimeInit(void)
|
||||
/* Return the smb serverzone value */
|
||||
|
||||
static int get_serverzone(void)
|
||||
{
|
||||
serverzone = TimeZone(time(NULL));
|
||||
static int serverzone;
|
||||
|
||||
if ((serverzone % 60) != 0) {
|
||||
DEBUG(1,("WARNING: Your timezone is not a multiple of 1 minute.\n"));
|
||||
}
|
||||
if (!done_serverzone_init) {
|
||||
serverzone = TimeZone(time(NULL));
|
||||
|
||||
DEBUG(4,("Serverzone is %d\n",serverzone));
|
||||
if ((serverzone % 60) != 0) {
|
||||
DEBUG(1,("WARNING: Your timezone is not a multiple of 1 minute.\n"));
|
||||
}
|
||||
|
||||
DEBUG(4,("Serverzone is %d\n",serverzone));
|
||||
|
||||
done_serverzone_init = True;
|
||||
}
|
||||
|
||||
return serverzone;
|
||||
}
|
||||
|
||||
/* Re-read the smb serverzone value */
|
||||
|
||||
void TimeInit(void)
|
||||
{
|
||||
done_serverzone_init = False;
|
||||
get_serverzone();
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
return the same value as TimeZone, but it should be more efficient.
|
||||
@ -284,7 +298,7 @@ time_t nt_time_to_unix(NTTIME *nt)
|
||||
ret = (time_t)(d+0.5);
|
||||
|
||||
/* this takes us from kludge-GMT to real GMT */
|
||||
ret -= serverzone;
|
||||
ret -= get_serverzone();
|
||||
ret += LocTimeDiff(ret);
|
||||
|
||||
return(ret);
|
||||
@ -331,7 +345,7 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
|
||||
}
|
||||
|
||||
/* this converts GMT to kludge-GMT */
|
||||
t -= LocTimeDiff(t) - serverzone;
|
||||
t -= LocTimeDiff(t) - get_serverzone();
|
||||
|
||||
d = (double)(t);
|
||||
d += TIME_FIXUP_CONSTANT;
|
||||
|
@ -673,8 +673,6 @@ static void usage(char *pname)
|
||||
|
||||
sys_srandom(time(NULL) ^ sys_getpid());
|
||||
|
||||
TimeInit();
|
||||
|
||||
slprintf(debugf, sizeof(debugf)-1, "%s/log.nmbd", dyn_LOGFILEBASE);
|
||||
setup_logging( argv[0], False );
|
||||
|
||||
|
@ -459,8 +459,6 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
TimeInit();
|
||||
|
||||
if (!lp_load(dyn_CONFIGFILE, True, False, False)) {
|
||||
DEBUG(0, ("error opening config file\n"));
|
||||
exit(1);
|
||||
|
@ -735,8 +735,6 @@ int main(int argc, char **argv)
|
||||
*p = 0;
|
||||
}
|
||||
|
||||
TimeInit();
|
||||
|
||||
if (!reload_services_file(False)) {
|
||||
DEBUG(0, ("error opening config file\n"));
|
||||
exit(1);
|
||||
|
@ -73,7 +73,6 @@ struct in_addr *lookup_backend(const char *name, int *count)
|
||||
if (!initialised) {
|
||||
initialised = 1;
|
||||
DEBUGLEVEL = 0;
|
||||
TimeInit();
|
||||
setup_logging("nss_wins",True);
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
@ -716,8 +716,6 @@ static void usage(void)
|
||||
|
||||
load_interfaces();
|
||||
|
||||
TimeInit();
|
||||
|
||||
get_myname((*global_myname)?NULL:global_myname);
|
||||
strupper(global_myname);
|
||||
|
||||
|
@ -309,8 +309,6 @@ static struct cli_state *init_connection(struct cli_state *cli,
|
||||
|
||||
load_interfaces();
|
||||
|
||||
TimeInit();
|
||||
|
||||
/* Check arguments make sense */
|
||||
|
||||
if (do_sam_sync && do_sam_repl) {
|
||||
|
@ -667,8 +667,6 @@ static void usage(char *pname)
|
||||
|
||||
append_log = True;
|
||||
|
||||
TimeInit();
|
||||
|
||||
if(!specified_logfile) {
|
||||
slprintf(debugf, sizeof(debugf)-1, "%s/log.smbd",
|
||||
dyn_LOGFILEBASE);
|
||||
|
@ -568,8 +568,6 @@ static void usage(void)
|
||||
argc -= NSERVERS;
|
||||
argv += NSERVERS;
|
||||
|
||||
TimeInit();
|
||||
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
||||
|
@ -558,8 +558,6 @@ static void usage(void)
|
||||
argc -= 4;
|
||||
argv += 4;
|
||||
|
||||
TimeInit();
|
||||
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
||||
|
@ -441,8 +441,6 @@ static void usage(void)
|
||||
argc -= 1;
|
||||
argv += 1;
|
||||
|
||||
TimeInit();
|
||||
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
||||
|
@ -42,7 +42,6 @@ void pong_message(int msg_type, pid_t src, void *buf, size_t len)
|
||||
int i, n;
|
||||
char buf[12];
|
||||
|
||||
TimeInit();
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
lp_load(dyn_CONFIGFILE,False,False,False);
|
||||
|
@ -292,8 +292,6 @@ enum client_action
|
||||
|
||||
setup_logging(pname, True);
|
||||
|
||||
TimeInit();
|
||||
|
||||
myumask = umask(0);
|
||||
umask(myumask);
|
||||
|
||||
|
@ -199,8 +199,6 @@ int main(int argc,char *argv[])
|
||||
DEBUGLEVEL = 1;
|
||||
*lookup = 0;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
while ((opt = getopt(argc, argv, "d:B:U:i:s:SMrhART")) != EOF)
|
||||
|
@ -552,8 +552,6 @@ int main (int argc, char **argv)
|
||||
char *profile_path = NULL;
|
||||
char *smbpasswd = NULL;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging("tdbedit", True);
|
||||
|
||||
if (argc < 2) {
|
||||
|
@ -829,8 +829,6 @@ You can string acls together with spaces, commas or newlines\n\
|
||||
argc -= 2;
|
||||
argv += 2;
|
||||
|
||||
TimeInit();
|
||||
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
||||
|
@ -379,7 +379,6 @@ static BOOL do_command(char *dest, char *msg_name, int iparams, char **params)
|
||||
extern int optind;
|
||||
BOOL interactive = False;
|
||||
|
||||
TimeInit();
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
if (argc < 2) usage(True);
|
||||
|
@ -224,8 +224,6 @@ int main(int argc, char *argv[])
|
||||
char *desthost;
|
||||
pstring configfile;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
pstrcpy(configfile,dyn_CONFIGFILE);
|
||||
|
@ -217,8 +217,6 @@ int main (int argc, char **argv)
|
||||
|
||||
enum SID_NAME_USE sid_type;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging("groupedit", True);
|
||||
|
||||
if (argc < 2) {
|
||||
|
@ -900,8 +900,6 @@ int main(int argc, char **argv)
|
||||
set_auth_parameters(argc, argv);
|
||||
#endif /* HAVE_SET_AUTH_PARAMETERS */
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging("smbpasswd", True);
|
||||
|
||||
if(!initialize_password_db(True)) {
|
||||
|
@ -338,8 +338,6 @@ static BOOL print_tree(struct user_auth_info *user_info)
|
||||
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
TimeInit();
|
||||
|
||||
lp_load(dyn_CONFIGFILE,True,False,False);
|
||||
load_interfaces();
|
||||
|
||||
|
@ -548,7 +548,6 @@ static int traverse_sessionid(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, vo
|
||||
int profile_only = 0, new_debuglevel = -1;
|
||||
TDB_CONTEXT *tdb;
|
||||
|
||||
TimeInit();
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
DEBUGLEVEL = 0;
|
||||
|
@ -188,8 +188,6 @@ int main(int argc, char *argv[])
|
||||
|
||||
*term_code = 0;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
while ((opt = getopt(argc, argv,"shL:t:")) != EOF) {
|
||||
|
@ -38,8 +38,6 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
char *pszTemp;
|
||||
|
||||
TimeInit();
|
||||
|
||||
setup_logging(argv[0],True);
|
||||
|
||||
if (argc < 2 || argc > 3)
|
||||
|
Loading…
x
Reference in New Issue
Block a user