Ignore:
Timestamp:
06/06/06 15:01:09 (14 years ago)
Author:
spascoe
Message:

Python code on the server will now receive the private string from the
client. This is the basic requirement for doing bbftp authentication
within python.

Slightly higher level message passing functions ndg_message_send/recv are now
bound to python callbacks bbftpd.send and bbftpd.recv.

Location:
TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd
Files:
2 edited

Legend:

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

    r1079 r1100  
    952952#ifdef NDG_AUTH 
    953953                sprintf(logmessage,"%s                   NDG private autentication/authorisation extensions \n", logmessage); 
    954 #endif NDG_AUTH 
     954#endif // NDG_AUTH 
    955955#endif 
    956956#ifdef NDG_PYTHON_EMBED 
     
    961961                    sprintf(logmessage,"%s                   data ports range = [%d-%d] \n", logmessage,pasvport_min, pasvport_max) ; 
    962962                } 
     963#endif // NDG_PYTHON_EMBED 
    963964#ifdef CERTIFICATE_AUTH 
    964965                if (accept_pass_only) { 
  • TI05-delivery/trunk/src/bbftp-server-3.2.0/bbftpd/bbftpd_private_user.c

    r1078 r1100  
    4747 
    4848#endif 
    49  
    50 /* prototypes */ 
    51 static int ndg_message_recv(char **buffer, int *length, char *logmessage); 
    52 static int ndg_message_send(char *buffer, int length, char *logmessage); 
    5349 
    5450 
     
    111107#ifdef NDG_PYTHON_EMBED 
    112108  char *username; 
    113  
     109   
    114110  if (bbftpd_private_auth_callback(logmessage) == -1) { 
    115111    return -1; 
     
    118114    return -1; 
    119115  } 
    120     
     116   
    121117  sprintf(currentusername, "%.*s", MAXLEN, username); 
    122118#else 
    123119  char *privatestr; 
    124120  int privatestr_len; 
    125  
    126   char msg[NDG_MESSAGE_LEN]; 
     121   
     122  char *msg; 
     123  int len; 
     124   
    127125  /* Receive version verification message.  */ 
    128   if (bbftpd_private_recv(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
    129     return -1; 
    130   } 
    131   else { 
    132     syslog(LOG_DEBUG, "Received auth message: %s", msg); 
    133   } 
     126  if (ndg_message_recv(&msg, &len, logmessage) == -1) { 
     127    return -1; 
     128  } 
     129  syslog(LOG_DEBUG, "Received auth message: %s", msg); 
     130  free(msg); 
    134131 
    135132  /* Send response */ 
    136   sprintf(msg, "%.*s", NDG_MESSAGE_LEN - 1, NDG_HANDSHAKE); 
    137   if (bbftpd_private_send(msg, NDG_MESSAGE_LEN, logmessage) == -1) { 
     133  if (ndg_message_send(NDG_HANDSHAKE, strlen(NDG_HANDSHAKE) + 1, logmessage) == -1) { 
    138134    return -1; 
    139135  } 
     
    145141 
    146142  syslog(LOG_INFO, "Private string: %s", privatestr); 
     143  free(privatestr); 
    147144 
    148145#endif 
     
    263260 * @return 0 if OK, -1 if error 
    264261 */ 
    265 static int ndg_message_send(char *buffer, int length, char *logmessage) { 
     262int ndg_message_send(char *buffer, int length, char *logmessage) { 
    266263  char ctrl[NDG_MESSAGE_LEN]; 
    267264 
     
    286283 * @return 0 if OK, -1 if error 
    287284 */ 
    288 static int ndg_message_recv(char **buffer, int *length, char *logmessage) { 
     285int ndg_message_recv(char **buffer, int *length, char *logmessage) { 
    289286  char ctrl[NDG_MESSAGE_LEN]; 
    290287 
Note: See TracChangeset for help on using the changeset viewer.