Changes in / [8961950:4eb4c0f]
- Files:
-
- 2 added
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
r8961950 r4eb4c0f 50 50 $(MAKE) -C tests 51 51 52 lcov:53 52 gcov: check 54 53 gcov *.c -
bitlbee.c
r8961950 r4eb4c0f 48 48 hints.ai_family = PF_UNSPEC; 49 49 hints.ai_socktype = SOCK_STREAM; 50 hints.ai_flags = AI_ADDRCONFIG | AI_PASSIVE; 50 hints.ai_flags = AI_PASSIVE 51 #ifdef AI_ADDRCONFIG 52 | AI_ADDRCONFIG 53 #endif 54 ; 51 55 52 56 i = getaddrinfo( global.conf->iface, global.conf->port, &hints, &addrinfo_bind ); -
bitlbee.h
r8961950 r4eb4c0f 99 99 #endif 100 100 101 #ifndef G_GNUC_MALLOC 102 /* Doesn't exist in GLib <=2.4 while everything else in BitlBee should 103 work with it, so let's fake this one. */ 104 #define G_GNUC_MALLOC 105 #endif 106 101 107 #define _( x ) x 102 108 … … 115 121 #define HELP_FILE VARDIR "help.txt" 116 122 #define CONF_FILE_DEF ETCDIR "bitlbee.conf" 117 118 extern char *CONF_FILE;119 123 120 124 #include "irc.h" … … 140 144 gint listen_watch_source_id; 141 145 help_t *help; 146 char *conf_file; 142 147 conf_t *conf; 143 148 GList *storage; /* The first backend in the list will be used for saving */ -
conf.c
r8961950 r4eb4c0f 36 36 #include "proxy.h" 37 37 38 char *CONF_FILE;39 40 38 static int conf_loadini( conf_t *conf, char *file ); 41 39 … … 43 41 { 44 42 conf_t *conf; 45 int opt, i ;43 int opt, i, config_missing = 0; 46 44 47 45 conf = g_new0( conf_t, 1 ); … … 67 65 proxytype = 0; 68 66 69 i = conf_loadini( conf, CONF_FILE);67 i = conf_loadini( conf, global.conf_file ); 70 68 if( i == 0 ) 71 69 { 72 fprintf( stderr, "Error: Syntax error in configuration file `%s'.\n", CONF_FILE);73 return ( NULL );70 fprintf( stderr, "Error: Syntax error in configuration file `%s'.\n", global.conf_file ); 71 return NULL; 74 72 } 75 73 else if( i == -1 ) 76 74 { 77 fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", CONF_FILE ); 75 config_missing ++; 76 /* Whine after parsing the options if there was no -c pointing 77 at a *valid* configuration file. */ 78 78 } 79 79 … … 107 107 else if( opt == 'c' ) 108 108 { 109 if( strcmp( CONF_FILE, optarg ) != 0 )110 { 111 g_free( CONF_FILE);112 CONF_FILE= g_strdup( optarg );109 if( strcmp( global.conf_file, optarg ) != 0 ) 110 { 111 g_free( global.conf_file ); 112 global.conf_file = g_strdup( optarg ); 113 113 g_free( conf ); 114 114 /* Re-evaluate arguments. Don't use this option twice, … … 116 116 works with all libcs BTW.. */ 117 117 optind = 1; 118 return ( conf_load( argc, argv ));118 return conf_load( argc, argv ); 119 119 } 120 120 } … … 144 144 " -d Specify alternative user configuration directory\n" 145 145 " -h Show this help page.\n" ); 146 return ( NULL );146 return NULL; 147 147 } 148 148 else if( opt == 'R' ) … … 170 170 } 171 171 172 return( conf ); 172 if( config_missing ) 173 fprintf( stderr, "Warning: Unable to read configuration file `%s'.\n", global.conf_file ); 174 175 return conf; 173 176 } 174 177 … … 179 182 180 183 ini = ini_open( file ); 181 if( ini == NULL ) return ( -1 );184 if( ini == NULL ) return -1; 182 185 while( ini_read( ini ) ) 183 186 { … … 262 265 { 263 266 fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value ); 264 return ( 0 );267 return 0; 265 268 } 266 269 conf->ping_interval = i; … … 271 274 { 272 275 fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value ); 273 return ( 0 );276 return 0; 274 277 } 275 278 conf->ping_timeout = i; … … 283 286 fprintf( stderr, "Invalid %s value: %s\n", ini->key, ini->value ); 284 287 g_free( url ); 285 return ( 0 );288 return 0; 286 289 } 287 290 … … 307 310 { 308 311 fprintf( stderr, "Error: Unknown setting `%s` in configuration file.\n", ini->key ); 309 return ( 0 );312 return 0; 310 313 /* For now just ignore unknown keys... */ 311 314 } … … 315 318 fprintf( stderr, "Error: Unknown section [%s] in configuration file. " 316 319 "BitlBee configuration must be put in a [settings] section!\n", ini->section ); 317 return ( 0 );320 return 0; 318 321 } 319 322 } 320 323 ini_close( ini ); 321 324 322 return ( 1 );325 return 1; 323 326 } 324 327 … … 327 330 ini_t *ini; 328 331 329 ini = ini_open( CONF_FILE);332 ini = ini_open( global.conf_file ); 330 333 if( ini == NULL ) return; 331 334 while( ini_read( ini ) ) -
crypting.c
r8961950 r4eb4c0f 29 29 the programs will be built. */ 30 30 31 #include <string.h> 32 #include <stdio.h> 33 #include <stdlib.h> 34 #include <glib.h> 31 #include <bitlbee.h> 35 32 #include "md5.h" 36 33 #include "crypting.h" -
help.c
r8961950 r4eb4c0f 71 71 { 72 72 /* FIXME: Clean up */ 73 // help_close( *help ); 74 *help = NULL; 73 help_free( help ); 75 74 g_free( s ); 76 return ( NULL );75 return NULL; 77 76 } 78 77 i = strchr( s, '\n' ) - s; 79 78 80 if( h-> string)79 if( h->title ) 81 80 { 82 81 h = h->next = g_new0( help_t, 1 ); 83 82 } 84 h-> string= g_new ( char, i );83 h->title = g_new ( char, i ); 85 84 86 strncpy( h-> string, s + 1, i - 1 );87 h-> string[i-1] = 0;85 strncpy( h->title, s + 1, i - 1 ); 86 h->title[i-1] = 0; 88 87 h->fd = (*help)->fd; 89 88 h->offset.file_offset = lseek( h->fd, 0, SEEK_CUR ) - buflen + i + 1; … … 103 102 } 104 103 105 char *help_get( help_t **help, char *string ) 104 void help_free( help_t **help ) 105 { 106 help_t *h, *oh; 107 int last_fd = -1; /* Weak de-dupe */ 108 109 if( help == NULL || *help == NULL ) 110 return; 111 112 h = *help; 113 while( h ) 114 { 115 if( h->fd != last_fd ) 116 { 117 close( h->fd ); 118 last_fd = h->fd; 119 } 120 g_free( h->title ); 121 h = (oh=h)->next; 122 g_free( oh ); 123 } 124 125 *help = NULL; 126 } 127 128 char *help_get( help_t **help, char *title ) 106 129 { 107 130 time_t mtime; … … 111 134 for( h = *help; h; h = h->next ) 112 135 { 113 if( h->string != NULL && 114 g_strcasecmp( h->string, string ) == 0 ) 136 if( h->title != NULL && g_strcasecmp( h->title, title ) == 0 ) 115 137 break; 116 138 } … … 119 141 char *s = g_new( char, h->length + 1 ); 120 142 121 if( fstat( h->fd, stat ) != 0 )122 {123 g_free( h );124 *help = NULL;125 return NULL;126 }127 mtime = stat->st_mtime;128 129 if( mtime > h->mtime )130 return NULL;131 132 143 s[h->length] = 0; 133 144 if( h->fd >= 0 ) 134 145 { 146 if( fstat( h->fd, stat ) != 0 ) 147 { 148 g_free( s ); 149 return NULL; 150 } 151 mtime = stat->st_mtime; 152 153 if( mtime > h->mtime ) 154 { 155 g_free( s ); 156 return NULL; 157 } 158 135 159 lseek( h->fd, h->offset.file_offset, SEEK_SET ); 136 160 read( h->fd, s, h->length ); -
help.h
r8961950 r4eb4c0f 37 37 int fd; 38 38 time_t mtime; 39 char * string;39 char *title; 40 40 help_off_t offset; 41 41 int length; … … 44 44 45 45 G_GNUC_MALLOC help_t *help_init( help_t **help, const char *helpfile ); 46 char *help_get( help_t **help, char *string ); 46 void help_free( help_t **help ); 47 char *help_get( help_t **help, char *title ); 47 48 48 49 #endif -
irc.c
r8961950 r4eb4c0f 77 77 78 78 if( getnameinfo( (struct sockaddr *) &sock, socklen, buf, 79 NI_MAXHOST, NULL, -1, 0 ) == 0 )79 NI_MAXHOST, NULL, 0, 0 ) == 0 ) 80 80 { 81 81 irc->myhost = g_strdup( ipv6_unwrap( buf ) ); … … 88 88 89 89 if( getnameinfo( (struct sockaddr *)&sock, socklen, buf, 90 NI_MAXHOST, NULL, -1, 0 ) == 0 )90 NI_MAXHOST, NULL, 0, 0 ) == 0 ) 91 91 { 92 92 irc->host = g_strdup( ipv6_unwrap( buf ) ); … … 199 199 account_t *account; 200 200 user_t *user, *usertmp; 201 help_t *helpnode, *helpnodetmp;202 201 203 202 log_message( LOGLVL_INFO, "Destroying connection with fd %d", irc->fd ); … … 275 274 g_hash_table_foreach_remove(irc->watches, irc_free_hashkey, NULL); 276 275 g_hash_table_destroy(irc->watches); 277 278 if (irc->help != NULL) {279 helpnode = irc->help;280 while (helpnode != NULL) {281 g_free(helpnode->string);282 283 helpnodetmp = helpnode;284 helpnode = helpnode->next;285 g_free(helpnodetmp);286 }287 }288 276 289 277 otr_free(irc->otr); -
irc.h
r8961950 r4eb4c0f 91 91 GHashTable *watches; 92 92 struct __NICK *nicks; 93 struct help *help;94 93 struct set *set; 95 94 -
irc_commands.c
r8961950 r4eb4c0f 556 556 557 557 for( h = global.help; h; h = h->next ) 558 irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS help ", h-> string);558 irc_privmsg( irc, u, "NOTICE", irc->nick, "COMPLETIONS help ", h->title ); 559 559 560 560 for( s = irc->set; s; s = s->next ) … … 571 571 ipc_to_master( cmd ); 572 572 573 irc_reply( irc, 382, "%s :Rehashing", CONF_FILE);573 irc_reply( irc, 382, "%s :Rehashing", global.conf_file ); 574 574 } 575 575 -
lib/Makefile
r8961950 r4eb4c0f 18 18 all: lib.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/Makefile
r8961950 r4eb4c0f 27 27 all: protocols.o 28 28 check: all 29 lcov: 29 lcov: check 30 30 gcov: 31 31 gcov *.c -
protocols/jabber/Makefile
r8961950 r4eb4c0f 18 18 all: jabber_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/jabber/conference.c
r8961950 r4eb4c0f 37 37 xt_add_attr( node, "xmlns", XMLNS_MUC ); 38 38 node = jabber_make_packet( "presence", NULL, roomjid, node ); 39 if( password ) 40 xt_add_child( node, xt_new_node( "password", password, NULL ) ); 39 41 jabber_cache_add( ic, node, jabber_chat_join_failed ); 40 42 … … 122 124 struct jabber_chat *jc = c->data; 123 125 struct xt_node *node; 126 127 jc->flags |= JCFLAG_MESSAGE_SENT; 124 128 125 129 node = xt_new_node( "body", message, NULL ); … … 295 299 struct xt_node *subject = xt_find_node( node->children, "subject" ); 296 300 struct xt_node *body = xt_find_node( node->children, "body" ); 297 struct groupchat *chat = NULL; 301 struct groupchat *chat = bud ? jabber_chat_by_jid( ic, bud->bare_jid ) : NULL; 302 struct jabber_chat *jc = chat ? chat->data : NULL; 298 303 char *s; 299 304 300 if( bud == NULL )305 if( bud == NULL || ( jc && ~jc->flags & JCFLAG_MESSAGE_SENT && bud == jc->me ) ) 301 306 { 302 307 char *nick; … … 346 351 return; 347 352 } 348 else if( ( chat = jabber_chat_by_jid( ic, bud->bare_jid ) )== NULL )353 else if( chat == NULL ) 349 354 { 350 355 /* How could this happen?? We could do kill( self, 11 ) -
protocols/jabber/iq.c
r8961950 r4eb4c0f 92 92 else if( strcmp( s, XMLNS_DISCOVER ) == 0 ) 93 93 { 94 const char *features[] = { XMLNS_VERSION, 94 const char *features[] = { XMLNS_DISCOVER, 95 XMLNS_VERSION, 95 96 XMLNS_TIME, 96 97 XMLNS_CHATSTATES, -
protocols/jabber/jabber.h
r8961950 r4eb4c0f 49 49 typedef enum 50 50 { 51 JBFLAG_PROBED_XEP85 = 1, 51 JBFLAG_PROBED_XEP85 = 1, /* Set this when we sent our probe packet to make 52 52 sure it gets sent only once. */ 53 JBFLAG_DOES_XEP85 = 2, 53 JBFLAG_DOES_XEP85 = 2, /* Set this when the resource seems to support 54 54 XEP85 (typing notification shite). */ 55 JBFLAG_IS_CHATROOM = 4, 55 JBFLAG_IS_CHATROOM = 4, /* It's convenient to use this JID thingy for 56 56 groupchat state info too. */ 57 JBFLAG_IS_ANONYMOUS = 8, 57 JBFLAG_IS_ANONYMOUS = 8, /* For anonymous chatrooms, when we don't have 58 58 have a real JID. */ 59 59 } jabber_buddy_flags_t; 60 61 typedef enum 62 { 63 JCFLAG_MESSAGE_SENT = 1, /* Set this after sending the first message, so 64 we can detect echoes/backlogs. */ 65 } jabber_chat_flags_t; 60 66 61 67 struct jabber_data … … 95 101 struct jabber_cache_entry 96 102 { 103 time_t saved_at; 97 104 struct xt_node *node; 98 105 jabber_cache_event func; … … 140 147 #define JABBER_PACKET_ID "BeeP" 141 148 #define JABBER_CACHED_ID "BeeC" 149 150 /* The number of seconds to keep cached packets before garbage collecting 151 them. This gc is done on every keepalive (every minute). */ 152 #define JABBER_CACHE_MAX_AGE 600 142 153 143 154 /* RFC 392[01] stuff */ … … 161 172 #define XMLNS_MUC "http://jabber.org/protocol/muc" /* XEP-0045 */ 162 173 #define XMLNS_MUC_USER "http://jabber.org/protocol/muc#user"/* XEP-0045 */ 174 #define XMLNS_CAPS "http://jabber.org/protocol/caps" /* XEP-0115 */ 163 175 164 176 /* iq.c */ -
protocols/jabber/jabber_util.c
r8961950 r4eb4c0f 142 142 entry->node = node; 143 143 entry->func = func; 144 entry->saved_at = time( NULL ); 144 145 g_hash_table_insert( jd->node_cache, xt_find_attr( node, "id" ), entry ); 145 146 } … … 163 164 { 164 165 struct jabber_data *jd = ic->proto_data; 165 166 g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, NULL ); 167 } 168 169 gboolean jabber_cache_clean_entry( gpointer key, gpointer entry_, gpointer nullpointer ) 166 time_t threshold = time( NULL ) - JABBER_CACHE_MAX_AGE; 167 168 g_hash_table_foreach_remove( jd->node_cache, jabber_cache_clean_entry, &threshold ); 169 } 170 171 gboolean jabber_cache_clean_entry( gpointer key, gpointer entry_, gpointer threshold_ ) 170 172 { 171 173 struct jabber_cache_entry *entry = entry_; 172 struct xt_node *node = entry->node; 173 174 if( node->flags & XT_SEEN ) 175 return TRUE; 176 else 177 { 178 node->flags |= XT_SEEN; 179 return FALSE; 180 } 174 time_t *threshold = threshold_; 175 176 return entry->saved_at < *threshold; 181 177 } 182 178 -
protocols/jabber/presence.c
r8961950 r4eb4c0f 29 29 char *from = xt_find_attr( node, "from" ); 30 30 char *type = xt_find_attr( node, "type" ); /* NULL should mean the person is online. */ 31 struct xt_node *c ;31 struct xt_node *c, *cap; 32 32 struct jabber_buddy *bud, *send_presence = NULL; 33 33 int is_chat = 0; … … 76 76 else 77 77 bud->priority = 0; 78 79 if( bud && ( cap = xt_find_node( node->children, "c" ) ) && 80 ( s = xt_find_attr( cap, "xmlns" ) ) && strcmp( s, XMLNS_CAPS ) == 0 ) 81 { 82 /* This <presence> stanza includes an XEP-0115 83 capabilities part. Not too interesting, but we can 84 see if it has an ext= attribute. */ 85 s = xt_find_attr( cap, "ext" ); 86 if( s && ( strstr( s, "cstates" ) || strstr( s, "chatstate" ) ) ) 87 bud->flags |= JBFLAG_DOES_XEP85; 88 89 /* This field can contain more information like xhtml 90 support, but we don't support that ourselves. 91 Officially the ext= tag was deprecated, but enough 92 clients do send it. 93 94 (I'm aware that this is not the right way to use 95 this field.) See for an explanation of ext=: 96 http://www.xmpp.org/extensions/attic/xep-0115-1.3.html*/ 97 } 78 98 79 99 if( is_chat ) … … 186 206 { 187 207 struct jabber_data *jd = ic->proto_data; 188 struct xt_node *node ;208 struct xt_node *node, *cap; 189 209 char *show = jd->away_state->code; 190 210 char *status = jd->away_message; … … 199 219 xt_add_child( node, xt_new_node( "status", status, NULL ) ); 200 220 221 /* This makes the packet slightly bigger, but clients interested in 222 capabilities can now cache the discovery info. This reduces the 223 usual post-login iq-flood. See XEP-0115. At least libpurple and 224 Trillian seem to do this right. */ 225 cap = xt_new_node( "c", NULL, NULL ); 226 xt_add_attr( cap, "xmlns", XMLNS_CAPS ); 227 xt_add_attr( cap, "node", "http://bitlbee.org/xmpp/caps" ); 228 xt_add_attr( cap, "ver", BITLBEE_VERSION ); /* The XEP wants this hashed, but nobody's doing that. */ 229 xt_add_child( node, cap ); 230 201 231 st = jabber_write_packet( ic, node ); 202 232 -
protocols/jabber/sasl.c
r8961950 r4eb4c0f 21 21 * * 22 22 \***************************************************************************/ 23 24 #include <ctype.h> 23 25 24 26 #include "jabber.h" … … 107 109 } 108 110 109 static char *sasl_get_part( char *data, char *field ) 111 /* Non-static function, but not mentioned in jabber.h because it's for internal 112 use, just that the unittest should be able to reach it... */ 113 char *sasl_get_part( char *data, char *field ) 110 114 { 111 115 int i, len; 112 116 113 117 len = strlen( field ); 118 119 while( isspace( *data ) || *data == ',' ) 120 data ++; 114 121 115 122 if( g_strncasecmp( data, field, len ) == 0 && data[len] == '=' ) … … 129 136 } 130 137 131 /* If we got a comma, we got a new field. Check it. */ 132 if( data[i] == ',' && 133 g_strncasecmp( data + i + 1, field, len ) == 0 && 134 data[i+len+1] == '=' ) 138 /* If we got a comma, we got a new field. Check it, 139 find the next key after it. */ 140 if( data[i] == ',' ) 135 141 { 136 i += len + 2; 137 break; 142 while( isspace( data[i] ) || data[i] == ',' ) 143 i ++; 144 145 if( g_strncasecmp( data + i, field, len ) == 0 && 146 data[i+len] == '=' ) 147 { 148 i += len + 1; 149 break; 150 } 138 151 } 139 152 } -
protocols/msn/Makefile
r8961950 r4eb4c0f 18 18 all: msn_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/msn/ns.c
r8961950 r4eb4c0f 584 584 else 585 585 { 586 debug( "Received unknown command from main server: %s", cmd[0] );586 /* debug( "Received unknown command from main server: %s", cmd[0] ); */ 587 587 } 588 588 -
protocols/msn/sb.c
r8961950 r4eb4c0f 594 594 else 595 595 { 596 debug( "Received unknown command from switchboard server: %s", cmd[0] );596 /* debug( "Received unknown command from switchboard server: %s", cmd[0] ); */ 597 597 } 598 598 -
protocols/oscar/Makefile
r8961950 r4eb4c0f 18 18 all: oscar_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
protocols/oscar/oscar.c
r8961950 r4eb4c0f 1066 1066 g_snprintf(tmp, BUF_LONG, "%s", args->msg); 1067 1067 } else { 1068 int i;1068 aim_mpmsg_section_t *part; 1069 1069 1070 1070 *tmp = 0; 1071 for (i = 0; i < args->mpmsg.numparts; i ++) { 1072 g_strlcat(tmp, (char*) args->mpmsg.parts[i].data, BUF_LONG); 1073 g_strlcat(tmp, "\n", BUF_LONG); 1071 for (part = args->mpmsg.parts; part; part = part->next) { 1072 if (part->data) { 1073 g_strlcat(tmp, (char*) part->data, BUF_LONG); 1074 g_strlcat(tmp, "\n", BUF_LONG); 1075 } 1074 1076 } 1075 1077 } -
protocols/yahoo/Makefile
r8961950 r4eb4c0f 18 18 all: yahoo_mod.o 19 19 check: all 20 lcov: 20 lcov: check 21 21 gcov: 22 22 gcov *.c -
root_commands.c
r8961950 r4eb4c0f 454 454 { 455 455 add_on_server = 0; 456 cmd ++; /* So evil... :-D */456 cmd ++; 457 457 } 458 458 … … 486 486 } 487 487 488 /* By making this optional, you can talk to people without having to489 add them to your *real* (server-side) contact list. */490 488 if( add_on_server ) 491 489 a->ic->acc->prpl->add_buddy( a->ic, cmd[2], NULL ); 492 493 /* add_buddy( a->ic, NULL, cmd[2], cmd[2] ); */ 490 else 491 /* Yeah, officially this is a call-*back*... So if we just 492 called add_buddy, we'll wait for the IM server to respond 493 before we do this. */ 494 imcb_add_buddy( a->ic, cmd[2], NULL ); 494 495 495 496 irc_usermsg( irc, "Adding `%s' to your contact list", cmd[2] ); -
storage_text.c
r8961950 r4eb4c0f 30 30 static void text_init (void) 31 31 { 32 if( access( global.conf->configdir, F_OK ) != 0 )33 log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", global.conf->configdir );34 else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 )35 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir );32 /* Don't complain about the configuration directory anymore, leave it 33 up to the XML storage module, which uses the same directory for it 34 anyway. Nobody should be using just the text plugin anymore since 35 it's read only! */ 36 36 } 37 37 -
storage_xml.c
r8961950 r4eb4c0f 263 263 { 264 264 if( access( global.conf->configdir, F_OK ) != 0 ) 265 log_message( LOGLVL_WARNING, "The configuration directory %sdoes not exist. Configuration won't be saved.", global.conf->configdir );265 log_message( LOGLVL_WARNING, "The configuration directory `%s' does not exist. Configuration won't be saved.", global.conf->configdir ); 266 266 else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) 267 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir );267 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to `%s'.", global.conf->configdir ); 268 268 } 269 269 -
tests/Makefile
r8961950 r4eb4c0f 11 11 distclean: clean 12 12 13 main_objs = 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_xml.o storage_text.o user.o 13 main_objs = 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_xml.o storage_text.o user.o 14 14 15 test_objs = check.o check_util.o check_nick.o check_md5.o check_arc.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o 15 test_objs = check.o check_util.o check_nick.o check_md5.o check_arc.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o check_jabber_sasl.o 16 16 17 17 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o -
tests/check.c
r8961950 r4eb4c0f 66 66 Suite *set_suite(void); 67 67 68 /* From check_jabber_sasl.c */ 69 Suite *jabber_sasl_suite(void); 70 68 71 int main (int argc, char **argv) 69 72 { … … 111 114 srunner_add_suite(sr, crypting_suite()); 112 115 srunner_add_suite(sr, set_suite()); 116 srunner_add_suite(sr, jabber_sasl_suite()); 113 117 if (no_fork) 114 118 srunner_set_fork_status(sr, CK_NOFORK); -
tests/check_arc.c
r8961950 r4eb4c0f 62 62 0x73, 0x6d, 0xb3, 0x0a, 0x6f, 0x0a, 0x2b, 0x43, 0x57, 0xe9, 0x3e, 0x63 63 63 }, 24, "OSCAR is creepy..." 64 } 64 }, 65 { "", 0, NULL } 65 66 }; 66 67 … … 69 70 int i; 70 71 71 for( i = 0; clear_tests[i]; i++ )72 for( i = 0; decrypt_tests[i].len; i++ ) 72 73 { 73 74 tcase_fn_start (decrypt_tests[i].decrypted, __FILE__, __LINE__); -
unix.c
r8961950 r4eb4c0f 48 48 49 49 log_init(); 50 CONF_FILE= g_strdup( CONF_FILE_DEF );50 global.conf_file = g_strdup( CONF_FILE_DEF ); 51 51 global.conf = conf_load( argc, argv ); 52 52 if( global.conf == NULL ) … … 126 126 if( !getuid() || !geteuid() ) 127 127 log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); 128 if( help_init( & (global.help), global.helpfile ) == NULL )128 if( help_init( &global.help, global.helpfile ) == NULL ) 129 129 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); 130 130 131 131 b_main_run(); 132 133 /* Mainly good for restarting, to make sure we close the help.txt fd. */ 134 help_free( &global.help ); 132 135 133 136 if( global.restart )
Note: See TracChangeset
for help on using the changeset viewer.