summaryrefslogtreecommitdiff
path: root/source4/lib/samba3/group.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-25 19:02:03 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:34:35 -0500
commit69fb6840637e07318914d632571c8481f3573461 (patch)
tree0a1dd4cc4b91ab314ce02ea20c219a67c05aa154 /source4/lib/samba3/group.c
parent9bf5e494f7ccbb2a9587dce961a99fa07392bf97 (diff)
downloadsamba-69fb6840637e07318914d632571c8481f3573461.tar.gz
samba-69fb6840637e07318914d632571c8481f3573461.tar.bz2
samba-69fb6840637e07318914d632571c8481f3573461.zip
r9621: Bunch of bug fixes. Add 'format' option to samba3dump (text,summary,ldif)
(This used to be commit dc6aab8d4a6d0fe47756c90d3d311b6009d571ff)
Diffstat (limited to 'source4/lib/samba3/group.c')
-rw-r--r--source4/lib/samba3/group.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/lib/samba3/group.c b/source4/lib/samba3/group.c
index fc8f8c40b8..68ac5987d0 100644
--- a/source4/lib/samba3/group.c
+++ b/source4/lib/samba3/group.c
@@ -46,8 +46,9 @@ NTSTATUS samba3_read_grouptdb(const char *file, TALLOC_CTX *ctx, struct samba3_g
int32_t vers_id;
TDB_DATA kbuf, dbuf, newkey;
int ret;
-
- TDB_CONTEXT *tdb = tdb_open(file, 0, TDB_DEFAULT, O_RDONLY, 0600);
+ TDB_CONTEXT *tdb;
+
+ tdb = tdb_open(file, 0, TDB_DEFAULT, O_RDONLY, 0600);
if (!tdb) {
DEBUG(0,("Failed to open group mapping database\n"));
return NT_STATUS_UNSUCCESSFUL;
@@ -61,6 +62,7 @@ NTSTATUS samba3_read_grouptdb(const char *file, TALLOC_CTX *ctx, struct samba3_g
}
if (vers_id != DATABASE_VERSION_V2) {
+ DEBUG(0, ("Group database version mismatch: %d\n", vers_id));
return NT_STATUS_UNSUCCESSFUL;
}
@@ -80,19 +82,17 @@ NTSTATUS samba3_read_grouptdb(const char *file, TALLOC_CTX *ctx, struct samba3_g
if (!dbuf.dptr)
continue;
- map.sid = dom_sid_parse_talloc(tdb, kbuf.dptr+strlen(GROUP_PREFIX));
+ map.sid = dom_sid_parse_talloc(ctx, kbuf.dptr+strlen(GROUP_PREFIX));
ret = tdb_unpack(tdb, dbuf.dptr, dbuf.dsize, "ddff",
&map.gid, &map.sid_name_use, &map.nt_name, &map.comment);
- SAFE_FREE(dbuf.dptr);
-
if ( ret == -1 ) {
DEBUG(3,("enum_group_mapping: tdb_unpack failure\n"));
continue;
}
- db->groupmappings = talloc_realloc(tdb, db->groupmappings, struct samba3_groupmapping, db->groupmap_count+1);
+ db->groupmappings = talloc_realloc(ctx, db->groupmappings, struct samba3_groupmapping, db->groupmap_count+1);
if (!db->groupmappings)
return NT_STATUS_NO_MEMORY;