Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sa On LP64 platforms, uid_t is not the same size as...



details:   https://anonhg.NetBSD.org/src/rev/ef94da641dfc
branches:  trunk
changeset: 757442:ef94da641dfc
user:      dholland <dholland%NetBSD.org@localhost>
date:      Mon Aug 30 02:49:17 2010 +0000

description:
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.

diffstat:

 usr.sbin/sa/usrdb.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r fb7eee5bd7fc -r ef94da641dfc usr.sbin/sa/usrdb.c
--- a/usr.sbin/sa/usrdb.c       Mon Aug 30 02:19:47 2010 +0000
+++ b/usr.sbin/sa/usrdb.c       Mon Aug 30 02:49:17 2010 +0000
@@ -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));



Home | Main Index | Thread Index | Old Index