Module Name:    src
Committed By:   dholland
Date:           Mon Aug 30 02:49:17 UTC 2010

Modified Files:
        src/usr.sbin/sa: usrdb.c

Log Message:
On LP64 platforms, uid_t is not the same size as u_long, so the key
comparison function being given to db was comparing 4 extra bytes of
rubbish.

This may or may not be the *only* source of the corrupted
/var/account/usracct files I've been seeing occasionally on amd64, but
it's clearly *a* source.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sa/usrdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/sa/usrdb.c
diff -u src/usr.sbin/sa/usrdb.c:1.13 src/usr.sbin/sa/usrdb.c:1.14
--- src/usr.sbin/sa/usrdb.c:1.13	Thu Jun 10 06:17:21 2010
+++ src/usr.sbin/sa/usrdb.c	Mon Aug 30 02:49:17 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: usrdb.c,v 1.13 2010/06/10 06:17:21 dholland Exp $ */
+/* $NetBSD: usrdb.c,v 1.14 2010/08/30 02:49:17 dholland Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: usrdb.c,v 1.13 2010/06/10 06:17:21 dholland Exp $");
+__RCSID("$NetBSD: usrdb.c,v 1.14 2010/08/30 02:49:17 dholland Exp $");
 #endif
 
 #include <sys/types.h>
@@ -292,7 +292,7 @@
 static int
 uid_compare(const DBT *k1, const DBT *k2)
 {
-	u_long d1, d2;
+	uid_t d1, d2;
 
 	memcpy(&d1, k1->data, sizeof(d1));
 	memcpy(&d2, k2->data, sizeof(d2));

Reply via email to