Changeset 1583

Show
Ignore:
Timestamp:
02/29/08 20:48:21 (6 months ago)
Author:
till
Message:

nebula
- flush stdout after each session
- clean up on SIGKILL

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nebula/trunk/src/nebula.c

    r1582 r1583  
    245245        // process incoming connections 
    246246        printf("[*] Ready.\n"); 
     247        fflush(stdout); 
    247248 
    248249        LISTEN_SOCK.fd          = listen_fd; 
  • nebula/trunk/src/session.c

    r1582 r1583  
    5858        pthread_mutex_unlock(&sessions_mutex); 
    5959 
     60        fflush(stdout); 
    6061        return; 
    6162} 
     
    168169 
    169170                        if (s->state != AUTHENTICATED) { 
    170                                 if (verbose > 1) printf("    Secret mismatch, dropping session.\n"); 
     171                                printf("[x] Secret mismatch, dropping session.\n"); 
     172                                fflush(stdout); 
    171173                                return(0); 
    172174                        } 
     
    203205 
    204206                                if (verbose) printf("[x] Absolute MD5 match found, Rejecting known attack\n"); 
     207                                fflush(stdout); 
    205208                                return(0); 
    206209                        } else { 
     
    338341                                printf("[x] HMAC does not match, discarding submission.\n"); 
    339342                                free(sha512sum); 
     343                                fflush(stdout); 
    340344                                return(0); 
    341345                        } 
     
    386390                        s->state        = FINISHED; 
    387391 
    388                         // return 3 to indicate successful session termination 
     392                        fflush(stdout); 
    389393                        return(1); 
    390394                } 
  • nebula/trunk/src/sig.c

    r1581 r1583  
    294294        free(seglist); 
    295295 
     296        fflush(stdout); 
    296297        return; 
    297298} 
  • nebula/trunk/src/signals.c

    r1582 r1583  
    3939 
    4040void handle_ctrl_signal(int sig) { 
     41        fflush(stdout); 
    4142        if (sig == SIGINCV) { 
    4243                verbose++; 
     
    7677 
    7778void handle_term_signal(int sig) { 
    78         if (sig == SIGINT) { 
     79        if (sig == SIGINT || sig == SIGKILL) { 
    7980                // free memory and quit 
    8081                if (verbose) write(STDOUT_FILENO, "[*] Termination forced, cleaning up.\n", 37);