summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-11-22 02:05:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:22 -0500
commita9e31b33b55a873c2f01db5e348560176adf863d (patch)
tree603f4cb99999eea881f6092fb6cbbbcb8daca184 /source4/rpc_server
parent4889eb9f7aae9349e426d0f6d2217adff67eaebd (diff)
downloadsamba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.gz
samba-a9e31b33b55a873c2f01db5e348560176adf863d.tar.bz2
samba-a9e31b33b55a873c2f01db5e348560176adf863d.zip
r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized returns a const string - ldb_dn_alloc_linearized allocs astring with the linearized dn (This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/drsuapi/dcesrv_drsuapi.c2
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c20
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c4
-rw-r--r--source4/rpc_server/samr/dcesrv_samr.c26
-rw-r--r--source4/rpc_server/samr/samr_password.c12
5 files changed, 32 insertions, 32 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
index b7a5b2d242..1eb106066b 100644
--- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
+++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c
@@ -311,7 +311,7 @@ static WERROR drsuapi_DsWriteAccountSpn(struct dcesrv_call_state *dce_call, TALL
ret = samdb_modify(b_state->sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(0,("Failed to modify SPNs on %s: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_dn_get_linearized(msg->dn),
ldb_errstring(b_state->sam_ctx)));
r->out.res.res1.status = WERR_ACCESS_DENIED;
} else {
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index af67835d03..beae1e340a 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -338,7 +338,7 @@ static NTSTATUS lsa_get_policy_state(struct dcesrv_call_state *dce_call, TALLOC_
talloc_free(dom_res);
ref_filter = talloc_asprintf(state, "(&(objectclass=crossRef)(ncName=%s))",
- ldb_dn_linearize(mem_ctx, state->domain_dn));
+ ldb_dn_get_linearized(state->domain_dn));
if (!ref_filter) {
return NT_STATUS_NO_MEMORY;
}
@@ -829,7 +829,7 @@ static NTSTATUS lsa_CreateTrustedDomain(struct dcesrv_call_state *dce_call, TALL
if (ret < 0 || ret > 1) {
DEBUG(0,("Found %d records matching DN %s\n", ret,
- ldb_dn_linearize(mem_ctx, policy_state->system_dn)));
+ ldb_dn_get_linearized(policy_state->system_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -858,7 +858,7 @@ static NTSTATUS lsa_CreateTrustedDomain(struct dcesrv_call_state *dce_call, TALL
ret = ldb_add(trusted_domain_state->policy->sam_ldb, msg);
if (ret != LDB_SUCCESS) {
DEBUG(0,("Failed to create trusted_domain record %s: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn), ldb_errstring(trusted_domain_state->policy->sam_ldb)));
+ ldb_dn_get_linearized(msg->dn), ldb_errstring(trusted_domain_state->policy->sam_ldb)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -922,7 +922,7 @@ static NTSTATUS lsa_OpenTrustedDomain(struct dcesrv_call_state *dce_call, TALLOC
if (ret != 1) {
DEBUG(0,("Found %d records matching DN %s\n", ret,
- ldb_dn_linearize(mem_ctx, policy_state->system_dn)));
+ ldb_dn_get_linearized(policy_state->system_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -988,7 +988,7 @@ static NTSTATUS lsa_OpenTrustedDomainByName(struct dcesrv_call_state *dce_call,
if (ret != 1) {
DEBUG(0,("Found %d records matching DN %s\n", ret,
- ldb_dn_linearize(mem_ctx, policy_state->system_dn)));
+ ldb_dn_get_linearized(policy_state->system_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -2004,7 +2004,7 @@ static NTSTATUS lsa_AddRemoveAccountRights(struct dcesrv_call_state *dce_call,
}
DEBUG(3, ("Could not %s attributes from %s: %s",
ldb_flag == LDB_FLAG_MOD_DELETE ? "delete" : "add",
- ldb_dn_linearize(mem_ctx, msg->dn), ldb_errstring(state->sam_ldb)));
+ ldb_dn_get_linearized(msg->dn), ldb_errstring(state->sam_ldb)));
return NT_STATUS_UNEXPECTED_IO_ERROR;
}
@@ -2269,7 +2269,7 @@ static NTSTATUS lsa_CreateSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = samdb_add(secret_state->sam_ldb, mem_ctx, msg);
if (ret != 0) {
DEBUG(0,("Failed to create secret record %s: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_dn_get_linearized(msg->dn),
ldb_errstring(secret_state->sam_ldb)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -2344,7 +2344,7 @@ static NTSTATUS lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
if (ret != 1) {
DEBUG(0,("Found %d records matching DN %s\n", ret,
- ldb_dn_linearize(mem_ctx, policy_state->system_dn)));
+ ldb_dn_get_linearized(policy_state->system_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -2369,7 +2369,7 @@ static NTSTATUS lsa_OpenSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *m
if (ret != 1) {
DEBUG(0,("Found %d records matching DN %s\n", ret,
- ldb_dn_linearize(mem_ctx, policy_state->system_dn)));
+ ldb_dn_get_linearized(policy_state->system_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
}
@@ -2521,7 +2521,7 @@ static NTSTATUS lsa_SetSecret(struct dcesrv_call_state *dce_call, TALLOC_CTX *me
if (ret != 1) {
DEBUG(0,("Found %d records matching dn=%s\n", ret,
- ldb_dn_linearize(mem_ctx, secret_state->secret_dn)));
+ ldb_dn_get_linearized(secret_state->secret_dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index 9b43d1c70f..f05551bf42 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -905,7 +905,7 @@ static NTSTATUS netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_call, TALL
ret = gendb_search(sam_ctx, mem_ctx, partitions_basedn,
&ref_res, ref_attrs,
"(&(objectClass=crossRef)(ncName=%s))",
- ldb_dn_linearize(mem_ctx, res1[0]->dn));
+ ldb_dn_get_linearized(res1[0]->dn));
if (ret != 1) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -1151,7 +1151,7 @@ static WERROR netr_DsrEnumerateDomainTrusts(struct dcesrv_call_state *dce_call,
ret = gendb_search(sam_ctx, mem_ctx, partitions_basedn, &ref_res, ref_attrs,
"(&(objectClass=crossRef)(ncName=%s))",
- ldb_dn_linearize(mem_ctx, dom_res[0]->dn));
+ ldb_dn_get_linearized(dom_res[0]->dn));
if (ret == -1) {
return WERR_GENERAL_FAILURE;
}
diff --git a/source4/rpc_server/samr/dcesrv_samr.c b/source4/rpc_server/samr/dcesrv_samr.c
index 3e8650eb55..ae8089b051 100644
--- a/source4/rpc_server/samr/dcesrv_samr.c
+++ b/source4/rpc_server/samr/dcesrv_samr.c
@@ -340,7 +340,7 @@ static NTSTATUS samr_EnumDomains(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = gendb_search(c_state->sam_ctx, mem_ctx, partitions_basedn,
&ref_msgs, ref_attrs,
"(&(objectClass=crossRef)(ncName=%s))",
- ldb_dn_linearize(mem_ctx, dom_msgs[i]->dn));
+ ldb_dn_get_linearized(dom_msgs[i]->dn));
if (ret == 1) {
array->entries[i].name.string = samdb_result_string(ref_msgs[0], "nETBIOSName", NULL);
} else {
@@ -399,7 +399,7 @@ static NTSTATUS samr_OpenDomain(struct dcesrv_call_state *dce_call, TALLOC_CTX *
ret = gendb_search(c_state->sam_ctx,
mem_ctx, partitions_basedn, &ref_msgs, ref_attrs,
"(&(&(nETBIOSName=*)(objectclass=crossRef))(ncName=%s))",
- ldb_dn_linearize(mem_ctx, dom_msgs[0]->dn));
+ ldb_dn_get_linearized(dom_msgs[0]->dn));
if (ret == 0) {
domain_name = ldb_msg_find_attr_as_string(dom_msgs[0], "cn", NULL);
if (domain_name == NULL) {
@@ -880,7 +880,7 @@ static NTSTATUS samr_SetDomainInfo(struct dcesrv_call_state *dce_call, TALLOC_CT
ret = samdb_replace(sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(1,("Failed to modify record %s: %s\n",
- ldb_dn_linearize(mem_ctx, d_state->domain_dn),
+ ldb_dn_get_linearized(d_state->domain_dn),
ldb_errstring(sam_ctx)));
/* we really need samdb.c to return NTSTATUS */
@@ -946,7 +946,7 @@ static NTSTATUS samr_CreateDomainGroup(struct dcesrv_call_state *dce_call, TALLO
ret = samdb_add(d_state->sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(0,("Failed to create group record %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn)));
+ ldb_dn_get_linearized(msg->dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -1244,7 +1244,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX
if (ret != 1) {
ldb_transaction_cancel(d_state->sam_ctx);
DEBUG(0,("Apparently we failed to create an account record, as %s now doesn't exist\n",
- ldb_dn_linearize(mem_ctx, msg->dn)));
+ ldb_dn_get_linearized(msg->dn)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
sid = samdb_result_dom_sid(mem_ctx, msgs[0], "objectSid");
@@ -1283,7 +1283,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = samdb_replace(a_state->sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(0,("Failed to modify account record %s to set userAccountControl: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_dn_get_linearized(msg->dn),
ldb_errstring(d_state->sam_ctx)));
ldb_transaction_cancel(d_state->sam_ctx);
@@ -1294,7 +1294,7 @@ static NTSTATUS samr_CreateUser2(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = ldb_transaction_commit(d_state->sam_ctx);
if (ret != 0) {
DEBUG(0,("Failed to commit transaction to add and modify account record %s: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_dn_get_linearized(msg->dn),
ldb_errstring(d_state->sam_ctx)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -1484,7 +1484,7 @@ static NTSTATUS samr_CreateDomAlias(struct dcesrv_call_state *dce_call, TALLOC_C
return NT_STATUS_ALIAS_EXISTS;
default:
DEBUG(0,("Failed to create alias record %s: %s\n",
- ldb_dn_linearize(mem_ctx, msg->dn),
+ ldb_dn_get_linearized(msg->dn),
ldb_errstring(d_state->sam_ctx)));
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -2102,7 +2102,7 @@ static NTSTATUS samr_AddGroupMember(struct dcesrv_call_state *dce_call, TALLOC_C
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- memberdn = ldb_dn_linearize(mem_ctx, res->msgs[0]->dn);
+ memberdn = ldb_dn_alloc_linearized(mem_ctx, res->msgs[0]->dn);
if (memberdn == NULL)
return NT_STATUS_NO_MEMORY;
@@ -2205,7 +2205,7 @@ static NTSTATUS samr_DeleteGroupMember(struct dcesrv_call_state *dce_call, TALLO
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
- memberdn = ldb_dn_linearize(mem_ctx, res->msgs[0]->dn);
+ memberdn = ldb_dn_alloc_linearized(mem_ctx, res->msgs[0]->dn);
if (memberdn == NULL)
return NT_STATUS_NO_MEMORY;
@@ -2587,7 +2587,7 @@ static NTSTATUS samr_AddAliasMember(struct dcesrv_call_state *dce_call, TALLOC_C
mod->dn = talloc_reference(mem_ctx, a_state->account_dn);
if (samdb_msg_add_addval(d_state->sam_ctx, mem_ctx, mod, "member",
- ldb_dn_linearize(mem_ctx, memberdn)) != 0)
+ ldb_dn_alloc_linearized(mem_ctx, memberdn)) != 0)
return NT_STATUS_UNSUCCESSFUL;
if (samdb_modify(a_state->sam_ctx, mem_ctx, mod) != 0)
@@ -3406,7 +3406,7 @@ static NTSTATUS samr_SetUserInfo(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = samdb_replace(a_state->sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(1,("Failed to modify record %s: %s\n",
- ldb_dn_linearize(mem_ctx, a_state->account_dn),
+ ldb_dn_get_linearized(a_state->account_dn),
ldb_errstring(a_state->sam_ctx)));
/* we really need samdb.c to return NTSTATUS */
@@ -3439,7 +3439,7 @@ static NTSTATUS samr_GetGroupsForUser(struct dcesrv_call_state *dce_call, TALLOC
count = samdb_search_domain(a_state->sam_ctx, mem_ctx, d_state->domain_dn, &res,
attrs, d_state->domain_sid,
"(&(member=%s)(grouptype=%d)(objectclass=group))",
- ldb_dn_linearize(mem_ctx, a_state->account_dn),
+ ldb_dn_get_linearized(a_state->account_dn),
GTYPE_SECURITY_GLOBAL_GROUP);
if (count < 0)
return NT_STATUS_INTERNAL_DB_CORRUPTION;
diff --git a/source4/rpc_server/samr/samr_password.c b/source4/rpc_server/samr/samr_password.c
index 3d15a29735..160f53742e 100644
--- a/source4/rpc_server/samr/samr_password.c
+++ b/source4/rpc_server/samr/samr_password.c
@@ -158,7 +158,7 @@ NTSTATUS samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = samdb_replace(sam_ctx, mem_ctx, msg);
if (ret != 0) {
DEBUG(2,("Failed to modify record to change password on %s: %s\n",
- ldb_dn_linearize(mem_ctx, a_state->account_dn),
+ ldb_dn_get_linearized(a_state->account_dn),
ldb_errstring(sam_ctx)));
ldb_transaction_cancel(sam_ctx);
return NT_STATUS_INTERNAL_DB_CORRUPTION;
@@ -168,7 +168,7 @@ NTSTATUS samr_ChangePasswordUser(struct dcesrv_call_state *dce_call, TALLOC_CTX
ret = ldb_transaction_commit(sam_ctx);
if (ret != 0) {
DEBUG(1,("Failed to commit transaction to change password on %s: %s\n",
- ldb_dn_linearize(mem_ctx, a_state->account_dn),
+ ldb_dn_get_linearized(a_state->account_dn),
ldb_errstring(sam_ctx)));
return NT_STATUS_TRANSACTION_ABORTED;
}
@@ -290,7 +290,7 @@ NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, TALLOC_
ret = samdb_replace(sam_ctx, mem_ctx, mod);
if (ret != 0) {
DEBUG(2,("Failed to modify record to change password on %s: %s\n",
- ldb_dn_linearize(mem_ctx, user_dn),
+ ldb_dn_get_linearized(user_dn),
ldb_errstring(sam_ctx)));
ldb_transaction_cancel(sam_ctx);
return NT_STATUS_INTERNAL_DB_CORRUPTION;
@@ -300,7 +300,7 @@ NTSTATUS samr_OemChangePasswordUser2(struct dcesrv_call_state *dce_call, TALLOC_
ret = ldb_transaction_commit(sam_ctx);
if (ret != 0) {
DEBUG(1,("Failed to commit transaction to change password on %s: %s\n",
- ldb_dn_linearize(mem_ctx, user_dn),
+ ldb_dn_get_linearized(user_dn),
ldb_errstring(sam_ctx)));
return NT_STATUS_TRANSACTION_ABORTED;
}
@@ -443,7 +443,7 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
ret = samdb_replace(sam_ctx, mem_ctx, mod);
if (ret != 0) {
DEBUG(2,("samdb_replace failed to change password for %s: %s\n",
- ldb_dn_linearize(mem_ctx, user_dn),
+ ldb_dn_get_linearized(user_dn),
ldb_errstring(sam_ctx)));
status = NT_STATUS_UNSUCCESSFUL;
goto failed;
@@ -453,7 +453,7 @@ NTSTATUS samr_ChangePasswordUser3(struct dcesrv_call_state *dce_call,
ret = ldb_transaction_commit(sam_ctx);
if (ret != 0) {
DEBUG(1,("Failed to commit transaction to change password on %s: %s\n",
- ldb_dn_linearize(mem_ctx, user_dn),
+ ldb_dn_get_linearized(user_dn),
ldb_errstring(sam_ctx)));
status = NT_STATUS_TRANSACTION_ABORTED;
goto failed;