summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-09-26 17:59:02 +0200
committerAndreas Schneider <asn@cryptomilk.org>2011-09-26 19:56:04 +0200
commitb93eae206433450fbd45ce96bff2c0be5a055a70 (patch)
treeaf742139b97e0513a7468bb89fdfff16a79cdac0 /source3/rpc_server
parentf7419172f03089276cab71c41419a5c57508d42e (diff)
downloadsamba-b93eae206433450fbd45ce96bff2c0be5a055a70.tar.gz
samba-b93eae206433450fbd45ce96bff2c0be5a055a70.tar.bz2
samba-b93eae206433450fbd45ce96bff2c0be5a055a70.zip
s3-samr: Remove fstring in samr.
Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Sep 26 19:56:04 CEST 2011 on sn-devel-104
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/samr/srv_samr_nt.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/source3/rpc_server/samr/srv_samr_nt.c b/source3/rpc_server/samr/srv_samr_nt.c
index 9cd08873dd..567265d323 100644
--- a/source3/rpc_server/samr/srv_samr_nt.c
+++ b/source3/rpc_server/samr/srv_samr_nt.c
@@ -1834,14 +1834,16 @@ NTSTATUS _samr_ChangePasswordUser2(struct pipes_struct *p,
NTSTATUS status;
char *user_name = NULL;
char *rhost;
- fstring wks;
+ const char *wks = NULL;
DEBUG(5,("_samr_ChangePasswordUser2: %d\n", __LINE__));
if (!r->in.account->string) {
return NT_STATUS_INVALID_PARAMETER;
}
- fstrcpy(wks, r->in.server->string);
+ if (r->in.server && r->in.server->string) {
+ wks = r->in.server->string;
+ }
DEBUG(5,("_samr_ChangePasswordUser2: user: %s wks: %s\n", user_name, wks));
@@ -6146,7 +6148,7 @@ NTSTATUS _samr_SetAliasInfo(struct pipes_struct *p,
switch (r->in.level) {
case ALIASINFONAME:
{
- fstring group_name;
+ char *group_name;
/* We currently do not support renaming groups in the
the BUILTIN domain. Refer to util_builtin.c to understand
@@ -6178,9 +6180,16 @@ NTSTATUS _samr_SetAliasInfo(struct pipes_struct *p,
/* make sure the name doesn't already exist as a user
or local group */
- fstr_sprintf(group_name, "%s\\%s",
- lp_netbios_name(), info->acct_name);
+ group_name = talloc_asprintf(p->mem_ctx,
+ "%s\\%s",
+ lp_netbios_name(),
+ info->acct_name);
+ if (group_name == NULL) {
+ return NT_STATUS_NO_MEMORY;
+ }
+
status = can_create( p->mem_ctx, group_name );
+ talloc_free(group_name);
if ( !NT_STATUS_IS_OK( status ) )
return status;
break;