Changes in / [ddd4779:b6cd9e9]
- Files:
-
- 5 deleted
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
rddd4779 rb6cd9e9 2 2 config.h 3 3 bitlbee 4 Debug5 Debugx6 deps7 admin/Debug8 admin/admin.plg9 bitlbee.plg10 *.plg11 *.aps12 *.clw13 4 user-guide.txt 14 5 user-guide.html -
Makefile
rddd4779 rb6cd9e9 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o c rypting.o help.o ipc.o irc.o irc_commands.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS)user.o12 objects = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o $(STORAGE_OBJS) unix.o user.o 13 13 headers = account.h bitlbee.h commands.h conf.h config.h crypting.h help.h ipc.h irc.h log.h nick.h query.h set.h sock.h storage.h user.h lib/events.h lib/http_client.h lib/ini.h lib/md5.h lib/misc.h lib/proxy.h lib/sha1.h lib/ssl_client.h lib/url.h protocols/nogaim.h 14 14 subdirs = lib protocols 15 16 ifeq ($(TARGET),i586-mingw32msvc)17 objects += win32.o18 else19 objects += unix.o conf.o log.o20 endif21 15 22 16 # Expansion of variables -
bitlbee.c
rddd4779 rb6cd9e9 123 123 ipc_master_listen_socket(); 124 124 125 #ifndef _WIN32126 125 if( ( fp = fopen( global.conf->pidfile, "w" ) ) ) 127 126 { … … 133 132 log_message( LOGLVL_WARNING, "Warning: Couldn't write PID to `%s'", global.conf->pidfile ); 134 133 } 135 #endif136 134 137 135 return( 0 ); … … 142 140 if( !irc_new( 0 ) ) 143 141 return( 1 ); 142 143 log_link( LOGLVL_ERROR, LOGOUTPUT_IRC ); 144 log_link( LOGLVL_WARNING, LOGOUTPUT_IRC ); 144 145 145 146 return( 0 ); … … 253 254 struct sockaddr_in conn_info; 254 255 int new_socket = accept( global.listen_socket, (struct sockaddr *) &conn_info, &size ); 256 pid_t client_pid = 0; 255 257 256 258 if( new_socket == -1 ) … … 260 262 } 261 263 262 #ifndef _WIN32263 264 if( global.conf->runmode == RUNMODE_FORKDAEMON ) 264 265 { 265 pid_t client_pid = 0;266 266 int fds[2]; 267 267 … … 320 320 } 321 321 else 322 #endif323 322 { 324 323 log_message( LOGLVL_INFO, "Creating new connection with fd %d.", new_socket ); -
bitlbee.h
rddd4779 rb6cd9e9 48 48 #include <stdio.h> 49 49 #include <ctype.h> 50 #include <errno.h>51 52 50 #ifndef _WIN32 53 51 #include <syslog.h> 52 #include <errno.h> 54 53 #endif 55 54 -
configure
rddd4779 rb6cd9e9 20 20 ipcsocket='/var/run/bitlbee.sock' 21 21 pcdir='$prefix/lib/pkgconfig' 22 systemlibdirs="/lib /usr/lib /usr/local/lib"23 22 24 23 msn=1 … … 110 109 PCDIR=$pcdir 111 110 112 TARGET=$target113 111 ARCH=$arch 114 112 CPU=$cpu … … 136 134 EOF 137 135 138 139 140 136 if [ -n "$target" ]; then 141 PKG_CONFIG_LIBDIR=/usr/$target/lib/pkgconfig 142 export PKG_CONFIG_LIBDIR 137 PKG_CONFIG_PATH=/usr/$target/lib/pkgconfig 143 138 PATH=/usr/$target/bin:$PATH 144 139 CC=$target-cc 145 140 LD=$target-ld 146 systemlibdirs="/usr/$target/lib" 147 fi 148 141 fi 149 142 150 143 if [ "$debug" = "1" ]; then … … 292 285 elif [ "$ssl" = "nss" ]; then 293 286 detect_nss 294 elif [ "$ssl" = "sspi" ]; then295 echo296 287 elif [ "$ssl" = "openssl" ]; then 297 288 echo … … 350 341 echo 'SSL_CLIENT=ssl_'$ssl'.o' >> Makefile.settings 351 342 352 for i in $systemlibdirs; do343 for i in /lib /usr/lib /usr/local/lib; do 353 344 if [ -f $i/libresolv.a ]; then 354 345 echo '#define HAVE_RESOLV_A' >> config.h … … 510 501 echo 'Cygwin is not officially supported.' 511 502 ;; 512 Windows )513 echo OUTFILE=bitlbee.exe >> Makefile.settings514 echo LFLAGS+=-lwsock32 >> Makefile.settings515 echo EFLAGS+=-lsecur32 >> Makefile.settings516 ;;517 503 * ) 518 504 echo 'We haven'\''t tested BitlBee on many platforms yet, yours is untested. YMMV.' -
ipc.c
rddd4779 rb6cd9e9 439 439 } 440 440 441 #ifndef _WIN32442 441 char *ipc_master_save_state() 443 442 { … … 505 504 } 506 505 506 #ifndef _WIN32 507 507 int ipc_master_listen_socket() 508 508 { … … 541 541 } 542 542 #else 543 int ipc_master_listen_socket()544 {545 543 /* FIXME: Open named pipe \\.\BITLBEE */ 546 return 0;547 }548 544 #endif 549 545 -
lib/misc.c
rddd4779 rb6cd9e9 392 392 } 393 393 394 /* A pretty reliable random number generator. Tries to use the /dev/random 395 devices first, and falls back to the random number generator from libc 396 when it fails. Opens randomizer devices with O_NONBLOCK to make sure a 397 lack of entropy won't halt BitlBee. */ 398 void random_bytes( unsigned char *buf, int count ) 399 { 400 static int use_dev = -1; 401 402 /* Actually this probing code isn't really necessary, is it? */ 403 if( use_dev == -1 ) 404 { 405 if( access( "/dev/random", R_OK ) == 0 || access( "/dev/urandom", R_OK ) == 0 ) 406 use_dev = 1; 407 else 408 { 409 use_dev = 0; 410 srand( ( getpid() << 16 ) ^ time( NULL ) ); 411 } 412 } 413 414 if( use_dev ) 415 { 416 int fd; 417 418 /* At least on Linux, /dev/random can block if there's not 419 enough entropy. We really don't want that, so if it can't 420 give anything, use /dev/urandom instead. */ 421 if( ( fd = open( "/dev/random", O_RDONLY | O_NONBLOCK ) ) >= 0 ) 422 if( read( fd, buf, count ) == count ) 423 { 424 close( fd ); 425 return; 426 } 427 close( fd ); 428 429 /* urandom isn't supposed to block at all, but just to be 430 sure. If it blocks, we'll disable use_dev and use the libc 431 randomizer instead. */ 432 if( ( fd = open( "/dev/urandom", O_RDONLY | O_NONBLOCK ) ) >= 0 ) 433 if( read( fd, buf, count ) == count ) 434 { 435 close( fd ); 436 return; 437 } 438 close( fd ); 439 440 /* If /dev/random blocks once, we'll still try to use it 441 again next time. If /dev/urandom also fails for some 442 reason, stick with libc during this session. */ 443 444 use_dev = 0; 445 srand( ( getpid() << 16 ) ^ time( NULL ) ); 446 } 447 448 if( !use_dev ) 449 { 450 int i; 451 452 /* Possibly the LSB of rand() isn't very random on some 453 platforms. Seems okay on at least Linux and OSX though. */ 454 for( i = 0; i < count; i ++ ) 455 buf[i] = rand() & 0xff; 456 } 457 } 458 394 459 int is_bool( char *value ) 395 460 { -
protocols/nogaim.h
rddd4779 rb6cd9e9 131 131 struct im_connection *ic; /* the connection it belongs to */ 132 132 }; 133 134 struct ft135 {136 const char *filename;137 138 /* Total number of bytes in file */139 size_t total_bytes;140 141 /* Current number of bytes received */142 size_t cur_bytes;143 };144 145 struct ft_request146 {147 const char *filename;148 struct gaim_connection *gc;149 };150 151 typedef void (*ft_recv_handler) (struct ft *, void *data, size_t len);152 133 153 134 struct prpl { -
protocols/oscar/AUTHORS
rddd4779 rb6cd9e9 28 28 E: awwaiid@auk.cx 29 29 D: Figured out original password roasting 30 31 -
protocols/yahoo/libyahoo2.c
rddd4779 rb6cd9e9 69 69 #ifdef __MINGW32__ 70 70 # include <winsock2.h> 71 # define write(a,b,c) send(a,b,c,0) 72 # define read(a,b,c) recv(a,b,c,0) 71 73 #endif 72 74 -
protocols/yahoo/yahoo_httplib.c
rddd4779 rb6cd9e9 51 51 #ifdef __MINGW32__ 52 52 # include <winsock2.h> 53 # define write(a,b,c) send(a,b,c,0) 54 # define read(a,b,c) recv(a,b,c,0) 53 55 # define snprintf _snprintf 54 56 #endif -
sock.h
rddd4779 rb6cd9e9 16 16 #else 17 17 # include <winsock2.h> 18 # include <ws2tcpip.h> 18 # ifndef _MSC_VER 19 # include <ws2tcpip.h> 20 # endif 19 21 # if !defined(BITLBEE_CORE) && defined(_MSC_VER) 20 22 # pragma comment(lib,"bitlbee.lib") 21 23 # endif 22 24 # include <io.h> 25 # define read(a,b,c) recv(a,b,c,0) 26 # define write(a,b,c) send(a,b,c,0) 27 # define umask _umask 28 # define mode_t int 23 29 # define sock_make_nonblocking(fd) { int non_block = 1; ioctlsocket(fd, FIONBIO, &non_block); } 24 30 # define sock_make_blocking(fd) { int non_block = 0; ioctlsocket(fd, FIONBIO, &non_block); } -
storage_text.c
rddd4779 rb6cd9e9 27 27 #include "bitlbee.h" 28 28 #include "crypting.h" 29 #ifdef _WIN3230 # define umask _umask31 # define mode_t int32 #endif33 34 #ifndef F_OK35 #define F_OK 036 #endif37 29 38 30 static void text_init (void) -
unix.c
rddd4779 rb6cd9e9 60 60 if( global.conf->runmode == RUNMODE_INETD ) 61 61 { 62 log_link( LOGLVL_ERROR, LOGOUTPUT_IRC );63 log_link( LOGLVL_WARNING, LOGOUTPUT_IRC );64 65 62 i = bitlbee_inetd_init(); 66 63 log_message( LOGLVL_INFO, "Bitlbee %s starting in inetd mode.", BITLBEE_VERSION ); … … 69 66 else if( global.conf->runmode == RUNMODE_DAEMON ) 70 67 { 71 log_link( LOGLVL_ERROR, LOGOUTPUT_SYSLOG );72 log_link( LOGLVL_WARNING, LOGOUTPUT_SYSLOG );73 74 68 i = bitlbee_daemon_init(); 75 69 log_message( LOGLVL_INFO, "Bitlbee %s starting in daemon mode.", BITLBEE_VERSION ); … … 225 219 return( (double) time->tv_sec + (double) time->tv_usec / 1000000 ); 226 220 } 227 228 /* A pretty reliable random number generator. Tries to use the /dev/random229 devices first, and falls back to the random number generator from libc230 when it fails. Opens randomizer devices with O_NONBLOCK to make sure a231 lack of entropy won't halt BitlBee. */232 void random_bytes( unsigned char *buf, int count )233 {234 static int use_dev = -1;235 236 /* Actually this probing code isn't really necessary, is it? */237 if( use_dev == -1 )238 {239 if( access( "/dev/random", R_OK ) == 0 || access( "/dev/urandom", R_OK ) == 0 )240 use_dev = 1;241 else242 {243 use_dev = 0;244 srand( ( getpid() << 16 ) ^ time( NULL ) );245 }246 }247 248 if( use_dev )249 {250 int fd;251 252 /* At least on Linux, /dev/random can block if there's not253 enough entropy. We really don't want that, so if it can't254 give anything, use /dev/urandom instead. */255 if( ( fd = open( "/dev/random", O_RDONLY | O_NONBLOCK ) ) >= 0 )256 if( read( fd, buf, count ) == count )257 {258 close( fd );259 return;260 }261 close( fd );262 263 /* urandom isn't supposed to block at all, but just to be264 sure. If it blocks, we'll disable use_dev and use the libc265 randomizer instead. */266 if( ( fd = open( "/dev/urandom", O_RDONLY | O_NONBLOCK ) ) >= 0 )267 if( read( fd, buf, count ) == count )268 {269 close( fd );270 return;271 }272 close( fd );273 274 /* If /dev/random blocks once, we'll still try to use it275 again next time. If /dev/urandom also fails for some276 reason, stick with libc during this session. */277 278 use_dev = 0;279 srand( ( getpid() << 16 ) ^ time( NULL ) );280 }281 282 if( !use_dev )283 {284 int i;285 286 /* Possibly the LSB of rand() isn't very random on some287 platforms. Seems okay on at least Linux and OSX though. */288 for( i = 0; i < count; i ++ )289 buf[i] = rand() & 0xff;290 }291 }292 293
Note: See TracChangeset
for help on using the changeset viewer.