summaryrefslogtreecommitdiff
path: root/source3/smbd/service.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-09-15 12:55:59 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-09-15 12:55:59 +0000
commit7892c494e7321c64b20bf7e1d794a6b6508fe84a (patch)
treeabde252c0198e7fd43f6da119230208263f82c1c /source3/smbd/service.c
parentcde3f0fae15c977b8af28e3e2b327f4576c14e69 (diff)
downloadsamba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.tar.gz
samba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.tar.bz2
samba-7892c494e7321c64b20bf7e1d794a6b6508fe84a.zip
Kill off the //server/share%user hack in share level security.
This should help make much of this code simpiler. Andrew Bartlett (This used to be commit fb0c3629c360fd0c57129500474960e6da6f9ef0)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r--source3/smbd/service.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 62e51f797f..4765844460 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -318,7 +318,7 @@ static void set_admin_user(connection_struct *conn)
/****************************************************************************
make a connection to a service
****************************************************************************/
-connection_struct *make_connection(char *service,char *user,char *password,
+connection_struct *make_connection(char *service,char *password,
int pwlen, char *dev,uint16 vuid, NTSTATUS *status)
{
int snum;
@@ -326,7 +326,8 @@ connection_struct *make_connection(char *service,char *user,char *password,
BOOL guest = False;
BOOL force = False;
connection_struct *conn;
- int ret;
+
+ fstring user;
strlower(service);
@@ -345,28 +346,20 @@ connection_struct *make_connection(char *service,char *user,char *password,
}
if (strequal(service,HOMES_NAME)) {
- if (*user && Get_Pwnam(user,True)) {
- fstring dos_username;
- fstrcpy(dos_username, user);
- return(make_connection(dos_username,user,password,
- pwlen,dev,vuid,status));
- }
-
if(lp_security() != SEC_SHARE) {
if (validated_username(vuid)) {
- fstring dos_username;
- fstrcpy(user,validated_username(vuid));
- fstrcpy(dos_username, user);
- return(make_connection(dos_username,user,password,pwlen,dev,vuid,status));
+ fstring unix_username;
+ fstrcpy(unix_username,validated_username(vuid));
+ return(make_connection(unix_username,password,pwlen,dev,vuid,status));
}
} else {
/* Security = share. Try with current_user_info.smb_name
* as the username. */
if(*current_user_info.smb_name) {
- fstring dos_username;
- fstrcpy(user,current_user_info.smb_name);
- fstrcpy(dos_username, user);
- return(make_connection(dos_username,user,password,pwlen,dev,vuid,status));
+ fstring unix_username;
+ fstrcpy(unix_username,current_user_info.smb_name);
+ map_username(unix_username);
+ return(make_connection(unix_username,password,pwlen,dev,vuid,status));
}
}
}
@@ -375,15 +368,13 @@ connection_struct *make_connection(char *service,char *user,char *password,
return NULL;
}
- /* lowercase the user name */
- strlower(user);
-
/* add it as a possible user name if we
are in share mode security */
if (lp_security() == SEC_SHARE) {
add_session_user(service);
}
+
/* shall we let them in? */
if (!authorise_login(snum,user,password,pwlen,&guest,&force,vuid)) {
DEBUG( 2, ( "Invalid username/password for %s [%s]\n", service, user ) );
@@ -574,6 +565,7 @@ connection_struct *make_connection(char *service,char *user,char *password,
/* execute any "root preexec = " line */
if (*lp_rootpreexec(SNUM(conn))) {
+ int ret;
pstring cmd;
pstrcpy(cmd,lp_rootpreexec(SNUM(conn)));
standard_sub_conn(conn,cmd);
@@ -630,6 +622,7 @@ connection_struct *make_connection(char *service,char *user,char *password,
/* execute any "preexec = " line */
if (*lp_preexec(SNUM(conn))) {
+ int ret;
pstring cmd;
pstrcpy(cmd,lp_preexec(SNUM(conn)));
standard_sub_conn(conn,cmd);