Changeset 1238
- Timestamp:
- 26/06/06 16:16:23 (15 years ago)
- Location:
- TI05-delivery/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
TI05-delivery/trunk/lib/python/delivery/server.py
r1195 r1238 9 9 @author Stephen Pascoe 10 10 """ 11 12 #!NOTE: Importing bbftpd and bbftpc together is dangerous and will cause stange errors. 13 import sys 14 if sys.modules.has_key('delivery.bbftpc'): 15 raise ImportError, "delivery.bbftpc extension already loaded. You cannot use both client and server extensions together" 16 11 17 12 18 import bbftpd -
TI05-delivery/trunk/setup.py
r1198 r1238 117 117 ('_LARGEFILE64_SOURCE', 1), 118 118 ('NDG_PYTHON_EMBED', 1), 119 ('NDG_DELIVERY_VERSION', '"%s"' %version)],119 ('NDG_DELIVERY_VERSION', version)], 120 120 include_dirs = [bbftpd_home+'/includes', bbftpd_home+'/bbftpd'], 121 121 libraries = ['crypt', 'crypto'], … … 126 126 ('_LARGEFILE64_SOURCE', 1), 127 127 ('NDG_PYTHON_EMBED', 1), 128 ('NDG_DELIVERY_VERSION', '"%s"' %version)],128 ('NDG_DELIVERY_VERSION', version)], 129 129 include_dirs = [bbftpc_home+'/includes', bbftpc_home+'/bbftpc'], 130 130 libraries = ['crypt', 'crypto'], -
TI05-delivery/trunk/src/bbftp-client-3.2.0/bbftpc/bbftp.c
r1157 r1238 370 370 371 371 #ifdef NDG_PYTHON_EMBED 372 /** Reset all global variables to how they were first initialised. 373 */ 374 void bbftpc_reset_globals(void) { 375 376 state = SETTOZERO ; 377 timestamp = SETTOZERO ; 378 379 protocolmin = 2 ; 380 protocolmax = 3 ; 381 //int protocol ; 382 debug = SETTOZERO ; 383 verbose = SETTOZERO ; 384 warning = SETTOZERO ; 385 statoutput = SETTOZERO ; 386 globaltrymax = NBTRYMAX ; 387 newcontrolport = CONTROLPORT ; 388 usessh = SETTOZERO ; 389 sshbatchmode = SETTOZERO ; 390 sshchildpid = SETTOZERO ; 391 sshidentityfile = NULL ; 392 sshremotecmd = NULL ; 393 sshcmd = NULL ; 394 395 usecert = SETTOZERO ; 396 useprivate = SETTOZERO ; 397 privatestr = NULL ; 398 399 //struct sockaddr_in hisctladdr ; 400 //struct sockaddr_in myctladdr ; 401 bbftprc = NULL ; 402 //int localumask ; 403 #if defined(WITH_RFIO) || defined(WITH_RFIO64) 404 localcos = SETTOZERO ; 405 #endif 406 407 newcmd = NULL; 408 //int remoterfio; 409 //int localrfio; 410 sendwinsize = 256 ; 411 recvwinsize = 256 ; 412 nbport = 1 ; 413 ackto = ACKTO; 414 recvcontrolto = CONTROLSOCKTO; 415 sendcontrolto = SENDCONTROLTO; 416 datato = DATASOCKTO; 417 418 remoteumask = SETTOZERO ; 419 remotecos = -1 ; 420 remotedir = NULL ; 421 //int incontrolsock ; 422 //int outcontrolsock ; 423 myexitcode = SETTOZERO ; 424 hostname = NULL ; 425 hp = NULL ; 426 username = NULL ; 427 password = NULL ; 428 #ifdef CERTIFICATE_AUTH 429 service = NULL ; 430 #endif 431 mychildren = NULL ; 432 //int nbpidchild ; 433 #ifdef CASTOR 434 castfd = -1 ; 435 castfilename = NULL ; 436 #endif 437 transferoption = TROPT_TMP | TROPT_DIR | TROPT_MODE | TROPT_ACC; 438 filemode ; 439 lastaccess[9] ; 440 lastmodif[9] ; 441 buffersizeperstream = 256 ; 442 //int requestedstreamnumber ; 443 //my64_t filesize ; 444 curfilename = NULL ; 445 realfilename = NULL ; 446 myports = NULL ; 447 mysockets = NULL ; 448 readbuffer = NULL ; 449 compbuffer = NULL ; 450 resfd = -1 ; 451 simulation_mode = SETTOZERO; 452 453 connectionisbroken = SETTOZERO ; 454 455 pasvport_min = 0 ; 456 pasvport_max = 0 ; 457 458 commandList = NULL; 459 first = NULL; 460 iterator = NULL; 461 } 462 463 #endif // NDG_PYTHON_EMBED 464 465 466 #ifdef NDG_PYTHON_EMBED 372 467 bbftpc_main(int argc, char **argv, char **envp) { 468 bbftpc_reset_globals(); 469 373 470 #else 374 471 main(argc, argv, envp) -
TI05-delivery/trunk/src/python_ext/bbftpc.c
r1187 r1238 73 73 Py_DECREF(client_args); 74 74 75 for (i=0; i<argv_s.argc; i++) {76 fprintf(stderr, "delivery.bbftpc.run argument: %s\n", argv_s.argv[i]);77 }78 79 75 bbftpc_main(argv_s.argc, argv_s.argv, environ); 80 76 ndg_argv_clear(&argv_s); ndg_argv_free(&argv_s); -
TI05-delivery/trunk/test/test_embedded.py
r1195 r1238 224 224 225 225 lines = self._readSyslog() 226 226 227 self.assertLines(['.*AuthContext received Auth message: NDG-Delivery-client %s' % VERSION], lines) 227 228 … … 339 340 # Embedded client test case currently segfaults :-( 340 341 # 341 ## import delivery.bbftpc 342 ## import StringIO 343 344 ## class PythonClientAuthOK(AuthOK): 345 ## """Repeat AuthOK tests with a python-embedded client. 346 ## """ 347 348 ## def _runClient(self, cmd, debug=False, user="testcase", privatestr=None): 349 ## """Run the client. 350 ## """ 351 352 ## #print "Waiting for gdb connect, pid = %d" % os.getpid() 353 ## #time.sleep(15) 354 355 ## if debug: 356 ## f = "-d" 357 ## else: 358 ## f = "-m" 359 360 ## # Tell bbftp to dump output to a file which is then opened for reading. 361 ## tmp = tempfile.mktemp('test_bbftpd') 362 ## args = ['-e', cmd, f, '-u', user, 363 ## #'-o', tmp, '-f', tmp, 364 ## '-r', '1'] 365 366 ## if privatestr != None: 367 ## args += ['-P', privatestr] 368 369 ## args.append('localhost') 370 ## print "Running client with args: %s" % (args,) 371 372 ## delivery.bbftpc.run(args) 373 374 ## #fh = open(tmp) 375 ## #os.remove(tmp) 376 ## fh = StringIO.StringIO('') 377 378 ## return fh 342 343 class PythonClientAuthOK(AuthOK): 344 """Repeat AuthOK tests with a python-embedded client. 345 """ 346 347 def _runClient(self, cmd, debug=False, user="testcase", privatestr=None): 348 """Run the client. 349 """ 350 351 if debug: 352 f = "-d" 353 else: 354 f = "-m" 355 356 args = ['-e', repr(cmd), f, '-u', user, 357 '-r', '1'] 358 359 if privatestr != None: 360 args += ['-P', privatestr] 361 362 args.append('localhost') 363 364 fh = os.popen('%s/test/runclient.py %s' % (HOME, ' '.join(args))) 365 366 return fh 379 367 380 368 if __name__ == '__main__':
Note: See TracChangeset
for help on using the changeset viewer.