summaryrefslogtreecommitdiff
path: root/source/smbd
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>2000-02-08 04:25:56 +0000
committerLuke Leighton <lkcl@samba.org>2000-02-08 04:25:56 +0000
commitd55461608c289066daabe94b266f3d50043d06aa (patch)
tree6d8fbcdb942b21d15f50797b867a98d51be9d640 /source/smbd
parenteaa278b2db7126cae0403af43b47696bfc5084f7 (diff)
downloadsamba-d55461608c289066daabe94b266f3d50043d06aa.tar.gz
1) made standard_sub_vuser take a const user_struct* instead of a const
vuser_key*. this stops stupid-amounts of linking to all sorts of crap in programs like make_codepage and testprns, which know _nothing_ of users. the original link was just a temporary hack to get binaries. 2) make vuid_free_user_struct() free the vuser malloc'd structure, too.
Diffstat (limited to 'source/smbd')
-rw-r--r--source/smbd/lanman.c13
-rw-r--r--source/smbd/password.c2
-rw-r--r--source/smbd/process.c1
-rw-r--r--source/smbd/service.c5
-rw-r--r--source/smbd/uid.c3
5 files changed, 3 insertions, 21 deletions
diff --git a/source/smbd/lanman.c b/source/smbd/lanman.c
index 37b71f9b159..69cf7b4a696 100644
--- a/source/smbd/lanman.c
+++ b/source/smbd/lanman.c
@@ -89,7 +89,6 @@ static int CopyExpanded(connection_struct *conn, const vuser_key *key,
vuser = get_valid_user_struct(key);
standard_sub(conn,vuser, buf);
vuid_free_user_struct(vuser);
- safe_free(vuser);
StrnCpy(*dst,buf,*n);
l = strlen(*dst) + 1;
(*dst) += l;
@@ -119,7 +118,6 @@ static int StrlenExpanded(connection_struct *conn,
vuser = get_valid_user_struct(key);
standard_sub(conn,vuser, buf);
vuid_free_user_struct(vuser);
- safe_free(vuser);
return strlen(buf) + 1;
}
@@ -2015,7 +2013,6 @@ static BOOL api_RNetServerGetInfo(connection_struct *conn,uint16 vuid, char *par
StrnCpy(p2,comment,MAX(mdrcnt - struct_len,0));
p2 = skip_string(p2,1);
vuid_free_user_struct(vuser);
- safe_free(vuser);
}
}
@@ -2313,7 +2310,6 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
default:
{
vuid_free_user_struct(vuser);
- safe_free(vuser);
return False;
}
}
@@ -2321,7 +2317,6 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
if (strcmp(p2,str2) != 0)
{
vuid_free_user_struct(vuser);
- safe_free(vuser);
return False;
}
@@ -2364,7 +2359,7 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
SIVAL(p,usri11_auth_flags,AF_OP_PRINT); /* auth flags */
SIVALS(p,usri11_password_age,-1); /* password age */
SIVAL(p,usri11_homedir,PTR_DIFF(p2,p)); /* home dir */
- pstrcpy(p2, lp_logon_path(&key));
+ pstrcpy(p2, lp_logon_path(vuser));
p2 = skip_string(p2,1);
SIVAL(p,usri11_parms,PTR_DIFF(p2,p)); /* parms */
pstrcpy(p2,"");
@@ -2400,7 +2395,7 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
SSVAL(p,42,
conn->admin_user?USER_PRIV_ADMIN:USER_PRIV_USER);
SIVAL(p,44,PTR_DIFF(p2,*rdata)); /* home dir */
- pstrcpy(p2,lp_logon_path(&key));
+ pstrcpy(p2,lp_logon_path(vuser));
p2 = skip_string(p2,1);
SIVAL(p,48,PTR_DIFF(p2,*rdata)); /* comment */
*p2++ = 0;
@@ -2441,7 +2436,6 @@ static BOOL api_RNetUserGetInfo(connection_struct *conn,uint16 vuid, char *param
SSVAL(*rparam,4,*rdata_len); /* is this right?? */
vuid_free_user_struct(vuser);
- safe_free(vuser);
return(True);
}
@@ -2555,10 +2549,9 @@ static BOOL api_WWkstaUserLogon(connection_struct *conn,uint16 vuid, char *param
/* JHT - By calling lp_logon_script() and standard_sub() we have */
/* made sure all macros are fully substituted and available */
- logon_script = lp_logon_script(&key);
+ logon_script = lp_logon_script(vuser);
standard_sub( conn, vuser, logon_script );
vuid_free_user_struct(vuser);
- safe_free(vuser);
PACKS(&desc,"z", logon_script); /* script path */
/* End of JHT mods */
diff --git a/source/smbd/password.c b/source/smbd/password.c
index 03bbf436c9b..a4229242b3d 100644
--- a/source/smbd/password.c
+++ b/source/smbd/password.c
@@ -252,7 +252,6 @@ BOOL authorise_login(int snum, char *user, char *domain,
if (!user_list)
{
vuid_free_user_struct(vuser);
- safe_free(vuser);
return False;
}
@@ -337,7 +336,6 @@ BOOL authorise_login(int snum, char *user, char *domain,
tdb_store_vuid(key, vuser);
}
vuid_free_user_struct(vuser);
- safe_free(vuser);
} /* not guest only */
diff --git a/source/smbd/process.c b/source/smbd/process.c
index e95135a484a..eb6cd0a0c16 100644
--- a/source/smbd/process.c
+++ b/source/smbd/process.c
@@ -447,7 +447,6 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize
{
pstrcpy( sesssetup_user, vuser->requested_name);
vuid_free_user_struct(vuser);
- safe_free(vuser);
}
}
diff --git a/source/smbd/service.c b/source/smbd/service.c
index a251cfcfa63..7f304b10266 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -422,7 +422,6 @@ connection_struct *make_connection(char *service,char *user,
pstrcpy(s,lp_pathname(snum));
standard_sub(conn,vuser, s);
vuid_free_user_struct(vuser);
- safe_free(vuser);
string_set(&conn->connectpath,s);
DEBUG(3,("Connect path is %s\n",s));
}
@@ -461,7 +460,6 @@ connection_struct *make_connection(char *service,char *user,
pstrcpy(cmd,lp_rootpreexec(SNUM(conn)));
standard_sub(conn,vuser, cmd);
vuid_free_user_struct(vuser);
- safe_free(vuser);
DEBUG(5,("cmd=%s\n",cmd));
smbrun(cmd,NULL,False);
}
@@ -520,7 +518,6 @@ connection_struct *make_connection(char *service,char *user,
pstrcpy(cmd,lp_preexec(SNUM(conn)));
standard_sub(conn,vuser, cmd);
vuid_free_user_struct(vuser);
- safe_free(vuser);
smbrun(cmd,NULL,False);
}
@@ -639,7 +636,6 @@ void close_cnum(connection_struct *conn, uint16 vuid)
pstrcpy(cmd,lp_postexec(SNUM(conn)));
standard_sub(conn,vuser, cmd);
vuid_free_user_struct(vuser);
- safe_free(vuser);
smbrun(cmd,NULL,False);
unbecome_user();
}
@@ -653,7 +649,6 @@ void close_cnum(connection_struct *conn, uint16 vuid)
pstrcpy(cmd,lp_rootpostexec(SNUM(conn)));
standard_sub(conn,vuser, cmd);
vuid_free_user_struct(vuser);
- safe_free(vuser);
smbrun(cmd,NULL,False);
}
diff --git a/source/smbd/uid.c b/source/smbd/uid.c
index 2e9aa3bc678..83717be0567 100644
--- a/source/smbd/uid.c
+++ b/source/smbd/uid.c
@@ -83,7 +83,6 @@ BOOL become_userk(connection_struct *conn, const vuser_key *key)
{
DEBUG(4,("Skipping become_user - already user\n"));
vuid_free_user_struct(vuser);
- safe_free(vuser);
return(True);
}
@@ -94,7 +93,6 @@ BOOL become_userk(connection_struct *conn, const vuser_key *key)
if((vuser != NULL) && !check_vuser_ok(&conn->uid_cache, vuser, snum))
{
vuid_free_user_struct(vuser);
- safe_free(vuser);
return False;
}
@@ -145,7 +143,6 @@ BOOL become_userk(connection_struct *conn, const vuser_key *key)
}
vuid_free_user_struct(vuser);
- safe_free(vuser);
return become_unix_sec_ctx(key, conn, uid, gid, ngroups, groups);
}