summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-04-25 00:56:43 +0000
committerJeremy Allison <jra@samba.org>2002-04-25 00:56:43 +0000
commit52c7c149c5675d5d718455099f89a9cc9911d545 (patch)
tree252e5fb7d855c75aa3febec76d76abbba1fa9f43 /source3
parenteb0736b09bc3552a3e2bebfce06df16c5538f12a (diff)
downloadsamba-52c7c149c5675d5d718455099f89a9cc9911d545.tar.gz
samba-52c7c149c5675d5d718455099f89a9cc9911d545.tar.bz2
samba-52c7c149c5675d5d718455099f89a9cc9911d545.zip
Fix from Herb for upgrading from big-endian earlier databases.
Jeremy. (This used to be commit e65563fc9eb454988c11c12e3e979dd07e3032a3)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/winbindd_idmap.c8
1 files 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;
}