diff options
author | Simo Sorce <idra@samba.org> | 2003-04-30 16:35:17 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-04-30 16:35:17 +0000 |
commit | 28cef867c761ac87101e3049628cfe2a073e65f2 (patch) | |
tree | 564aab00d2d9f1ea294d446441f07092c7116686 /source3/sam/idmap_tdb.c | |
parent | 211939f3ab6310c09eb34c67f4097453d862ac5c (diff) | |
download | samba-28cef867c761ac87101e3049628cfe2a073e65f2.tar.gz samba-28cef867c761ac87101e3049628cfe2a073e65f2.tar.xz samba-28cef867c761ac87101e3049628cfe2a073e65f2.zip |
correctly initiazlize idmap tdb when creationg new
few fixes to *id_to_*id functions, we don't set the mapping for algoritmic
RIDs, they are resolved in the classic way
eliminate getpw* calls from tdbsam
(This used to be commit 6a7689cf74cd4d5f29e0b12f4bf8ac3051d49157)
Diffstat (limited to 'source3/sam/idmap_tdb.c')
-rw-r--r-- | source3/sam/idmap_tdb.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/source3/sam/idmap_tdb.c b/source3/sam/idmap_tdb.c index 13e3affbd6..f85d2db086 100644 --- a/source3/sam/idmap_tdb.c +++ b/source3/sam/idmap_tdb.c @@ -301,30 +301,30 @@ static NTSTATUS db_idmap_init(void) } /* Create high water marks for group and user id */ - if (tdb_fetch_int32(idmap_tdb, HWM_USER) == -1) { - if (tdb_store_int32(idmap_tdb, HWM_USER, idmap_state.uid_low) == -1) { - DEBUG(0, ("idmap_init: Unable to initialise user hwm in idmap database\n")); - return NT_STATUS_INTERNAL_DB_ERROR; - } - } - - if (tdb_fetch_int32(idmap_tdb, HWM_GROUP) == -1) { - if (tdb_store_int32(idmap_tdb, HWM_GROUP, idmap_state.gid_low) == -1) { - DEBUG(0, ("idmap_init: Unable to initialise group hwm in idmap database\n")); - return NT_STATUS_INTERNAL_DB_ERROR; - } - } - if (!lp_idmap_uid(&idmap_state.uid_low, &idmap_state.uid_high)) { DEBUG(0, ("idmap uid range missing or invalid\n")); DEBUGADD(0, ("idmap will be unable to map foreign SIDs\n")); + } else { + if (tdb_fetch_int32(idmap_tdb, HWM_USER) == -1) { + if (tdb_store_int32(idmap_tdb, HWM_USER, idmap_state.uid_low) == -1) { + DEBUG(0, ("idmap_init: Unable to initialise user hwm in idmap database\n")); + return NT_STATUS_INTERNAL_DB_ERROR; + } + } } - + if (!lp_idmap_gid(&idmap_state.gid_low, &idmap_state.gid_high)) { DEBUG(0, ("idmap gid range missing or invalid\n")); DEBUGADD(0, ("idmap will be unable to map foreign SIDs\n")); + } else { + if (tdb_fetch_int32(idmap_tdb, HWM_GROUP) == -1) { + if (tdb_store_int32(idmap_tdb, HWM_GROUP, idmap_state.gid_low) == -1) { + DEBUG(0, ("idmap_init: Unable to initialise group hwm in idmap database\n")); + return NT_STATUS_INTERNAL_DB_ERROR; + } + } } - + return NT_STATUS_OK; } |