From 52c7c149c5675d5d718455099f89a9cc9911d545 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 25 Apr 2002 00:56:43 +0000 Subject: Fix from Herb for upgrading from big-endian earlier databases. Jeremy. (This used to be commit e65563fc9eb454988c11c12e3e979dd07e3032a3) --- source3/nsswitch/winbindd_idmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source3/nsswitch/winbindd_idmap.c b/source3/nsswitch/winbindd_idmap.c index bae61449ee..6528efea43 100644 --- a/source3/nsswitch/winbindd_idmap.c +++ b/source3/nsswitch/winbindd_idmap.c @@ -374,8 +374,8 @@ static BOOL idmap_convert(const char *idmap_name) return False; #endif - if (IREV(vers) == IDMAP_VERSION) { - /* Arrggghh ! Bytereversed - make order independent ! */ + if ((vers == -1) || (IREV(vers) == IDMAP_VERSION)) { + /* Arrggghh ! Bytereversed or missing - make order independent ! */ int32 wm; wm = tdb_fetch_int32(idmap_tdb, HWM_USER); @@ -385,7 +385,7 @@ static BOOL idmap_convert(const char *idmap_name) else wm = server_state.uid_low; - if (tdb_store_int32(idmap_tdb, HWM_USER, server_state.uid_low) == -1) { + if (tdb_store_int32(idmap_tdb, HWM_USER, wm) == -1) { DEBUG(0, ("idmap_convert: Unable to byteswap user hwm in idmap database\n")); return False; } @@ -395,7 +395,7 @@ static BOOL idmap_convert(const char *idmap_name) wm = IREV(wm); else wm = server_state.gid_low; - if (tdb_store_int32(idmap_tdb, HWM_GROUP, server_state.gid_low) == -1) { + if (tdb_store_int32(idmap_tdb, HWM_GROUP, wm) == -1) { DEBUG(0, ("idmap_convert: Unable to byteswap group hwm in idmap database\n")); return False; } -- cgit