From e936bb9f692503f7261b86439f12bc46619ffcfc Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Tue, 24 Apr 2018 01:22:57 +0000 Subject: [PATCH] pwd_mkdb: default to network (big) endian hash order For cross-architecture reproducibility. The db(3) functions work with hashes of either endianness, and the current (v4) version password db entries already store integers in network order. Do so with the hash as well so that identical password databases can be created on big- and little-endian hosts. The -B and -L flags exist to set the endianness for legacy (v3) entries when the -l flag is used, and they will still control hash endianness (at least until the backwards compatibility infrastructure is removed). MFC after: 1 week Sponsored by: The FreeBSD Foundation --- usr.sbin/pwd_mkdb/pwd_mkdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index f62b898259d0..62a2b08becb4 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -77,7 +77,7 @@ static HASHINFO openinfo = { 256, /* nelem */ 2048 * 1024, /* cachesize */ NULL, /* hash() */ - BYTE_ORDER /* lorder */ + BIG_ENDIAN /* lorder */ }; static enum state { FILE_INSECURE, FILE_SECURE, FILE_ORIG } clean;