The Samba-Bugzilla – Attachment 5234 Details for
Bug 7072
[PATCH] Accounts can't be unlocked from ldap
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am format patch for 3.3.11.
0001-Fix-bug-7072-Accounts-can-t-be-unlocked-from-ldap.patch (text/plain), 3.17 KB, created by
Jeremy Allison
on 2010-01-27 19:17:53 UTC
(
hide
)
Description:
git-am format patch for 3.3.11.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2010-01-27 19:17:53 UTC
Size:
3.17 KB
patch
obsolete
>From fb97b6345f559bb1de6cc3bd909e62f413657b86 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Wed, 27 Jan 2010 17:16:04 -0800 >Subject: [PATCH] Fix bug #7072 - Accounts can't be unlocked from ldap. > >Fix suggested by Andy Hanton <andyhanton@gmail.com>. The LOGIN_CACHE >struct contains two time_t entries, but was being written to and >read from via tdb_pack/tdb_unpack functions using explicit 32-bit int specifiers. >This would break on machines with a 64-bit time_t. Use correct int >sizes for tdb_pack/tdb_unpack. > >We have to fix this properly before 2037 :-). > >Contains fixes from master 627fb85092f728065b6d772c41aeb75018154e86 >and 69fd8461b8792f4fee1b61db03953044565492c6. > >Jeremy. >--- > source/passdb/login_cache.c | 25 +++++++++++++++++-------- > 1 files changed, 17 insertions(+), 8 deletions(-) > >diff --git a/source/passdb/login_cache.c b/source/passdb/login_cache.c >index 4e14293..a0d7806 100644 >--- a/source/passdb/login_cache.c >+++ b/source/passdb/login_cache.c >@@ -67,6 +67,7 @@ LOGIN_CACHE * login_cache_read(struct samu *sampass) > char *keystr; > TDB_DATA databuf; > LOGIN_CACHE *entry; >+ uint32_t entry_timestamp = 0, bad_password_time = 0; > > if (!login_cache_init()) > return NULL; >@@ -91,17 +92,23 @@ LOGIN_CACHE * login_cache_read(struct samu *sampass) > SAFE_FREE(databuf.dptr); > return NULL; > } >+ ZERO_STRUCTP(entry); > > if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT, >- &entry->entry_timestamp, &entry->acct_ctrl, >- &entry->bad_password_count, >- &entry->bad_password_time) == -1) { >+ &entry_timestamp, >+ &entry->acct_ctrl, >+ &entry->bad_password_count, >+ &bad_password_time) == -1) { > DEBUG(7, ("No cache entry found\n")); > SAFE_FREE(entry); > SAFE_FREE(databuf.dptr); > return NULL; > } > >+ /* Deal with possible 64-bit time_t. */ >+ entry->entry_timestamp = (time_t)entry_timestamp; >+ entry->bad_password_time = (time_t)bad_password_time; >+ > SAFE_FREE(databuf.dptr); > > DEBUG(5, ("Found login cache entry: timestamp %12u, flags 0x%x, count %d, time %12u\n", >@@ -115,6 +122,8 @@ bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) > char *keystr; > TDB_DATA databuf; > bool ret; >+ uint32_t entry_timestamp; >+ uint32_t bad_password_time = (uint32_t)entry.bad_password_time; > > if (!login_cache_init()) > return False; >@@ -129,14 +138,14 @@ bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) > return False; > } > >- entry.entry_timestamp = time(NULL); >+ entry_timestamp = (uint32_t)time(NULL); > > databuf.dsize = > tdb_pack(NULL, 0, SAM_CACHE_FORMAT, >- entry.entry_timestamp, >+ entry_timestamp, > entry.acct_ctrl, > entry.bad_password_count, >- entry.bad_password_time); >+ bad_password_time); > databuf.dptr = SMB_MALLOC_ARRAY(uint8, databuf.dsize); > if (!databuf.dptr) { > SAFE_FREE(keystr); >@@ -144,10 +153,10 @@ bool login_cache_write(const struct samu *sampass, LOGIN_CACHE entry) > } > > if (tdb_pack(databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT, >- entry.entry_timestamp, >+ entry_timestamp, > entry.acct_ctrl, > entry.bad_password_count, >- entry.bad_password_time) >+ bad_password_time) > != databuf.dsize) { > SAFE_FREE(keystr); > SAFE_FREE(databuf.dptr); >-- >1.6.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Flags:
jra
:
review?
(
gd
)
metze
:
review+
Actions:
View
Attachments on
bug 7072
:
5229
|
5230
|
5231
|
5232
|
5233
| 5234