summaryrefslogtreecommitdiff
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-19 15:02:59 +0100
committerVolker Lendecke <vl@samba.org>2007-12-19 21:09:10 +0100
commite518e19bc0000019f131354f55e9f5b55f6a2c5e (patch)
tree5c8723a1510ebb17ff4bd21068aa67159ad3a68d /source3/smbd/service.c
parent042201bcc1b7ffc88cdc22b64c70c653b2433703 (diff)
downloadsamba-e518e19bc0000019f131354f55e9f5b55f6a2c5e.tar.gz
samba-e518e19bc0000019f131354f55e9f5b55f6a2c5e.tar.bz2
samba-e518e19bc0000019f131354f55e9f5b55f6a2c5e.zip
Remove Get_Pwnam and its associated static variable
All callers are replaced by Get_Pwnam_alloc (This used to be commit 735f59315497113aebadcf9ad387e3dbfffa284a)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 88ab9f0048..ed43528c76 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -357,6 +357,7 @@ void load_registry_shares(void)
int find_service(fstring service)
{
int iService;
+ TALLOC_CTX *frame = talloc_stackframe();
all_string_sub(service,"\\","/",0);
@@ -364,7 +365,7 @@ int find_service(fstring service)
/* now handle the special case of a home directory */
if (iService < 0) {
- char *phome_dir = get_user_home_dir(service);
+ char *phome_dir = get_user_home_dir(talloc_tos(), service);
if(!phome_dir) {
/*
@@ -372,7 +373,8 @@ int find_service(fstring service)
* be a Windows to unix mapped user name.
*/
if(map_username(service))
- phome_dir = get_user_home_dir(service);
+ phome_dir = get_user_home_dir(
+ talloc_tos(), service);
}
DEBUG(3,("checking for home directory %s gave %s\n",service,
@@ -461,6 +463,8 @@ int find_service(fstring service)
if (iService < 0)
DEBUG(3,("find_service() failed to find service %s\n", service));
+ TALLOC_FREE(frame);
+
return (iService);
}
@@ -744,11 +748,12 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
*status = NT_STATUS_WRONG_PASSWORD;
return NULL;
}
- pass = Get_Pwnam(user);
+ pass = Get_Pwnam_alloc(talloc_tos(), user);
status2 = create_token_from_username(conn->mem_ctx, pass->pw_name, True,
&conn->uid, &conn->gid,
&found_username,
&conn->nt_user_token);
+ TALLOC_FREE(pass);
if (!NT_STATUS_IS_OK(status2)) {
conn_free(conn);
*status = status2;