1. Busybox FTP function, check the password of the following functions?
2. In the code case 230 case331 what meaning be?
Static int FTPCMD (const char * s1, s2 const char *)
{
Unsigned n;
If (verbose_flag) {
Bb_error_msg (" CMD % s % s ", s1, s2);
}
If (s1) {
Fprintf (control_stream, (s2? "% s % s \ r \ n" : "% s % s \ r \ n" + 3),
S1, s2);
The fflush (control_stream);
}
Do {
Strcpy (buf, "EOF");
If (the fgets (buf, BUFSZ - 2, control_stream)==NULL) {
Ftp_die (NULL);
}
} while (! Isdigit (buf [0]) | | buf [3].=");
Buf [3]='\ 0';
N=xatou (buf);
Buf [3]=' ';
return n;
}
The static void ftp_login (void)
{
/* Connect to the command socket */
Control_stream=fdopen (xconnect_stream (lsa), "r +");
If (control_stream==NULL) {
/* fdopen failed - extremely unlikely */
Bb_perror_nomsg_and_die ();
}
If (FTPCMD (NULL, NULL)! {
=220)Ftp_die (NULL);
}
/* Login to the server */
The switch (FTPCMD (" USER ", the USER)) {
Case: 230
break;
Case: 331
If (FTPCMD (" PASS ", ")! {
=230)Ftp_die (" PASS ");
}
break;
Default:
Ftp_die (" USER ");
}
FTPCMD (" TYPE I ", NULL);
}