summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_idmap.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2000-05-12 06:27:35 +0000
committerTim Potter <tpot@samba.org>2000-05-12 06:27:35 +0000
commit4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c (patch)
treeca65489e43e909ee8e5dbda7a50c415c40fc8d45 /source3/nsswitch/winbindd_idmap.c
parent7738941ccf4ebcaccea872619c465a45fb7bf0ae (diff)
downloadsamba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.tar.gz
samba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.tar.bz2
samba-4cdc54ba244f72a4a143e7a0e0c0b4fcfaa13d3c.zip
While we're all making incompatible tdb changes, I changed the implementation
of tdb_{store,get}_int() to store the length of the string key + 1 so the stored key contains the trailing NULL character. This allows normal string library routines to manipulate keys. Also renamed tdb_get_int() to tdb_fetch_int() to keep the set of verbs consistent. (This used to be commit a423c7c5f21dc4046530b85482dee88dcfcbf070)
Diffstat (limited to 'source3/nsswitch/winbindd_idmap.c')
-rw-r--r--source3/nsswitch/winbindd_idmap.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_idmap.c b/source3/nsswitch/winbindd_idmap.c
index cd3fd2caab..15a9ac4009 100644
--- a/source3/nsswitch/winbindd_idmap.c
+++ b/source3/nsswitch/winbindd_idmap.c
@@ -40,7 +40,8 @@ static BOOL allocate_id(int *id, BOOL isgroup)
/* Get current high water mark */
- if ((hwm = tdb_get_int(idmap_tdb, isgroup ? HWM_GROUP : HWM_USER)) == -1) {
+ if ((hwm = tdb_fetch_int(idmap_tdb,
+ isgroup ? HWM_GROUP : HWM_USER)) == -1) {
return False;
}
@@ -217,14 +218,14 @@ BOOL winbindd_idmap_init(void)
/* Create high water marks for group and user id */
- if (tdb_get_int(idmap_tdb, HWM_USER) == -1) {
+ if (tdb_fetch_int(idmap_tdb, HWM_USER) == -1) {
if (tdb_store_int(idmap_tdb, HWM_USER, server_state.uid_low) == -1) {
DEBUG(0, ("Unable to initialise user hwm in idmap database\n"));
return False;
}
}
- if (tdb_get_int(idmap_tdb, HWM_GROUP) == -1) {
+ if (tdb_fetch_int(idmap_tdb, HWM_GROUP) == -1) {
if (tdb_store_int(idmap_tdb, HWM_GROUP, server_state.gid_low) == -1) {
DEBUG(0, ("Unable to initialise group hwm in idmap database\n"));
return False;