diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-08-17 08:44:04 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-08-17 08:44:04 +0000 |
commit | 9ed5f60a5b385d01e441c53318295fd32fefe0d6 (patch) | |
tree | cd4e63f23b99c3f34d8c668bc1007edae0e86fa2 /source3/smbd | |
parent | 327fda27eddfb1be7f0e344e86cca438c103c6ea (diff) | |
download | samba-9ed5f60a5b385d01e441c53318295fd32fefe0d6.tar.gz samba-9ed5f60a5b385d01e441c53318295fd32fefe0d6.tar.bz2 samba-9ed5f60a5b385d01e441c53318295fd32fefe0d6.zip |
Move the claim_connection stuff till a little later in the process.
(You don't have to clean up somthing you haven't done yet...)
(This used to be commit ba76564c2a06bf7feefdaf9ef06cbf77c776b6e6)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/service.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source3/smbd/service.c b/source3/smbd/service.c index 3e29c8cf58..524b647b5e 100644 --- a/source3/smbd/service.c +++ b/source3/smbd/service.c @@ -527,17 +527,6 @@ connection_struct *make_connection(char *service,char *user,char *password, int initialise_groups(conn->user, conn->uid, conn->gid); get_current_groups(&conn->ngroups,&conn->groups); - /* check number of connections */ - if (!claim_connection(conn, - lp_servicename(SNUM(conn)), - lp_max_connections(SNUM(conn)), - False)) { - DEBUG(1,("too many connections - rejected\n")); - *ecode = ERRnoresource; - conn_free(conn); - return NULL; - } - conn->nt_user_token = create_nt_token(conn->uid, conn->gid, conn->ngroups, conn->groups, guest); @@ -557,8 +546,6 @@ connection_struct *make_connection(char *service,char *user,char *password, int *ecode = ERRaccess; DEBUG(0,( "make_connection: connection to %s denied due to security descriptor.\n", service )); - yield_connection(conn, lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); - conn_free(conn); return NULL; } else { conn->read_only = True; @@ -569,11 +556,20 @@ connection_struct *make_connection(char *service,char *user,char *password, int if (!vfs_init(conn)) { DEBUG(0, ("vfs_init failed for service %s\n", lp_servicename(SNUM(conn)))); - yield_connection(conn, lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); - conn_free(conn); return NULL; } + /* check number of connections */ + if (!claim_connection(conn, + lp_servicename(SNUM(conn)), + lp_max_connections(SNUM(conn)), + False)) { + DEBUG(1,("too many connections - rejected\n")); + *ecode = ERRnoresource; + conn_free(conn); + return NULL; + } + /* execute any "root preexec = " line */ if (*lp_rootpreexec(SNUM(conn))) { pstring cmd; @@ -583,7 +579,9 @@ connection_struct *make_connection(char *service,char *user,char *password, int ret = smbrun(cmd,NULL); if (ret != 0 && lp_rootpreexec_close(SNUM(conn))) { DEBUG(1,("preexec gave %d - failing connection\n", ret)); - yield_connection(conn, lp_servicename(SNUM(conn)), lp_max_connections(SNUM(conn))); + yield_connection(conn, + lp_servicename(SNUM(conn)), + lp_max_connections(SNUM(conn))); conn_free(conn); *ecode = ERRsrverror; return NULL; |