Advertisement
Advertisement
| 06.19.2008 at 05:48PM PDT, ID: 23500987 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: |
while( (n = read(fd, buffer, MAX_LINE)) > 0){
buffer[n] = '\0';
char *comando = buffer;
lenght = strlen(comando);
if(lenght == 0){
exit(0);
}
while (comando) {
char *next = strstr(comando, "\r\n");
if (next) {
*next = '\0';
next += 2;
}
if ( strncmp(comando, "HELO", 4) == 0){
username = strtok((comando+4), "\r\n");
if (strlen(username) > 16){
Writeline(fd, alert, strlen(alert));
}
Writeline(fd, passw, strlen(passw));
read(fd, password, MAX_LINE);
passwd = strtok(password, "\r\n");
if (verify_login(username, passwd)){
auth=1;
Writeline(fd, good, strlen(good));
}
else {
auth=0;
Writeline(fd, fail, strlen(fail));
}
}
|