• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/vsftpd/

Lines Matching refs:p_sess

44 static void emit_greeting(struct vsf_session* p_sess);
45 static void parse_username_password(struct vsf_session* p_sess);
46 static void handle_user_command(struct vsf_session* p_sess);
47 static void handle_pass_command(struct vsf_session* p_sess);
50 init_connection(struct vsf_session* p_sess)
59 vsf_cmdio_set_alarm(p_sess);
60 emit_greeting(p_sess);
61 parse_username_password(p_sess);
65 emit_greeting(struct vsf_session* p_sess)
70 p_sess->num_clients > tunable_max_clients)
73 vsf_log_line(p_sess, kVSFLogEntryConnection, &str_log_line);
74 vsf_cmdio_write_exit(p_sess, FTP_TOO_MANY_USERS,
78 p_sess->num_this_ip > tunable_max_per_ip)
82 vsf_log_line(p_sess, kVSFLogEntryConnection, &str_log_line);
83 vsf_cmdio_write_exit(p_sess, FTP_IP_LIMIT,
86 if (!p_sess->tcp_wrapper_ok)
90 vsf_log_line(p_sess, kVSFLogEntryConnection, &str_log_line);
91 vsf_cmdio_write_exit(p_sess, FTP_IP_DENY, "Service not available.");
93 vsf_log_line(p_sess, kVSFLogEntryConnection, &str_log_line);
94 if (!str_isempty(&p_sess->banner_str))
96 vsf_banner_write(p_sess, &p_sess->banner_str, FTP_GREET);
97 str_free(&p_sess->banner_str);
98 vsf_cmdio_write(p_sess, FTP_GREET, "");
102 vsf_cmdio_write(p_sess, FTP_GREET, "(vsFTPd " VSF_VERSION
107 vsf_cmdio_write(p_sess, FTP_GREET, tunable_ftpd_banner);
112 parse_username_password(struct vsf_session* p_sess)
116 vsf_cmdio_get_cmd_and_arg(p_sess, &p_sess->ftp_cmd_str,
117 &p_sess->ftp_arg_str, 1);
118 if (str_equal_text(&p_sess->ftp_cmd_str, "USER"))
120 handle_user_command(p_sess);
122 else if (str_equal_text(&p_sess->ftp_cmd_str, "PASS"))
124 handle_pass_command(p_sess);
126 else if (str_equal_text(&p_sess->ftp_cmd_str, "QUIT"))
128 vsf_cmdio_write(p_sess, FTP_GOODBYE, "Goodbye.");
131 else if (str_equal_text(&p_sess->ftp_cmd_str, "FEAT"))
133 handle_feat(p_sess);
135 else if (str_equal_text(&p_sess->ftp_cmd_str, "OPTS"))
137 handle_opts(p_sess);
139 else if (tunable_ssl_enable && str_equal_text(&p_sess->ftp_cmd_str, "AUTH"))
141 handle_auth(p_sess);
143 else if (tunable_ssl_enable && str_equal_text(&p_sess->ftp_cmd_str, "PBSZ"))
145 handle_pbsz(p_sess);
147 else if (tunable_ssl_enable && str_equal_text(&p_sess->ftp_cmd_str, "PROT"))
149 handle_prot(p_sess);
153 vsf_cmdio_write(p_sess, FTP_LOGINERR,
160 handle_user_command(struct vsf_session* p_sess)
167 str_copy(&p_sess->user_str, &p_sess->ftp_arg_str);
168 str_upper(&p_sess->ftp_arg_str);
170 // !str_equal_text(&p_sess->ftp_arg_str, "FTP") && // Jiahao
171 !str_equal_text(&p_sess->ftp_arg_str, "ANONYMOUS")
179 p_sess, FTP_LOGINERR, "This FTP server is anonymous only.");
180 str_empty(&p_sess->user_str);
186 p_sess, FTP_LOGINERR, "This FTP server does not allow anonymous logins.");
188 if (is_anon && p_sess->control_use_ssl && !tunable_allow_anon_ssl &&
192 p_sess, FTP_LOGINERR, "Anonymous sessions may not use encryption.");
193 str_empty(&p_sess->user_str);
196 if (tunable_ssl_enable && !is_anon && !p_sess->control_use_ssl &&
200 p_sess, FTP_LOGINERR, "Non-anonymous sessions must use encryption.");
201 str_empty(&p_sess->user_str);
204 if (tunable_ssl_enable && is_anon && !p_sess->control_use_ssl &&
208 p_sess, FTP_LOGINERR, "Anonymous sessions must use encryption.");
209 str_empty(&p_sess->user_str);
212 if (!str_isempty(&p_sess->userlist_str))
214 int located = str_contains_line(&p_sess->userlist_str, &p_sess->user_str);
218 vsf_cmdio_write(p_sess, FTP_LOGINERR, "Permission denied.");
219 str_empty(&p_sess->user_str);
224 if (str_equal_text(&p_sess->ftp_arg_str, "ROOT")) // Modify by Jiahao 2006.10.20
226 vsf_cmdio_write(p_sess, FTP_LOGINERR, "Permission denied.");
227 str_empty(&p_sess->user_str);
234 str_alloc_text(&p_sess->ftp_arg_str, "<no password>");
235 handle_pass_command(p_sess);
239 vsf_cmdio_write(p_sess, FTP_GIVEPWORD, "Please specify the password.");
244 handle_pass_command(struct vsf_session* p_sess)
246 if (str_isempty(&p_sess->user_str))
248 vsf_cmdio_write(p_sess, FTP_NEEDUSER, "Login with USER first.");
254 vsf_one_process_login(p_sess, &p_sess->ftp_arg_str);
258 vsf_two_process_login(p_sess, &p_sess->ftp_arg_str);
260 vsf_cmdio_write(p_sess, FTP_LOGINERR, "Login incorrect.");
261 str_empty(&p_sess->user_str);