summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2011-01-09 11:27:01 +0100
committerMatthias Dieter Wallnöfer <mdw@samba.org>2011-01-12 19:52:19 +0100
commit90db6a793ad368690b178e5c170c05be79aaa884 (patch)
treee50867fbe81f1e2b14460616a80548d5d4a56bef /source4/winbind
parent25964e775ac9e2700025e1beadc09ead31e25d0b (diff)
downloadsamba-90db6a793ad368690b178e5c170c05be79aaa884.tar.gz
samba-90db6a793ad368690b178e5c170c05be79aaa884.tar.bz2
samba-90db6a793ad368690b178e5c170c05be79aaa884.zip
s4:winbind/idmap.c - we cannot use "failed" until we are in a transaction
We've to wait until "trans" is initialised.
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/idmap.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c
index be679db1cc..832633114f 100644
--- a/source4/winbind/idmap.c
+++ b/source4/winbind/idmap.c
@@ -311,7 +311,10 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
uint32_t rid;
DEBUG(6, ("This is a local unix uid, just calculate that.\n"));
status = dom_sid_split_rid(tmp_ctx, sid, NULL, &rid);
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(tmp_ctx);
+ return status;
+ }
unixid->id = rid;
unixid->type = ID_TYPE_UID;
@@ -324,7 +327,10 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
uint32_t rid;
DEBUG(6, ("This is a local unix gid, just calculate that.\n"));
status = dom_sid_split_rid(tmp_ctx, sid, NULL, &rid);
- if (!NT_STATUS_IS_OK(status)) goto failed;
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(tmp_ctx);
+ return status;
+ }
unixid->id = rid;
unixid->type = ID_TYPE_GID;
@@ -338,8 +344,8 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
ldap_encode_ndr_dom_sid(tmp_ctx, sid));
if (ret != LDB_SUCCESS) {
DEBUG(1, ("Search failed: %s\n", ldb_errstring(ldb)));
- status = NT_STATUS_NONE_MAPPED;
- goto failed;
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NONE_MAPPED;
}
if (res->count == 1) {
@@ -349,14 +355,14 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
-1);
if (new_xid == (uint32_t) -1) {
DEBUG(1, ("Invalid xid mapping.\n"));
- status = NT_STATUS_NONE_MAPPED;
- goto failed;
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NONE_MAPPED;
}
if (type == NULL) {
DEBUG(1, ("Invalid type for mapping entry.\n"));
- status = NT_STATUS_NONE_MAPPED;
- goto failed;
+ talloc_free(tmp_ctx);
+ return NT_STATUS_NONE_MAPPED;
}
unixid->id = new_xid;