diff options
author | Volker Lendecke <vl@samba.org> | 2008-05-07 12:42:36 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-05-10 11:17:00 +0200 |
commit | ca2580028744c8c9301487ffee87befdd94be383 (patch) | |
tree | 8a0542a6d6423765c277d9acd5c1804f220279f2 /source3/smbd/service.c | |
parent | 90995202c0f64d2c379be26760d3bf8c122199b5 (diff) | |
download | samba-ca2580028744c8c9301487ffee87befdd94be383.tar.gz samba-ca2580028744c8c9301487ffee87befdd94be383.tar.xz samba-ca2580028744c8c9301487ffee87befdd94be383.zip |
Simplify make_connection_snum: Copy connection_struct info from server_info
(This used to be commit 5aa3cdf355c179d89c2703f528919194ab084337)
Diffstat (limited to 'source3/smbd/service.c')
-rw-r--r-- | source3/smbd/service.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 974af839324..a95f7561327 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -762,20 +762,16 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, return NULL; } - if (lp_guest_only(snum)) { - string_set(&conn->user, conn->server_info->unix_name); + if ((lp_guest_only(snum)) || (lp_security() == SEC_SHARE)) { conn->force_user = true; - DEBUG(3,("Guest only user %s\n", conn->user)); - } else if (vuser) { - conn->vuid = vuser->vuid; - conn->uid = vuser->server_info->uid; - conn->gid = vuser->server_info->gid; - string_set(&conn->user,vuser->server_info->unix_name); - } else if (lp_security() == SEC_SHARE) { - string_set(&conn->user, conn->server_info->unix_name); - conn->force_user = True; } + conn->vuid = (vuser != NULL) ? vuser->vuid : UID_FIELD_INVALID; + + conn->uid = conn->server_info->uid; + conn->gid = conn->server_info->gid; + string_set(&conn->user, conn->server_info->unix_name); + add_session_user(conn->user); safe_strcpy(conn->client_address, @@ -819,16 +815,18 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser, */ if (*lp_force_user(snum)) { + fstring tmp; + fstrcpy(tmp, conn->user); status = find_forced_user(conn, (vuser != NULL) && vuser->server_info->guest, - conn->user); + tmp); if (!NT_STATUS_IS_OK(status)) { conn_free(conn); *pstatus = status; return NULL; } conn->force_user = True; - DEBUG(3,("Forced user %s\n",conn->user)); + DEBUG(3,("Forced user %s\n",tmp)); } /* |