Changeset 973 for TI05-delivery
- Timestamp:
- 22/05/06 12:23:42 (14 years ago)
- Location:
- TI05-delivery/trunk/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/trunk/src/Makefile
r806 r973 3 3 4 4 PREFIX=$(HOME)/opt/bbftp 5 CONFIG_OPTS=--prefix=$(PREFIX) --without-gzip --without-rfio --enable-authentication=private 5 CONFIG_OPTS=--prefix=$(PREFIX) --without-gzip --without-rfio --enable-authentication=private CPPFLAGS="-DNDG_AUTH" 6 6 7 7 BBFTPD=bbftp-server-3.2.0/bbftpd -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd.c
r773 r973 377 377 #endif 378 378 379 379 380 /* 380 381 * Stats … … 789 790 } 790 791 #endif 791 792 #ifdef NDG_AUTH 793 if ( bbftpd_private_initialise(logmessage) == -1) { 794 syslog(BBFTPD_ERR, "bbftpd_private_init failure: %s", logmessage); 795 //!TODO: Should I write to stderr in all daemon modes (be_daemon)? 796 fprintf(stderr, "bbftpd_private_init failure: %s", logmessage); 797 exit(1); 798 } 799 #endif // NDG_AUTH 792 800 if ( be_daemon == 2 ) { 793 801 /* -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private.c
r773 r973 61 61 extern RSA *myrsa ; 62 62 63 63 64 /******************************************************************************* 64 65 ** bbftpd_private_receive_connection : * … … 179 180 return -1 ; 180 181 } 182 #ifdef NDG_AUTH 183 ndg_atexit_status = NDG_INCHILD; 184 #endif // NDG_AUTH 185 181 186 return 0 ; 182 187 } … … 342 347 return totallendecrypted ; 343 348 } 349 350 351 #ifdef NDG_AUTH 352 /* 353 ** bbftpd_private_initialise : 354 ** 355 ** Routine to initialise the private authentication infrastructure. 356 ** This function is mainly a wrapper around bbftpd_private_init(), 357 ** except that it also sets up an atexit function. 358 */ 359 int bbftpd_private_initialise(char *logmessage) { 360 361 if (atexit(bbftpd_private_atexit) != 0) { 362 sprintf(logmessage, "atexit failure"); 363 return -1; 364 } 365 ndg_atexit_status = NDG_INFATHER; 366 return bbftpd_private_init(logmessage); 367 } 368 369 /* 370 ** bbftpd_private_atexit : 371 ** 372 ** Routine to be registered with atexit() for cleaning up the private authentication 373 ** infrastructure. This function must know whether the server is in a connected or 374 ** unconnected state, therefore the global variable ndg_atexit_status is used. 375 */ 376 void bbftpd_private_atexit(void) 377 { 378 if (ndg_atexit_status == NDG_INFATHER) { 379 bbftpd_private_finalise(); 380 } 381 else if (ndg_atexit_status == NDG_INCHILD) { 382 bbftpd_private_auth_finalise(); 383 } 384 else { 385 syslog(BBFTPD_ERR, "ndg_atexit_status unrecognised: %d", ndg_atexit_status); 386 fprintf(stderr, "ndg_atexit_status unrecognised: %d", ndg_atexit_status); 387 } 388 } 389 #endif // NDG_AUTH -
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private_user.c
r806 r973 105 105 return 0 ; 106 106 } 107 108 109 #ifdef NDG_AUTH 110 111 /* 112 * bbftpd_private_init : 113 * 114 * Routine to initialise private authentication. This function will be 115 * called before bbftpd begins listening for connections and therefore 116 * before the fork() that occurs when a client connects. 117 * 118 * OUTPUT variable : 119 * logmessage : to write the error message in case of error 120 * 121 * RETURN: 122 * -1 Unrecoverable error 123 * 0 OK 124 * 125 */ 126 127 int bbftpd_private_init(char *logmessage) 128 { 129 syslog(LOG_INFO, "initialising private authentication"); 130 return 0; 131 } 132 133 /* 134 * bbftpd_private_finalise : 135 * 136 * Routine to clean up the private authentication infrastructure when the 137 * daemon exits. This function is the counterpart of bbftpd_private_init and 138 * will be called from the daemon process during exit. NOTE: it will not 139 * be aware of any actions of child processes. 140 * 141 */ 142 143 void bbftpd_private_finalise(void) 144 { 145 syslog(LOG_INFO, "finalising private authentication in server"); 146 return; 147 } 148 149 /* 150 * bbftpd_private_auth_finalise : 151 * 152 * Routine to clean up the private authentication infrastructure for each child. 153 * This function is the counterpart of bbftpd_private_auth and will be called from 154 * each child of the daemon during exit. 155 * 156 */ 157 158 void bbftpd_private_auth_finalise(void) 159 { 160 syslog(LOG_INFO, "finalising private authentication in connection"); 161 return; 162 } 163 164 #endif // NDG_AUTH -
TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/bbftpd_private.h
r773 r973 40 40 */ 41 41 RSA *hisrsa ; 42 43 #ifdef NDG_AUTH 44 /* 45 ** NDG authentication global variables. 46 */ 47 #define NDG_INFATHER 1 48 #define NDG_INCHILD 2 49 int ndg_atexit_status ; 50 #endif // NDG_AUTH -
TI05-delivery/trunk/src/bbftp-server-3.2.0/includes/daemon_proto.h
r773 r973 63 63 int bbftpd_private_send(char *buffertosend, int buffertosendlength, char *logmessage) ; 64 64 int bbftpd_private_recv(char *buffertorecv, int lengthtorecv, char *logmessage) ; 65 #ifdef NDG_AUTH 66 int bbftpd_private_initialise(char *logmessage); 67 void bbftpd_private_atexit(void); 68 #endif // NDG_AUTH 65 69 /* 66 70 ** Prototype for user private authentication routines 67 71 */ 68 72 int bbftpd_private_auth(char *logmessage) ; 73 #ifdef NDG_AUTH 74 int bbftpd_private_init(char *logmessage); 75 void bbftpd_private_finalise(void); 76 void bbftpd_private_auth_finalise(void); 77 #endif // NDG_AUTH 69 78 /* 70 79 ** Prototype for retr routines
Note: See TracChangeset
for help on using the changeset viewer.