1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

Fixed the bug with member servers in a Samba PDC hosted domain not allowing

other access. Problem was max time was being set to 0xffffffff, instead of
0x7fffffff.
Jeremy.
(This used to be commit 94403d841710391ec26539e4b4157439d5778ff7)
This commit is contained in:
Jeremy Allison 2001-10-02 06:57:18 +00:00
parent 58bc10518b
commit cb4b13a82b
10 changed files with 736 additions and 700 deletions

View File

@ -346,8 +346,14 @@ BOOL reopen_logs( void )
oldumask = umask( 022 );
pstrcpy(fname, debugf );
if (lp_loaded() && (*lp_logfile()))
pstrcpy(fname, lp_logfile());
if (lp_loaded()) {
char *logfname;
logfname = lp_logfile();
if (*logfname)
pstrcpy(fname, logfname);
}
pstrcpy( debugf, fname );
if (append_log)

View File

@ -42,7 +42,19 @@ int extra_time_offset = 0;
#define TIME_T_MAX (~ (time_t) 0 - TIME_T_MIN)
#endif
/*******************************************************************
External access to time_t_min and time_t_max.
********************************************************************/
time_t get_time_t_min(void)
{
return TIME_T_MIN;
}
time_t get_time_t_max(void)
{
return TIME_T_MAX;
}
/*******************************************************************
a gettimeofday wrapper
@ -305,6 +317,12 @@ void unix_to_nt_time(NTTIME *nt, time_t t)
nt->high = 0;
return;
}
if (t == TIME_T_MAX)
{
nt->low = 0xffffffff;
nt->high = 0x7fffffff;
return;
}
if (t == -1)
{
nt->low = 0xffffffff;

View File

@ -77,11 +77,11 @@ static BOOL pdb_fill_default_sam(SAM_ACCOUNT *user)
ZERO_STRUCTP(user);
user->logon_time = (time_t)0;
user->logoff_time = (time_t)0;
user->kickoff_time = (time_t)0;
user->pass_last_set_time = (time_t)0;
user->pass_can_change_time = (time_t)0;
user->pass_must_change_time = (time_t)0;
user->logoff_time =
user->kickoff_time =
user->pass_last_set_time =
user->pass_can_change_time =
user->pass_must_change_time = get_time_t_max();
user->unknown_3 = 0x00ffffff; /* don't know */
user->logon_divs = 168; /* hours per week */
@ -140,7 +140,6 @@ BOOL pdb_init_sam_pw(SAM_ACCOUNT **new_sam_acct, struct passwd *pwd)
pdb_set_fullname(*new_sam_acct, pwd->pw_gecos);
pdb_set_uid(*new_sam_acct, pwd->pw_uid);
pdb_set_gid(*new_sam_acct, pwd->pw_gid);
pdb_set_pass_last_set_time(*new_sam_acct, time(NULL));
pdb_set_profile_path(*new_sam_acct, lp_logon_path());
pdb_set_homedir(*new_sam_acct, lp_logon_home());
pdb_set_dir_drive(*new_sam_acct, lp_logon_drive());

View File

@ -209,7 +209,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
* time values. note: this code assumes 32bit time_t!
*/
pdb_set_logon_time(pw_buf, -1);
pdb_set_logon_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_LOGON_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "LNT-", 4)==0)) {
int i;
@ -223,7 +223,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
pdb_set_logoff_time(pw_buf, -1);
pdb_set_logoff_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_LOGOFF_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "LOT-", 4)==0)) {
int i;
@ -237,7 +237,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
pdb_set_kickoff_time(pw_buf, -1);
pdb_set_kickoff_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_KICK_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "KOT-", 4)==0)) {
int i;
@ -251,7 +251,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
pdb_set_pass_last_set_time(pw_buf, -1);
pdb_set_pass_last_set_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDLSET_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "LCT-", 4)==0)) {
int i;
@ -265,7 +265,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
pdb_set_pass_can_change_time(pw_buf, -1);
pdb_set_pass_can_change_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDCCHG_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "CCT-", 4)==0)) {
int i;
@ -279,7 +279,7 @@ static BOOL make_sam_from_nisp_object(SAM_ACCOUNT *pw_buf, nis_object *obj)
}
}
pdb_set_pass_must_change_time(pw_buf, -1);
pdb_set_pass_must_change_time(pw_buf, get_time_t_max());
ptr = (uchar *)ENTRY_VAL(obj, NPF_PWDMCHG_T);
if(ptr && *ptr && (StrnCaseCmp(ptr, "MCT-", 4)==0)) {
int i;

View File

@ -101,17 +101,16 @@ static BOOL pw_file_unlock(int fd, int *plock_depth)
/**************************************************************
Intialize a smb_passwd struct
*************************************************************/
static void pdb_init_smb(struct smb_passwd *user)
{
if (user == NULL)
if (user == NULL)
return;
ZERO_STRUCTP (user);
ZERO_STRUCTP (user);
user->pass_last_set_time = (time_t)-1;
user->pass_last_set_time = get_time_t_max();
}
/***************************************************************
Internal fn to enumerate the smbpasswd list. Returns a void pointer
to ensure no modification outside this module. Checks for atomic
@ -1154,22 +1153,21 @@ Error was %s\n", pwd->smb_name, pfile2, strerror(errno)));
********************************************************************/
static BOOL build_smb_pass (struct smb_passwd *smb_pw, SAM_ACCOUNT *sampass)
{
if (sampass == NULL)
if (sampass == NULL)
return False;
ZERO_STRUCTP(smb_pw);
ZERO_STRUCTP(smb_pw);
smb_pw->smb_userid=pdb_get_uid(sampass);
smb_pw->smb_name=pdb_get_username(sampass);
smb_pw->smb_userid=pdb_get_uid(sampass);
smb_pw->smb_name=pdb_get_username(sampass);
smb_pw->smb_passwd=pdb_get_lanman_passwd(sampass);
smb_pw->smb_nt_passwd=pdb_get_nt_passwd(sampass);
smb_pw->acct_ctrl=pdb_get_acct_ctrl(sampass);
smb_pw->pass_last_set_time=pdb_get_pass_last_set_time(sampass);
return True;
smb_pw->acct_ctrl=pdb_get_acct_ctrl(sampass);
smb_pw->pass_last_set_time=pdb_get_pass_last_set_time(sampass);
return True;
}
/*********************************************************************

View File

@ -79,7 +79,7 @@ INSTOBJEXT = .mo
rm -f $@ && $(GENCAT) $@ $*.msg
all: cat-id-tbl.c
all: all-yes
all-yes: cat-id-tbl.c $(CATALOGS)
all-no:
@ -229,8 +229,6 @@ update-po: Makefile
fi; \
done
update-gmo: $(CATALOGS)
POTFILES: POTFILES.in
( if test 'x$(srcdir)' != 'x.'; then \
posrcprefix='$(top_srcdir)/'; \

View File

@ -196,237 +196,240 @@ const struct _msg_ent _msg_tbl[] = {
{"ssl server key", 187},
{"ssl client cert", 188},
{"ssl client key", 189},
{"ssl require clientcert", 190},
{"ssl require servercert", 191},
{"ssl ciphers", 192},
{"ssl version", 193},
{"ssl compatibility", 194},
{"Logging Options", 195},
{"log level", 196},
{"debuglevel", 197},
{"syslog", 198},
{"syslog only", 199},
{"log file", 200},
{"max log size", 201},
{"timestamp logs", 202},
{"debug timestamp", 203},
{"debug hires timestamp", 204},
{"debug pid", 205},
{"debug uid", 206},
{"Protocol Options", 207},
{"protocol", 208},
{"large readwrite", 209},
{"max protocol", 210},
{"min protocol", 211},
{"unicode", 212},
{"read bmpx", 213},
{"read raw", 214},
{"write raw", 215},
{"nt pipe support", 216},
{"nt acl support", 217},
{"announce version", 218},
{"announce as", 219},
{"max mux", 220},
{"max xmit", 221},
{"name resolve order", 222},
{"max packet", 223},
{"packet size", 224},
{"max ttl", 225},
{"max wins ttl", 226},
{"min wins ttl", 227},
{"time server", 228},
{"Tuning Options", 229},
{"change notify timeout", 230},
{"deadtime", 231},
{"getwd cache", 232},
{"keepalive", 233},
{"lpq cache time", 234},
{"max smbd processes", 235},
{"max connections", 236},
{"paranoid server security", 237},
{"max disk size", 238},
{"max open files", 239},
{"min print space", 240},
{"read size", 241},
{"socket options", 242},
{"stat cache size", 243},
{"strict allocate", 244},
{"strict sync", 245},
{"sync always", 246},
{"use mmap", 247},
{"hostname lookups", 248},
{"write cache size", 249},
{"Printing Options", 250},
{"total print jobs", 251},
{"max print jobs", 252},
{"load printers", 253},
{"printcap name", 254},
{"printcap", 255},
{"printable", 256},
{"print ok", 257},
{"postscript", 258},
{"printing", 259},
{"print command", 260},
{"disable spoolss", 261},
{"lpq command", 262},
{"lprm command", 263},
{"lppause command", 264},
{"lpresume command", 265},
{"queuepause command", 266},
{"queueresume command", 267},
{"enumports command", 268},
{"addprinter command", 269},
{"deleteprinter command", 270},
{"show add printer wizard", 271},
{"os2 driver map", 272},
{"printer name", 273},
{"printer", 274},
{"use client driver", 275},
{"printer driver", 276},
{"printer driver file", 277},
{"printer driver location", 278},
{"Filename Handling", 279},
{"strip dot", 280},
{"mangled stack", 281},
{"default case", 282},
{"case sensitive", 283},
{"casesignames", 284},
{"preserve case", 285},
{"short preserve case", 286},
{"mangle case", 287},
{"mangling char", 288},
{"hide dot files", 289},
{"hide unreadable", 290},
{"delete veto files", 291},
{"veto files", 292},
{"hide files", 293},
{"veto oplock files", 294},
{"map system", 295},
{"map hidden", 296},
{"map archive", 297},
{"mangled names", 298},
{"mangled map", 299},
{"stat cache", 300},
{"Domain Options", 301},
{"domain admin group", 302},
{"domain guest group", 303},
{"groupname map", 304},
{"machine password timeout", 305},
{"Logon Options", 306},
{"add user script", 307},
{"delete user script", 308},
{"add group script", 309},
{"delete group script", 310},
{"add user to group script", 311},
{"delete user from group script", 312},
{"add machine script", 313},
{"shutdown script", 314},
{"abort shutdown script", 315},
{"logon script", 316},
{"logon path", 317},
{"logon drive", 318},
{"logon home", 319},
{"domain logons", 320},
{"Browse Options", 321},
{"os level", 322},
{"lm announce", 323},
{"lm interval", 324},
{"preferred master", 325},
{"prefered master", 326},
{"local master", 327},
{"domain master", 328},
{"browse list", 329},
{"browseable", 330},
{"browsable", 331},
{"enhanced browsing", 332},
{"WINS Options", 333},
{"dns proxy", 334},
{"wins proxy", 335},
{"wins server", 336},
{"wins support", 337},
{"wins hook", 338},
{"Locking Options", 339},
{"blocking locks", 340},
{"fake oplocks", 341},
{"kernel oplocks", 342},
{"locking", 343},
{"oplocks", 344},
{"level2 oplocks", 345},
{"oplock break wait time", 346},
{"oplock contention limit", 347},
{"posix locking", 348},
{"strict locking", 349},
{"share modes", 350},
{"Ldap Options", 351},
{"ldap server", 352},
{"ldap port", 353},
{"ldap suffix", 354},
{"ldap filter", 355},
{"ldap root", 356},
{"ldap root passwd", 357},
{"Miscellaneous Options", 358},
{"add share command", 359},
{"change share command", 360},
{"delete share command", 361},
{"config file", 362},
{"preload", 363},
{"auto services", 364},
{"lock dir", 365},
{"lock directory", 366},
{"utmp directory", 367},
{"wtmp directory", 368},
{"utmp", 369},
{"default service", 370},
{"default", 371},
{"message command", 372},
{"dfree command", 373},
{"remote announce", 374},
{"remote browse sync", 375},
{"socket address", 376},
{"homedir map", 377},
{"time offset", 378},
{"NIS homedir", 379},
{"-valid", 380},
{"copy", 381},
{"include", 382},
{"exec", 383},
{"preexec", 384},
{"preexec close", 385},
{"postexec", 386},
{"root preexec", 387},
{"root preexec close", 388},
{"root postexec", 389},
{"available", 390},
{"volume", 391},
{"fstype", 392},
{"set directory", 393},
{"source environment", 394},
{"wide links", 395},
{"follow symlinks", 396},
{"dont descend", 397},
{"magic script", 398},
{"magic output", 399},
{"delete readonly", 400},
{"dos filemode", 401},
{"dos filetimes", 402},
{"dos filetime resolution", 403},
{"fake directory create times", 404},
{"panic action", 405},
{"hide local users", 406},
{"VFS options", 407},
{"vfs object", 408},
{"vfs options", 409},
{"msdfs root", 410},
{"host msdfs", 411},
{"Winbind options", 412},
{"winbind uid", 413},
{"winbind gid", 414},
{"template homedir", 415},
{"template shell", 416},
{"winbind separator", 417},
{"winbind cache time", 418},
{"winbind enum users", 419},
{"winbind enum groups", 420},
{"ssl egd socket", 190},
{"ssl entropy file", 191},
{"ssl entropy bytes", 192},
{"ssl require clientcert", 193},
{"ssl require servercert", 194},
{"ssl ciphers", 195},
{"ssl version", 196},
{"ssl compatibility", 197},
{"Logging Options", 198},
{"log level", 199},
{"debuglevel", 200},
{"syslog", 201},
{"syslog only", 202},
{"log file", 203},
{"max log size", 204},
{"timestamp logs", 205},
{"debug timestamp", 206},
{"debug hires timestamp", 207},
{"debug pid", 208},
{"debug uid", 209},
{"Protocol Options", 210},
{"protocol", 211},
{"large readwrite", 212},
{"max protocol", 213},
{"min protocol", 214},
{"unicode", 215},
{"read bmpx", 216},
{"read raw", 217},
{"write raw", 218},
{"nt pipe support", 219},
{"nt acl support", 220},
{"announce version", 221},
{"announce as", 222},
{"max mux", 223},
{"max xmit", 224},
{"name resolve order", 225},
{"max packet", 226},
{"packet size", 227},
{"max ttl", 228},
{"max wins ttl", 229},
{"min wins ttl", 230},
{"time server", 231},
{"Tuning Options", 232},
{"change notify timeout", 233},
{"deadtime", 234},
{"getwd cache", 235},
{"keepalive", 236},
{"lpq cache time", 237},
{"max smbd processes", 238},
{"max connections", 239},
{"paranoid server security", 240},
{"max disk size", 241},
{"max open files", 242},
{"min print space", 243},
{"read size", 244},
{"socket options", 245},
{"stat cache size", 246},
{"strict allocate", 247},
{"strict sync", 248},
{"sync always", 249},
{"use mmap", 250},
{"hostname lookups", 251},
{"write cache size", 252},
{"Printing Options", 253},
{"total print jobs", 254},
{"max print jobs", 255},
{"load printers", 256},
{"printcap name", 257},
{"printcap", 258},
{"printable", 259},
{"print ok", 260},
{"postscript", 261},
{"printing", 262},
{"print command", 263},
{"disable spoolss", 264},
{"lpq command", 265},
{"lprm command", 266},
{"lppause command", 267},
{"lpresume command", 268},
{"queuepause command", 269},
{"queueresume command", 270},
{"enumports command", 271},
{"addprinter command", 272},
{"deleteprinter command", 273},
{"show add printer wizard", 274},
{"os2 driver map", 275},
{"printer name", 276},
{"printer", 277},
{"use client driver", 278},
{"printer driver", 279},
{"printer driver file", 280},
{"printer driver location", 281},
{"Filename Handling", 282},
{"strip dot", 283},
{"mangled stack", 284},
{"default case", 285},
{"case sensitive", 286},
{"casesignames", 287},
{"preserve case", 288},
{"short preserve case", 289},
{"mangle case", 290},
{"mangling char", 291},
{"hide dot files", 292},
{"hide unreadable", 293},
{"delete veto files", 294},
{"veto files", 295},
{"hide files", 296},
{"veto oplock files", 297},
{"map system", 298},
{"map hidden", 299},
{"map archive", 300},
{"mangled names", 301},
{"mangled map", 302},
{"stat cache", 303},
{"Domain Options", 304},
{"domain admin group", 305},
{"domain guest group", 306},
{"groupname map", 307},
{"machine password timeout", 308},
{"Logon Options", 309},
{"add user script", 310},
{"delete user script", 311},
{"add group script", 312},
{"delete group script", 313},
{"add user to group script", 314},
{"delete user from group script", 315},
{"add machine script", 316},
{"shutdown script", 317},
{"abort shutdown script", 318},
{"logon script", 319},
{"logon path", 320},
{"logon drive", 321},
{"logon home", 322},
{"domain logons", 323},
{"Browse Options", 324},
{"os level", 325},
{"lm announce", 326},
{"lm interval", 327},
{"preferred master", 328},
{"prefered master", 329},
{"local master", 330},
{"domain master", 331},
{"browse list", 332},
{"browseable", 333},
{"browsable", 334},
{"enhanced browsing", 335},
{"WINS Options", 336},
{"dns proxy", 337},
{"wins proxy", 338},
{"wins server", 339},
{"wins support", 340},
{"wins hook", 341},
{"Locking Options", 342},
{"blocking locks", 343},
{"fake oplocks", 344},
{"kernel oplocks", 345},
{"locking", 346},
{"oplocks", 347},
{"level2 oplocks", 348},
{"oplock break wait time", 349},
{"oplock contention limit", 350},
{"posix locking", 351},
{"strict locking", 352},
{"share modes", 353},
{"Ldap Options", 354},
{"ldap server", 355},
{"ldap port", 356},
{"ldap suffix", 357},
{"ldap filter", 358},
{"ldap root", 359},
{"ldap root passwd", 360},
{"Miscellaneous Options", 361},
{"add share command", 362},
{"change share command", 363},
{"delete share command", 364},
{"config file", 365},
{"preload", 366},
{"auto services", 367},
{"lock dir", 368},
{"lock directory", 369},
{"utmp directory", 370},
{"wtmp directory", 371},
{"utmp", 372},
{"default service", 373},
{"default", 374},
{"message command", 375},
{"dfree command", 376},
{"remote announce", 377},
{"remote browse sync", 378},
{"socket address", 379},
{"homedir map", 380},
{"time offset", 381},
{"NIS homedir", 382},
{"-valid", 383},
{"copy", 384},
{"include", 385},
{"exec", 386},
{"preexec", 387},
{"preexec close", 388},
{"postexec", 389},
{"root preexec", 390},
{"root preexec close", 391},
{"root postexec", 392},
{"available", 393},
{"volume", 394},
{"fstype", 395},
{"set directory", 396},
{"source environment", 397},
{"wide links", 398},
{"follow symlinks", 399},
{"dont descend", 400},
{"magic script", 401},
{"magic output", 402},
{"delete readonly", 403},
{"dos filemode", 404},
{"dos filetimes", 405},
{"dos filetime resolution", 406},
{"fake directory create times", 407},
{"panic action", 408},
{"hide local users", 409},
{"VFS options", 410},
{"vfs object", 411},
{"vfs options", 412},
{"msdfs root", 413},
{"host msdfs", 414},
{"Winbind options", 415},
{"winbind uid", 416},
{"winbind gid", 417},
{"template homedir", 418},
{"template shell", 419},
{"winbind separator", 420},
{"winbind cache time", 421},
{"winbind enum users", 422},
{"winbind enum groups", 423},
};
int _msg_tbl_length = 420;
int _msg_tbl_length = 423;

File diff suppressed because it is too large Load Diff

View File

@ -1240,6 +1240,7 @@ BOOL smb_io_cred(char *desc, DOM_CRED *cred, prs_struct *ps, int depth)
if(!smb_io_chal ("", &cred->challenge, ps, depth))
return False;
if(!smb_io_utime("", &cred->timestamp, ps, depth))
return False;

View File

@ -1260,6 +1260,7 @@ void init_net_user_info3(TALLOC_CTX *ctx, NET_USER_INFO_3 *usr, SAM_ACCOUNT *sam
usr->user_rid = pdb_get_user_rid(sampw);
usr->group_rid = pdb_get_group_rid(sampw);
usr->num_groups = num_groups+1;
usr->buffer_groups = 1; /* indicates fill in groups, below, even if there are none */
usr->user_flgs = user_flgs;
@ -1339,17 +1340,17 @@ static BOOL net_io_user_info3(char *desc, NET_USER_INFO_3 *usr, prs_struct *ps,
if (usr->ptr_user_info == 0)
return True;
if(!smb_io_time("time", &usr->logon_time, ps, depth)) /* logon time */
if(!smb_io_time("logon time", &usr->logon_time, ps, depth)) /* logon time */
return False;
if(!smb_io_time("time", &usr->logoff_time, ps, depth)) /* logoff time */
if(!smb_io_time("logoff time", &usr->logoff_time, ps, depth)) /* logoff time */
return False;
if(!smb_io_time("time", &usr->kickoff_time, ps, depth)) /* kickoff time */
if(!smb_io_time("kickoff time", &usr->kickoff_time, ps, depth)) /* kickoff time */
return False;
if(!smb_io_time("time", &usr->pass_last_set_time, ps, depth)) /* password last set time */
if(!smb_io_time("last set time", &usr->pass_last_set_time, ps, depth)) /* password last set time */
return False;
if(!smb_io_time("time", &usr->pass_can_change_time , ps, depth)) /* password can change time */
if(!smb_io_time("can change time", &usr->pass_can_change_time , ps, depth)) /* password can change time */
return False;
if(!smb_io_time("time", &usr->pass_must_change_time, ps, depth)) /* password must change time */
if(!smb_io_time("must change time", &usr->pass_must_change_time, ps, depth)) /* password must change time */
return False;
if(!smb_io_unihdr("unihdr", &usr->hdr_user_name, ps, depth)) /* username unicode string header */