diff options
author | Jeremy Allison <jra@samba.org> | 2002-04-27 01:18:31 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-04-27 01:18:31 +0000 |
commit | 1d79e6b90eb6fc5ddc9c0b7320d1ec025f18f22f (patch) | |
tree | 59c4ef8491328ca44eeb5511f843cae95704cacf /source3 | |
parent | 9199721eba64b7808471f6f0811dfd20e85938ca (diff) | |
download | samba-1d79e6b90eb6fc5ddc9c0b7320d1ec025f18f22f.tar.gz samba-1d79e6b90eb6fc5ddc9c0b7320d1ec025f18f22f.tar.bz2 samba-1d79e6b90eb6fc5ddc9c0b7320d1ec025f18f22f.zip |
Another attempt at fixing the endian problem when upgrading from 2.2.3a.
Herb please check.
Jeremy.
(This used to be commit a312b5b2de117797ddfdc79316378aac93034718)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nsswitch/winbindd_idmap.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source3/nsswitch/winbindd_idmap.c b/source3/nsswitch/winbindd_idmap.c index 3649b8ff7a..60ea188b1d 100644 --- a/source3/nsswitch/winbindd_idmap.c +++ b/source3/nsswitch/winbindd_idmap.c @@ -363,7 +363,6 @@ fail: static BOOL idmap_convert(const char *idmap_name) { - BOOL bytereversed = False; int32 vers = tdb_fetch_int32(idmap_tdb, "IDMAP_VERSION"); if (vers == IDMAP_VERSION) @@ -375,16 +374,21 @@ static BOOL idmap_convert(const char *idmap_name) return False; #endif - bytereversed = (IREV(vers) == IDMAP_VERSION) ? True : False; - - if ((vers == -1) || bytereversed) { + if ((vers == -1) || (IREV(vers) == IDMAP_VERSION)) { /* Arrggghh ! Bytereversed or missing - make order independent ! */ + /* + * If the header needed to be converted then the + * high and low records may have been created on a + * foreign endian machine and will need byte-reversing. + */ + + BOOL bytereverse_needed = (idmap_tdb->flags & TDB_CONVERT); int32 wm; wm = tdb_fetch_int32(idmap_tdb, HWM_USER); - if (wm != -1 && bytereversed) { - /* A record existed and it was from a big endian machine. */ + if (wm != -1 && bytereverse_needed) { + /* A record existed and it was from a foreign endian machine. */ wm = IREV(wm); } else if (wm == -1) wm = server_state.uid_low; @@ -395,8 +399,8 @@ static BOOL idmap_convert(const char *idmap_name) } wm = tdb_fetch_int32(idmap_tdb, HWM_GROUP); - if (wm != -1 && bytereversed) { - /* A record existed and it was from a big endian machine. */ + if (wm != -1 && bytereverse_needed) { + /* A record existed and it was from a foreign endian machine. */ wm = IREV(wm); } else if (wm == -1) wm = server_state.gid_low; |