示例#1
0
文件: prelogin.c 项目: AllardJ/Tomato
void
init_connection(struct vsf_session* p_sess)
{
  if (tunable_setproctitle_enable)
  {
    vsf_sysutil_setproctitle("not logged in");
  }
  /* Before we talk to the remote, make sure an alarm is set up in case
   * writing the initial greetings should block.
   */
  vsf_cmdio_set_alarm(p_sess);
  /* Check limits before doing an implicit SSL handshake, to avoid DoS
   * attacks. This will result in plain text messages being sent to the SSL
   * client, but we can live with that.
   */
  check_limits(p_sess);
  if (tunable_ssl_enable && tunable_implicit_ssl)
  {
    ssl_control_handshake(p_sess);
  }
  if (tunable_ftp_enable)
  {
    emit_greeting(p_sess);
  }
  parse_username_password(p_sess);
}
示例#2
0
文件: worker.c 项目: lkl/lkl-lklftpd
static void * APR_THREAD_FUNC lfd_worker_protocol_main_impl(apr_thread_t * thd, void* param)
{
	apr_status_t	rc;
	apr_socket_t 	* sock = (apr_socket_t*) param;
	struct lfd_sess * sess;

	rc = lfd_sess_create(&sess, thd, sock);
	if(APR_SUCCESS != rc)
	{
		//cannot call lfs_sess_destroy because we were unable to construct the object.
		apr_socket_close(sock);
		lfd_log_apr_err(rc, "lfd_sess_create failed with errorcode %d");
		return NULL;
	}

	//if any of the following stages fail, the session obliteration code at the end is run.
	if(APR_SUCCESS == rc)
	{
		rc = emit_greeting(sess);
		if(APR_SUCCESS != rc)
			lfd_log_apr_err(rc, "emit_greeting failed");
	}


	if(APR_SUCCESS == rc)
	{
		rc = ftp_protocol_loop(sess);
		if(APR_SUCCESS != rc)
			lfd_log_apr_err(rc, "ftp_protocol_loop failed");
	}

	lfd_sess_destroy(sess);
	return NULL;
}
示例#3
0
void
init_connection(struct vsf_session* p_sess)
{
  if (tunable_setproctitle_enable)
  {
    vsf_sysutil_setproctitle("not logged in");
  }
  
  #ifdef VSF_BUILD_SQLITE
  /* In stealth mode we wont answer the connection unless the remote host
   * is known to our database.
   */
  if (tunable_sqlite_enable && tunable_stealth_mode)
  {
    int retval = vsf_db_check_remote_host(&p_sess->remote_ip_str);
    if (retval == 0)
    {
      /* The IP check failed we drop the connection silently. */
      vsf_sysutil_shutdown_read_failok(VSFTP_COMMAND_FD);
      vsf_sysutil_exit(0);        
    }
  }
  #endif
    
  /* Before we talk to the remote, make sure an alarm is set up in case
   * writing the initial greetings should block.
   */
  vsf_cmdio_set_alarm(p_sess);
  emit_greeting(p_sess);
  parse_username_password(p_sess);
}
示例#4
0
void
init_connection(struct vsf_session* p_sess)
{
  if (tunable_setproctitle_enable)
  {
    vsf_sysutil_setproctitle("not logged in");
  }
  /* Before we talk to the remote, make sure an alarm is set up in case
   * writing the initial greetings should block.
   */
  vsf_cmdio_set_alarm(p_sess);
  emit_greeting(p_sess);
  parse_username_password(p_sess);
}
示例#5
0
void
init_connection(struct vsf_session* p_sess)
{
  if (tunable_setproctitle_enable)
  {
    vsf_sysutil_setproctitle("not logged in");
  }
  /* Before we talk to the remote, make sure an alarm is set up in case
   * writing the initial greetings should block.
   */
  vsf_cmdio_set_alarm(p_sess);
  /* Kitsune, prevent printing greeting if just updated */  
  if (!kitsune_is_updating()) {  
    emit_greeting(p_sess);
  }
  parse_username_password(p_sess);
}