summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_samr_nt.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c
index a04584e7c1..116d529025 100644
--- a/source3/rpc_server/srv_samr_nt.c
+++ b/source3/rpc_server/srv_samr_nt.c
@@ -1933,12 +1933,14 @@ NTSTATUS _samr_ChangePasswordUser2(struct pipes_struct *p,
struct samr_ChangePasswordUser2 *r)
{
NTSTATUS status;
- fstring user_name;
+ char *user_name = NULL;
fstring wks;
DEBUG(5,("_samr_ChangePasswordUser2: %d\n", __LINE__));
- fstrcpy(user_name, r->in.account->string);
+ if (!r->in.account->string) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
fstrcpy(wks, r->in.server->string);
DEBUG(5,("_samr_ChangePasswordUser2: user: %s wks: %s\n", user_name, wks));
@@ -1948,7 +1950,10 @@ NTSTATUS _samr_ChangePasswordUser2(struct pipes_struct *p,
* function.
*/
- (void)map_username(user_name);
+ (void)map_username(talloc_tos(), r->in.account->string, &user_name);
+ if (!user_name) {
+ return NT_STATUS_NO_MEMORY;
+ }
/*
* UNIX username case mangling not required, pass_oem_change
@@ -1980,12 +1985,14 @@ NTSTATUS _samr_OemChangePasswordUser2(struct pipes_struct *p,
struct samr_OemChangePasswordUser2 *r)
{
NTSTATUS status;
- fstring user_name;
+ char *user_name = NULL;
const char *wks = NULL;
DEBUG(5,("_samr_OemChangePasswordUser2: %d\n", __LINE__));
- fstrcpy(user_name, r->in.account->string);
+ if (!r->in.account->string) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
if (r->in.server && r->in.server->string) {
wks = r->in.server->string;
}
@@ -1997,7 +2004,10 @@ NTSTATUS _samr_OemChangePasswordUser2(struct pipes_struct *p,
* function.
*/
- (void)map_username(user_name);
+ (void)map_username(talloc_tos(), r->in.account->string, &user_name);
+ if (!user_name) {
+ return NT_STATUS_NO_MEMORY;
+ }
/*
* UNIX username case mangling not required, pass_oem_change
@@ -2033,7 +2043,7 @@ NTSTATUS _samr_ChangePasswordUser3(struct pipes_struct *p,
struct samr_ChangePasswordUser3 *r)
{
NTSTATUS status;
- fstring user_name;
+ char *user_name = NULL;
const char *wks = NULL;
enum samPwdChangeReason reject_reason;
struct samr_DomInfo1 *dominfo = NULL;
@@ -2042,7 +2052,9 @@ NTSTATUS _samr_ChangePasswordUser3(struct pipes_struct *p,
DEBUG(5,("_samr_ChangePasswordUser3: %d\n", __LINE__));
- fstrcpy(user_name, r->in.account->string);
+ if (!r->in.account->string) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
if (r->in.server && r->in.server->string) {
wks = r->in.server->string;
}
@@ -2054,7 +2066,10 @@ NTSTATUS _samr_ChangePasswordUser3(struct pipes_struct *p,
* function.
*/
- (void)map_username(user_name);
+ (void)map_username(talloc_tos(), r->in.account->string, &user_name);
+ if (!user_name) {
+ return NT_STATUS_NO_MEMORY;
+ }
/*
* UNIX username case mangling not required, pass_oem_change