svn commit: samba r16700 - in trunk/source/smbd: .
vlendec at samba.org
vlendec at samba.org
Thu Jun 29 22:21:06 GMT 2006
Author: vlendec
Date: 2006-06-29 22:21:06 +0000 (Thu, 29 Jun 2006)
New Revision: 16700
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16700
Log:
Get rid of a use of talloc_steal
Modified:
trunk/source/smbd/service.c
Changeset:
Modified: trunk/source/smbd/service.c
===================================================================
--- trunk/source/smbd/service.c 2006-06-29 22:16:58 UTC (rev 16699)
+++ trunk/source/smbd/service.c 2006-06-29 22:21:06 UTC (rev 16700)
@@ -371,35 +371,38 @@
{
TALLOC_CTX *mem_ctx;
char *fuser, *found_username;
+ struct nt_user_token *tmp_token;
NTSTATUS result;
- mem_ctx = talloc_new(NULL);
- if (mem_ctx == NULL) {
+ if (!(mem_ctx = talloc_new(NULL))) {
DEBUG(0, ("talloc_new failed\n"));
return NT_STATUS_NO_MEMORY;
}
- fuser = talloc_string_sub(mem_ctx, lp_force_user(snum), "%S",
- lp_servicename(snum));
- if (fuser == NULL) {
- result = NT_STATUS_NO_MEMORY;
- goto done;
+ if (!(fuser = talloc_string_sub(mem_ctx, lp_force_user(snum), "%S",
+ lp_servicename(snum)))) {
+ TALLOC_FREE(mem_ctx);
+ return NT_STATUS_NO_MEMORY;
+
}
result = create_token_from_username(mem_ctx, fuser, vuser_is_guest,
uid, gid, &found_username,
- token);
+ &tmp_token);
if (!NT_STATUS_IS_OK(result)) {
- goto done;
+ TALLOC_FREE(mem_ctx);
+ return result;
}
- talloc_steal(NULL, *token);
+ if (!(*token = dup_nt_token(NULL, tmp_token))) {
+ TALLOC_FREE(mem_ctx);
+ return NT_STATUS_NO_MEMORY;
+ }
+
fstrcpy(username, found_username);
- result = NT_STATUS_OK;
- done:
TALLOC_FREE(mem_ctx);
- return result;
+ return NT_STATUS_OK;
}
/*
More information about the samba-cvs
mailing list