usr/src/cmd/samba/login_cache-diff
author Jon Tibble <meths@btinternet.com>
Mon, 04 May 2015 14:04:39 +0100
branchoi_151a
changeset 254 9c2a4ac793f0
parent 16 4481d72bca2d
permissions -rw-r--r--
Bash patch catchup including shellshock
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     1
--- samba-3.0.37/source/passdb/login_cache.c	Thu Mar 11 04:54:39 2010
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     2
+++ samba-3.0.37-new/source/passdb/login_cache.c	Wed Mar 17 04:37:18 2010
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     3
@@ -68,6 +68,7 @@
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     4
 {
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     5
 	TDB_DATA keybuf, databuf;
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     6
 	LOGIN_CACHE *entry;
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     7
+	uint16_t acct_ctrl;
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     8
 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
     9
 	if (!login_cache_init())
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    10
 		return NULL;
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    11
@@ -95,7 +96,7 @@
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    12
 	}
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    13
 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    14
 	if (tdb_unpack (databuf.dptr, databuf.dsize, SAM_CACHE_FORMAT,
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    15
-			&entry->entry_timestamp, &entry->acct_ctrl, 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    16
+			&entry->entry_timestamp, &acct_ctrl, 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    17
 			&entry->bad_password_count, 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    18
 			&entry->bad_password_time) == -1) {
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    19
 		DEBUG(7, ("No cache entry found\n"));
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    20
@@ -106,6 +107,12 @@
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    21
 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    22
 	SAFE_FREE(databuf.dptr);
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    23
 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    24
+	/*
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    25
+	 * Deal with 32-bit acct_ctrl. In the tdb we only store 16-bit
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    26
+	 * ("w" in SAM_CACHE_FORMAT). Fixes bug 7253.
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    27
+	 */
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    28
+	entry->acct_ctrl = acct_ctrl;
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    29
+
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    30
 	DEBUG(5, ("Found login cache entry: timestamp %12u, flags 0x%x, count %d, time %12u\n",
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    31
 		  (unsigned int)entry->entry_timestamp, entry->acct_ctrl, 
4481d72bca2d Import sfw build 142
Cyril Plisko <cyril.plisko@grigale.com>
parents:
diff changeset
    32
 		  entry->bad_password_count, (unsigned int)entry->bad_password_time));