Ignore:
Timestamp:
26/07/06 11:18:55 (13 years ago)
Author:
spascoe
Message:

I've created a bbftpd log facility to replace syslog.
At present it allows you to log messages to a file in addition
to syslog. This should help testing on other machines.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private.c

    r1104 r1328  
    3030#include <netinet/in.h> 
    3131#include <stdio.h> 
    32 #include <syslog.h> 
     32#include <bbftpd_log.h> 
    3333#include <sys/socket.h> 
    3434#if TIME_WITH_SYS_TIME 
     
    102102    */ 
    103103    if ( (receive_buffer = (char *) malloc (msglen+1)) == NULL ) { 
    104         syslog(BBFTPD_ERR,"Error allocation memory for receive_buffer (bbftpd_private_receive_connection) ") ; 
     104        bbftpd_log(BBFTPD_ERR,"Error allocation memory for receive_buffer (bbftpd_private_receive_connection) ") ; 
    105105        strcat(logmessage," : Error allocation memory for receive_buffer") ; 
    106106        reply(MSG_BAD,logmessage) ; 
     
    127127        if ( (hisrsa = RSA_new()) == NULL) { 
    128128            FREE(receive_buffer) ; 
    129             syslog(BBFTPD_ERR,"Error RSA_new (bbftpd_private_receive_connection) ") ; 
     129            bbftpd_log(BBFTPD_ERR,"Error RSA_new (bbftpd_private_receive_connection) ") ; 
    130130            strcat(logmessage," : RSA Error") ; 
    131131            reply(MSG_BAD,logmessage) ; 
     
    137137        if ( (hisrsa->n = BN_new()) == NULL) { 
    138138            FREE(receive_buffer) ; 
    139             syslog(BBFTPD_ERR,"Error BN_new (bbftpd_private_receive_connection) ") ; 
     139            bbftpd_log(BBFTPD_ERR,"Error BN_new (bbftpd_private_receive_connection) ") ; 
    140140            strcat(logmessage," : RSA Error") ; 
    141141            reply(MSG_BAD,logmessage) ; 
     
    144144        if ( (hisrsa->e = BN_new()) == NULL) {  
    145145            FREE(receive_buffer) ; 
    146             syslog(BBFTPD_ERR,"Error BN_new (bbftpd_private_receive_connection) ") ; 
     146            bbftpd_log(BBFTPD_ERR,"Error BN_new (bbftpd_private_receive_connection) ") ; 
    147147            strcat(logmessage," : RSA Error") ; 
    148148            reply(MSG_BAD,logmessage) ; 
     
    154154        if ( BN_mpi2bn(pubkey,lenkey,hisrsa->n) == NULL ) { 
    155155            FREE(receive_buffer) ; 
    156             syslog(BBFTPD_ERR,"Error BN_mpi2bn (bbftpd_private_receive_connection) ") ; 
     156            bbftpd_log(BBFTPD_ERR,"Error BN_mpi2bn (bbftpd_private_receive_connection) ") ; 
    157157            strcat(logmessage," : RSA Error") ; 
    158158            reply(MSG_BAD,logmessage) ; 
     
    161161        if ( BN_mpi2bn(pubexponent,lenexpo,hisrsa->e) == NULL ) { 
    162162            FREE(receive_buffer) ; 
    163             syslog(BBFTPD_ERR,"Error BN_mpi2bn (bbftpd_private_receive_connection) ") ; 
     163            bbftpd_log(BBFTPD_ERR,"Error BN_mpi2bn (bbftpd_private_receive_connection) ") ; 
    164164            strcat(logmessage," : RSA Error") ; 
    165165            reply(MSG_BAD,logmessage) ; 
     
    167167        } 
    168168    } else { 
    169         syslog(BBFTPD_ERR,"Unkwown encryption %d",msg_sec->crtype) ; 
     169        bbftpd_log(BBFTPD_ERR,"Unkwown encryption %d",msg_sec->crtype) ; 
    170170        strcat(logmessage," : Unknown encryption") ; 
    171171        reply(MSG_BAD,logmessage) ; 
     
    177177 
    178178    if ( bbftpd_private_auth(logmessage) < 0 ) { 
    179         syslog(BBFTPD_ERR,"bbftpd_private_auth failed : %s",logmessage) ; 
     179        bbftpd_log(BBFTPD_ERR,"bbftpd_private_auth failed : %s",logmessage) ; 
    180180        reply(MSG_BAD,logmessage) ; 
    181181        return -1 ; 
Note: See TracChangeset for help on using the changeset viewer.