ret = ldb_search(remote_ldb, account_dn, LDB_SCOPE_BASE,
NULL, attrs, &res);
if (ret != LDB_SUCCESS || res->count != 1) {
- r->out.error_string = talloc_asprintf(r, "ldb_search for %s failed - %s\n",
+ r->out.error_string = talloc_asprintf(r, "ldb_search for %s failed - %s",
account_dn_str, ldb_errstring(remote_ldb));
talloc_free(tmp_ctx);
return NT_STATUS_UNSUCCESSFUL;
if (rtn != 0) {
r->out.error_string
= talloc_asprintf(r,
- "Failed to replace entries on %s\n",
+ "Failed to replace entries on %s",
ldb_dn_linearize(tmp_ctx, msg->dn));
talloc_free(tmp_ctx);
return NT_STATUS_INTERNAL_DB_CORRUPTION;
if (NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
r->out.error_string
= talloc_asprintf(r,
- "dcerpc_drsuapi_DsCrackNames for [%s] failed - %s\n",
+ "dcerpc_drsuapi_DsCrackNames for [%s] failed - %s",
r->in.domain_name,
dcerpc_errstr(tmp_ctx, drsuapi_pipe->last_fault_code));
talloc_free(tmp_ctx);
} else {
r->out.error_string
= talloc_asprintf(r,
- "dcerpc_drsuapi_DsCrackNames for [%s] failed - %s\n",
+ "dcerpc_drsuapi_DsCrackNames for [%s] failed - %s",
r->in.domain_name,
nt_errstr(status));
talloc_free(tmp_ctx);
/* check if we got one RID for the user */
if (ln.out.rids.count != 1) {
r->out.error_string = talloc_asprintf(mem_ctx,
- "samr_LookupNames for [%s] returns %d RIDs\n",
+ "samr_LookupNames for [%s] returns %d RIDs",
r->in.account_name, ln.out.rids.count);
talloc_free(tmp_ctx);
return NT_STATUS_INVALID_PARAMETER;
status = dcerpc_samr_CreateUser2(samr_pipe, tmp_ctx, &cu);
if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
- "samr_CreateUser2 (recreate) for [%s] failed: %s\n",
+ "samr_CreateUser2 (recreate) for [%s] failed: %s",
r->in.account_name, nt_errstr(status));
talloc_free(tmp_ctx);
return status;
}
} else if (!NT_STATUS_IS_OK(status)) {
r->out.error_string = talloc_asprintf(mem_ctx,
- "samr_CreateUser2 for [%s] failed: %s\n",
+ "samr_CreateUser2 for [%s] failed: %s",
r->in.account_name, nt_errstr(status));
talloc_free(tmp_ctx);
return status;
status = NT_STATUS_INVALID_PARAMETER;
r->out.error_string
= talloc_asprintf(mem_ctx,
- "samr_QueryUserInfo failed to return qui.out.info for [%s]: %s\n",
+ "samr_QueryUserInfo failed to return qui.out.info for [%s]: %s",
r->in.account_name, nt_errstr(status));
talloc_free(tmp_ctx);
return status;
= talloc_asprintf(mem_ctx,
"We asked to create a new machine account (%s) of type %s, "
"but we got an account of type %s. This is unexpected. "
- "Perhaps delete the account and try again.\n",
+ "Perhaps delete the account and try again.",
r->in.account_name, new_account_type, old_account_type);
talloc_free(tmp_ctx);
return NT_STATUS_INVALID_PARAMETER;
= talloc_asprintf(mem_ctx,
"The machine account (%s) already exists in the domain %s, "
"but is a %s. You asked to join as a %s. Please delete "
- "the account and try again.\n",
+ "the account and try again.",
r->in.account_name, connect_with_info->out.domain_name, old_account_type, new_account_type);
talloc_free(tmp_ctx);
return NT_STATUS_USER_EXISTS;
if (!ldb) {
r->out.error_string
= talloc_asprintf(mem_ctx,
- "Could not open secrets database\n");
+ "Could not open secrets database");
talloc_free(tmp_mem);
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
}
/* create the secret */
ret = samdb_add(ldb, tmp_mem, msg);
if (ret != 0) {
- r->out.error_string = talloc_asprintf(mem_ctx, "Failed to create secret record %s\n",
+ r->out.error_string = talloc_asprintf(mem_ctx, "Failed to create secret record %s",
ldb_dn_linearize(ldb, msg->dn));
talloc_free(tmp_mem);
return NT_STATUS_INTERNAL_DB_CORRUPTION;
filter = talloc_asprintf(mem_ctx, "dn=%s", ldb_dn_linearize(mem_ctx, msg->dn));
status = cli_credentials_set_secrets(creds, NULL, filter);
if (!NT_STATUS_IS_OK(status)) {
- r->out.error_string = talloc_asprintf(mem_ctx, "Failed to read secrets for keytab update for %s\n",
+ r->out.error_string = talloc_asprintf(mem_ctx, "Failed to read secrets for keytab update for %s",
filter);
talloc_free(tmp_mem);
return status;
}
ret = cli_credentials_update_keytab(creds);
if (ret != 0) {
- r->out.error_string = talloc_asprintf(mem_ctx, "Failed to update keytab for %s\n",
+ r->out.error_string = talloc_asprintf(mem_ctx, "Failed to update keytab for %s",
filter);
talloc_free(tmp_mem);
return NT_STATUS_UNSUCCESSFUL;
status = libnet_RpcConnect(ctx, mem_ctx, &c);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "Connection to SAMR pipe of PDC of domain '%s' failed: %s\n",
+ "Connection to SAMR pipe of PDC of domain '%s' failed: %s",
r->samr.in.domain_name, nt_errstr(status));
return status;
}
status = dcerpc_samr_ChangePasswordUser3(c.out.dcerpc_pipe, mem_ctx, &pw3);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser3 failed: %s\n",
+ "samr_ChangePasswordUser3 failed: %s",
nt_errstr(status));
goto ChangePasswordUser2;
}
/* check result of samr_ChangePasswordUser3 */
if (!NT_STATUS_IS_OK(pw3.out.result)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser3 for '%s\\%s' failed: %s\n",
+ "samr_ChangePasswordUser3 for '%s\\%s' failed: %s",
r->samr.in.domain_name, r->samr.in.account_name,
nt_errstr(pw3.out.result));
/* TODO: give the reason of the reject */
status = dcerpc_samr_ChangePasswordUser2(c.out.dcerpc_pipe, mem_ctx, &pw2);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser2 failed: %s\n",
+ "samr_ChangePasswordUser2 failed: %s",
nt_errstr(status));
goto OemChangePasswordUser2;
}
/* check result of samr_ChangePasswordUser2 */
if (!NT_STATUS_IS_OK(pw2.out.result)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser2 for '%s\\%s' failed: %s\n",
+ "samr_ChangePasswordUser2 for '%s\\%s' failed: %s",
r->samr.in.domain_name, r->samr.in.account_name,
nt_errstr(pw2.out.result));
if (NT_STATUS_EQUAL(pw2.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
status = dcerpc_samr_OemChangePasswordUser2(c.out.dcerpc_pipe, mem_ctx, &oe2);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_OemChangePasswordUser2 failed: %s\n",
+ "samr_OemChangePasswordUser2 failed: %s",
nt_errstr(status));
goto ChangePasswordUser;
}
/* check result of samr_OemChangePasswordUser2 */
if (!NT_STATUS_IS_OK(oe2.out.result)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_OemChangePasswordUser2 for '%s\\%s' failed: %s\n",
+ "samr_OemChangePasswordUser2 for '%s\\%s' failed: %s",
r->samr.in.domain_name, r->samr.in.account_name,
nt_errstr(oe2.out.result));
if (NT_STATUS_EQUAL(oe2.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
status = dcerpc_samr_ChangePasswordUser(c.pdc.out.dcerpc_pipe, mem_ctx, &pw);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser failed: %s\n",
+ "samr_ChangePasswordUser failed: %s",
nt_errstr(status));
goto disconnect;
}
/* check result of samr_ChangePasswordUser */
if (!NT_STATUS_IS_OK(pw.out.result)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_ChangePasswordUser for '%s\\%s' failed: %s\n",
+ "samr_ChangePasswordUser for '%s\\%s' failed: %s",
r->samr.in.domain_name, r->samr.in.account_name,
nt_errstr(pw.out.result));
if (NT_STATUS_EQUAL(pw.out.result, NT_STATUS_PASSWORD_RESTRICTION)) {
status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string = talloc_asprintf(mem_ctx,
- "dcerpc_fetch_session_key failed: %s\n",
+ "dcerpc_fetch_session_key failed: %s",
nt_errstr(status));
return status;
}
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string
= talloc_asprintf(mem_ctx,
- "SetUserInfo level 26 for [%s] failed: %s\n",
+ "SetUserInfo level 26 for [%s] failed: %s",
r->samr_handle.in.account_name, nt_errstr(status));
}
return status;
status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string = talloc_asprintf(mem_ctx,
- "dcerpc_fetch_session_key failed: %s\n",
+ "dcerpc_fetch_session_key failed: %s",
nt_errstr(status));
return status;
}
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string
= talloc_asprintf(mem_ctx,
- "SetUserInfo level 25 for [%s] failed: %s\n",
+ "SetUserInfo level 25 for [%s] failed: %s",
r->samr_handle.in.account_name, nt_errstr(status));
}
return status;
status = dcerpc_fetch_session_key(r->samr_handle.in.dcerpc_pipe, &session_key);
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string = talloc_asprintf(mem_ctx,
- "dcerpc_fetch_session_key failed: %s\n",
+ "dcerpc_fetch_session_key failed: %s",
nt_errstr(status));
return status;
}
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string
= talloc_asprintf(mem_ctx,
- "SetUserInfo level 24 for [%s] failed: %s\n",
+ "SetUserInfo level 24 for [%s] failed: %s",
r->samr_handle.in.account_name, nt_errstr(status));
}
return status;
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string
= talloc_asprintf(mem_ctx,
- "dcerpc_fetch_session_key failed: %s\n",
+ "dcerpc_fetch_session_key failed: %s",
nt_errstr(status));
return status;
}
if (!NT_STATUS_IS_OK(status)) {
r->samr_handle.out.error_string
= talloc_asprintf(mem_ctx,
- "SetUserInfo level 23 for [%s] failed: %s\n",
+ "SetUserInfo level 23 for [%s] failed: %s",
r->samr_handle.in.account_name, nt_errstr(status));
}
return status;
status = libnet_RpcConnect(ctx, mem_ctx, &c);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "Connection to SAMR pipe of PDC of domain '%s' failed: %s\n",
+ "Connection to SAMR pipe of PDC of domain '%s' failed: %s",
r->samr.in.domain_name, nt_errstr(status));
return status;
}
status = dcerpc_samr_Connect(c.out.dcerpc_pipe, mem_ctx, &sc);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_Connect failed: %s\n",
+ "samr_Connect failed: %s",
nt_errstr(status));
goto disconnect;
}
status = dcerpc_samr_LookupDomain(c.out.dcerpc_pipe, mem_ctx, &ld);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_LookupDomain for [%s] failed: %s\n",
+ "samr_LookupDomain for [%s] failed: %s",
r->samr.in.domain_name, nt_errstr(status));
goto disconnect;
}
status = dcerpc_samr_OpenDomain(c.out.dcerpc_pipe, mem_ctx, &od);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_OpenDomain for [%s] failed: %s\n",
+ "samr_OpenDomain for [%s] failed: %s",
r->samr.in.domain_name, nt_errstr(status));
goto disconnect;
}
status = dcerpc_samr_LookupNames(c.out.dcerpc_pipe, mem_ctx, &ln);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_LookupNames for [%s] failed: %s\n",
+ "samr_LookupNames for [%s] failed: %s",
r->samr.in.account_name, nt_errstr(status));
goto disconnect;
}
/* check if we got one RID for the user */
if (ln.out.rids.count != 1) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_LookupNames for [%s] returns %d RIDs\n",
+ "samr_LookupNames for [%s] returns %d RIDs",
r->samr.in.account_name, ln.out.rids.count);
status = NT_STATUS_INVALID_PARAMETER;
goto disconnect;
status = dcerpc_samr_OpenUser(c.out.dcerpc_pipe, mem_ctx, &ou);
if (!NT_STATUS_IS_OK(status)) {
r->samr.out.error_string = talloc_asprintf(mem_ctx,
- "samr_OpenUser for [%s] failed: %s\n",
+ "samr_OpenUser for [%s] failed: %s",
r->samr.in.account_name, nt_errstr(status));
goto disconnect;
}