Module Name: src
Committed By: bouyer
Date: Sun Sep 12 21:18:05 UTC 2010
Modified Files:
src/usr.sbin/sa [netbsd-4]: usrdb.c
Log Message:
Pull up following revision(s) (requested by dholland in ticket #1404):
usr.sbin/sa/usrdb.c: revision 1.14
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.11 -r1.11.16.1 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.11 src/usr.sbin/sa/usrdb.c:1.11.16.1
--- src/usr.sbin/sa/usrdb.c:1.11 Wed Nov 12 13:31:08 2003
+++ src/usr.sbin/sa/usrdb.c Sun Sep 12 21:18:05 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: usrdb.c,v 1.11 2003/11/12 13:31:08 grant Exp $ */
+/* $NetBSD: usrdb.c,v 1.11.16.1 2010/09/12 21:18:05 bouyer Exp $ */
/*
* Copyright (c) 1994 Christopher G. Demetriou
@@ -36,7 +36,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: usrdb.c,v 1.11 2003/11/12 13:31:08 grant Exp $");
+__RCSID("$NetBSD: usrdb.c,v 1.11.16.1 2010/09/12 21:18:05 bouyer Exp $");
#endif
#include <sys/types.h>
@@ -294,7 +294,7 @@
uid_compare(k1, k2)
const DBT *k1, *k2;
{
- u_long d1, d2;
+ uid_t d1, d2;
memcpy(&d1, k1->data, sizeof(d1));
memcpy(&d2, k2->data, sizeof(d2));