Changes in / [1aa0bb5:b8ef1b1]
- Files:
-
- 3 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r1aa0bb5 rb8ef1b1 8 8 build-arch-stamp 9 9 tags 10 decode11 encode -
Makefile
r1aa0bb5 rb8ef1b1 10 10 11 11 # Program variables 12 objects = account.o bitlbee.o commands.o conf.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o unix.o url.o user.o storage_text.o storage.o12 objects = account.o bitlbee.o commands.o conf.o crypting.o help.o ini.o irc.o log.o nick.o query.o set.o unix.o url.o user.o 13 13 subdirs = protocols 14 14 -
bitlbee.c
r1aa0bb5 rb8ef1b1 27 27 #include "bitlbee.h" 28 28 #include "commands.h" 29 #include "crypting.h" 29 30 #include "protocols/nogaim.h" 30 31 #include "help.h" … … 243 244 } 244 245 246 int bitlbee_load( irc_t *irc, char* password ) 247 { 248 char s[512]; 249 char *line; 250 int proto; 251 char nick[MAX_NICK_LENGTH+1]; 252 FILE *fp; 253 user_t *ru = user_find( irc, ROOT_NICK ); 254 255 if( irc->status == USTATUS_IDENTIFIED ) 256 return( 1 ); 257 258 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 259 fp = fopen( s, "r" ); 260 if( !fp ) return( 0 ); 261 262 fscanf( fp, "%32[^\n]s", s ); 263 if( setpass( irc, password, s ) < 0 ) 264 { 265 fclose( fp ); 266 return( -1 ); 267 } 268 269 /* Do this now. If the user runs with AuthMode = Registered, the 270 account command will not work otherwise. */ 271 irc->status = USTATUS_IDENTIFIED; 272 273 while( fscanf( fp, "%511[^\n]s", s ) > 0 ) 274 { 275 fgetc( fp ); 276 line = deobfucrypt( irc, s ); 277 root_command_string( irc, ru, line, 0 ); 278 g_free( line ); 279 } 280 fclose( fp ); 281 282 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 283 fp = fopen( s, "r" ); 284 if( !fp ) return( 0 ); 285 while( fscanf( fp, "%s %d %s", s, &proto, nick ) > 0 ) 286 { 287 http_decode( s ); 288 nick_set( irc, s, proto, nick ); 289 } 290 fclose( fp ); 291 292 if( set_getint( irc, "auto_connect" ) ) 293 { 294 strcpy( s, "account on" ); /* Can't do this directly because r_c_s alters the string */ 295 root_command_string( irc, ru, s, 0 ); 296 } 297 298 return( 1 ); 299 } 300 301 int bitlbee_save( irc_t *irc ) 302 { 303 char s[512]; 304 char path[512], new_path[512]; 305 char *line; 306 nick_t *n; 307 set_t *set; 308 mode_t ou = umask( 0077 ); 309 account_t *a; 310 FILE *fp; 311 char *hash; 312 313 /*\ 314 * [SH] Nothing should be saved if no password is set, because the 315 * password is not set if it was wrong, or if one is not identified 316 * yet. This means that a malicious user could easily overwrite 317 * files owned by someone else: 318 * a Bad Thing, methinks 319 \*/ 320 321 /* [WVG] No? Really? */ 322 323 /*\ 324 * [SH] Okay, okay, it wasn't really Wilmer who said that, it was 325 * me. I just thought it was funny. 326 \*/ 327 328 hash = hashpass( irc ); 329 if( hash == NULL ) 330 { 331 irc_usermsg( irc, "Please register yourself if you want to save your settings." ); 332 return( 0 ); 333 } 334 335 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks~" ); 336 fp = fopen( path, "w" ); 337 if( !fp ) return( 0 ); 338 for( n = irc->nicks; n; n = n->next ) 339 { 340 strcpy( s, n->handle ); 341 s[169] = 0; /* Prevent any overflow (169 ~ 512 / 3) */ 342 http_encode( s ); 343 g_snprintf( s + strlen( s ), 510 - strlen( s ), " %d %s", n->proto, n->nick ); 344 if( fprintf( fp, "%s\n", s ) != strlen( s ) + 1 ) 345 { 346 irc_usermsg( irc, "fprintf() wrote too little. Disk full?" ); 347 fclose( fp ); 348 return( 0 ); 349 } 350 } 351 if( fclose( fp ) != 0 ) 352 { 353 irc_usermsg( irc, "fclose() reported an error. Disk full?" ); 354 return( 0 ); 355 } 356 357 g_snprintf( new_path, 512, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 358 if( unlink( new_path ) != 0 ) 359 { 360 if( errno != ENOENT ) 361 { 362 irc_usermsg( irc, "Error while removing old .nicks file" ); 363 return( 0 ); 364 } 365 } 366 if( rename( path, new_path ) != 0 ) 367 { 368 irc_usermsg( irc, "Error while renaming new .nicks file" ); 369 return( 0 ); 370 } 371 372 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts~" ); 373 fp = fopen( path, "w" ); 374 if( !fp ) return( 0 ); 375 if( fprintf( fp, "%s", hash ) != strlen( hash ) ) 376 { 377 irc_usermsg( irc, "fprintf() wrote too little. Disk full?" ); 378 fclose( fp ); 379 return( 0 ); 380 } 381 g_free( hash ); 382 383 for( a = irc->accounts; a; a = a->next ) 384 { 385 if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC ) 386 g_snprintf( s, sizeof( s ), "account add oscar \"%s\" \"%s\" %s", a->user, a->pass, a->server ); 387 else 388 g_snprintf( s, sizeof( s ), "account add %s \"%s\" \"%s\" \"%s\"", 389 proto_name[a->protocol], a->user, a->pass, a->server ? a->server : "" ); 390 391 line = obfucrypt( irc, s ); 392 if( *line ) 393 { 394 if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) 395 { 396 irc_usermsg( irc, "fprintf() wrote too little. Disk full?" ); 397 fclose( fp ); 398 return( 0 ); 399 } 400 } 401 g_free( line ); 402 } 403 404 for( set = irc->set; set; set = set->next ) 405 { 406 if( set->value && set->def ) 407 { 408 g_snprintf( s, sizeof( s ), "set %s \"%s\"", set->key, set->value ); 409 line = obfucrypt( irc, s ); 410 if( *line ) 411 { 412 if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) 413 { 414 irc_usermsg( irc, "fprintf() wrote too little. Disk full?" ); 415 fclose( fp ); 416 return( 0 ); 417 } 418 } 419 g_free( line ); 420 } 421 } 422 423 if( strcmp( irc->mynick, ROOT_NICK ) != 0 ) 424 { 425 g_snprintf( s, sizeof( s ), "rename %s %s", ROOT_NICK, irc->mynick ); 426 line = obfucrypt( irc, s ); 427 if( *line ) 428 { 429 if( fprintf( fp, "%s\n", line ) != strlen( line ) + 1 ) 430 { 431 irc_usermsg( irc, "fprintf() wrote too little. Disk full?" ); 432 fclose( fp ); 433 return( 0 ); 434 } 435 } 436 g_free( line ); 437 } 438 if( fclose( fp ) != 0 ) 439 { 440 irc_usermsg( irc, "fclose() reported an error. Disk full?" ); 441 return( 0 ); 442 } 443 444 g_snprintf( new_path, 512, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 445 if( unlink( new_path ) != 0 ) 446 { 447 if( errno != ENOENT ) 448 { 449 irc_usermsg( irc, "Error while removing old .accounts file" ); 450 return( 0 ); 451 } 452 } 453 if( rename( path, new_path ) != 0 ) 454 { 455 irc_usermsg( irc, "Error while renaming new .accounts file" ); 456 return( 0 ); 457 } 458 459 umask( ou ); 460 461 return( 1 ); 462 } 463 245 464 void bitlbee_shutdown( gpointer data ) 246 465 { -
bitlbee.h
r1aa0bb5 rb8ef1b1 100 100 101 101 #include "irc.h" 102 #include "storage.h"103 102 #include "set.h" 104 103 #include "protocols/nogaim.h" … … 116 115 help_t *help; 117 116 conf_t *conf; 118 storage_t *storage;119 117 char *helpfile; 120 118 GMainLoop *loop; … … 129 127 int root_command_string( irc_t *irc, user_t *u, char *command, int flags ); 130 128 int root_command( irc_t *irc, char *command[] ); 129 int bitlbee_load( irc_t *irc, char *password ); 130 int bitlbee_save( irc_t *irc ); 131 131 void bitlbee_shutdown( gpointer data ); 132 132 double gettime( void ); -
commands.c
r1aa0bb5 rb8ef1b1 86 86 int cmd_identify( irc_t *irc, char **cmd ) 87 87 { 88 storage_status_t status = global.storage->load( irc->nick, cmd[1], irc);89 90 switch (status) {91 case STORAGE_INVALID_PASSWORD:88 int checkie = bitlbee_load( irc, cmd[1] ); 89 90 if( checkie == -1 ) 91 { 92 92 irc_usermsg( irc, "Incorrect password" ); 93 break; 94 case STORAGE_NO_SUCH_USER: 93 } 94 else if( checkie == 0 ) 95 { 95 96 irc_usermsg( irc, "The nick is (probably) not registered" ); 96 break; 97 case STORAGE_OK: 97 } 98 else if( checkie == 1 ) 99 { 98 100 irc_usermsg( irc, "Password accepted" ); 99 break; 100 default: 101 } 102 else 103 { 101 104 irc_usermsg( irc, "Something very weird happened" ); 102 break;103 105 } 104 106 … … 108 110 int cmd_register( irc_t *irc, char **cmd ) 109 111 { 112 int checkie; 113 char path[512]; 114 110 115 if( global.conf->authmode == AUTHMODE_REGISTERED ) 111 116 { … … 113 118 return( 0 ); 114 119 } 115 116 irc_setpass( irc, cmd[1] ); 117 switch( global.storage->save( irc, FALSE )) { 118 case STORAGE_ALREADY_EXISTS: 119 irc_usermsg( irc, "Nick is already registered" ); 120 break; 121 122 case STORAGE_OK: 123 irc->status = USTATUS_IDENTIFIED; 124 break; 125 126 default: 127 irc_usermsg( irc, "Error registering" ); 128 break; 120 121 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 122 checkie = access( path, F_OK ); 123 124 g_snprintf( path, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 125 checkie += access( path, F_OK ); 126 127 if( checkie == -2 ) 128 { 129 setpassnc( irc, cmd[1] ); 130 root_command_string( irc, user_find( irc, irc->mynick ), "save", 0 ); 131 irc->status = USTATUS_IDENTIFIED; 132 } 133 else 134 { 135 irc_usermsg( irc, "Nick is already registered" ); 129 136 } 130 137 … … 134 141 int cmd_drop( irc_t *irc, char **cmd ) 135 142 { 136 storage_status_t status; 137 138 status = global.storage->remove (irc->nick, cmd[1]); 139 switch (status) { 140 case STORAGE_NO_SUCH_USER: 143 char s[512]; 144 FILE *fp; 145 146 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 147 fp = fopen( s, "r" ); 148 if( !fp ) 149 { 141 150 irc_usermsg( irc, "That account does not exist" ); 142 151 return( 0 ); 143 case STORAGE_INVALID_PASSWORD: 144 irc_usermsg( irc, "Password invalid" ); 145 return( 0 ); 146 case STORAGE_OK: 147 irc_setpass( irc, NULL ); 148 irc_usermsg( irc, "Account `%s' removed", irc->nick ); 149 return( 0 ); 150 default: 151 irc_usermsg( irc, "Error: '%d'", status ); 152 return( 0 ); 153 } 152 } 153 154 fscanf( fp, "%32[^\n]s", s ); 155 fclose( fp ); 156 if( setpass( irc, cmd[1], s ) < 0 ) 157 { 158 irc_usermsg( irc, "Incorrect password" ); 159 return( 0 ); 160 } 161 162 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".accounts" ); 163 unlink( s ); 164 165 g_snprintf( s, 511, "%s%s%s", global.conf->configdir, irc->nick, ".nicks" ); 166 unlink( s ); 167 168 setpassnc( irc, NULL ); 169 irc_usermsg( irc, "Files belonging to account `%s' removed", irc->nick ); 170 171 return( 0 ); 154 172 } 155 173 … … 616 634 int cmd_save( irc_t *irc, char **cmd ) 617 635 { 618 if( global.storage->save( irc, TRUE ) == STORAGE_OK)636 if( bitlbee_save( irc ) ) 619 637 irc_usermsg( irc, "Configuration saved" ); 620 638 else -
conf.c
r1aa0bb5 rb8ef1b1 50 50 conf->nofork = 0; 51 51 conf->verbose = 0; 52 conf->storage = "text";53 52 conf->runmode = RUNMODE_INETD; 54 53 conf->authmode = AUTHMODE_OPEN; … … 199 198 conf->motdfile = g_strdup( ini->value ); 200 199 } 201 else if( g_strcasecmp( ini->key, "storage" ) == 0 )202 {203 g_free( conf->storage );204 conf->storage = g_strdup( ini->value );205 }206 200 else if( g_strcasecmp( ini->key, "pinginterval" ) == 0 ) 207 201 { -
conf.h
r1aa0bb5 rb8ef1b1 42 42 char *configdir; 43 43 char *motdfile; 44 char *storage;45 44 int ping_interval; 46 45 int ping_timeout; -
crypting.c
r1aa0bb5 rb8ef1b1 46 46 } irc_t; 47 47 48 #define set_add( a, b, c, d ) 49 #define set_find( a, b ) NULL 50 48 51 #include "md5.h" 49 52 #include "crypting.h" … … 52 55 #include <stdlib.h> 53 56 57 #define irc_usermsg 58 54 59 #endif 55 60 … … 60 65 \*/ 61 66 62 int checkpass (const char *pass, const char *md5sum) 63 { 67 /* USE WITH CAUTION! 68 Sets pass without checking */ 69 void setpassnc (irc_t *irc, char *pass) { 70 if (!set_find (irc, "password")) 71 set_add (irc, "password", NULL, passchange); 72 73 if (irc->password) g_free (irc->password); 74 75 if (pass) { 76 irc->password = g_strdup (pass); 77 irc_usermsg (irc, "Password successfully changed"); 78 } else { 79 irc->password = NULL; 80 } 81 } 82 83 char *passchange (irc_t *irc, void *set, char *value) { 84 setpassnc (irc, value); 85 return (NULL); 86 } 87 88 int setpass (irc_t *irc, char *pass, char* md5sum) { 64 89 md5_state_t md5state; 65 90 md5_byte_t digest[16]; … … 78 103 if (digits[1] != md5sum[j + 1]) return (-1); 79 104 } 80 81 return( 0 ); 82 } 83 105 106 /* If pass is correct, we end up here and we set the pass */ 107 setpassnc (irc, pass); 108 109 return (0); 110 } 84 111 85 112 char *hashpass (irc_t *irc) { … … 108 135 } 109 136 110 char *obfucrypt (irc_t *irc, char *line) 111 { 137 char *obfucrypt (irc_t *irc, char *line) { 112 138 int i, j; 113 139 char *rv; … … 115 141 if (irc->password == NULL) return (NULL); 116 142 117 rv = g_new0(char, strlen (line) + 1); 143 rv = (char *)g_malloc (strlen (line) + 1); 144 memset (rv, '\0', strlen (line) + 1); 118 145 119 146 i = j = 0; … … 133 160 } 134 161 135 char *deobfucrypt (irc_t *irc, char *line) 136 { 162 char *deobfucrypt (irc_t *irc, char *line) { 137 163 int i, j; 138 164 char *rv; … … 140 166 if (irc->password == NULL) return (NULL); 141 167 142 rv = g_new0(char, strlen (line) + 1); 168 rv = (char *)g_malloc (strlen (line) + 1); 169 memset (rv, '\0', strlen (line) + 1); 143 170 144 171 i = j = 0; … … 162 189 int main( int argc, char *argv[] ) 163 190 { 164 irc_t *irc = g_ new0( irc_t, 1);191 irc_t *irc = g_malloc( sizeof( irc_t ) ); 165 192 char *hash, *action, line[256]; 166 193 char* (*func)( irc_t *, char * ); … … 174 201 } 175 202 203 memset( irc, 0, sizeof( irc_t ) ); 176 204 irc->password = g_strdup( argv[1] ); 177 205 -
crypting.h
r1aa0bb5 rb8ef1b1 24 24 */ 25 25 26 int checkpass (const char *password, const char *md5sum); 26 void setpassnc (irc_t *irc, char *pass); /* USE WITH CAUTION! */ 27 char *passchange (irc_t *irc, void *set, char *value); 28 int setpass (irc_t *irc, char *pass, char* md5sum); 27 29 char *hashpass (irc_t *irc); 28 30 char *obfucrypt (irc_t *irc, char *line); -
irc.c
r1aa0bb5 rb8ef1b1 31 31 32 32 GSList *irc_connection_list = NULL; 33 34 static char *passchange (irc_t *irc, void *set, char *value)35 {36 irc_setpass (irc, value);37 return (NULL);38 }39 33 40 34 irc_t *irc_new( int fd ) … … 135 129 set_add( irc, "to_char", ": ", set_eval_to_char ); 136 130 set_add( irc, "typing_notice", "false", set_eval_bool ); 137 set_add( irc, "password", NULL, passchange);138 131 139 132 conf_loaddefaults( irc ); … … 161 154 162 155 if( irc->status >= USTATUS_IDENTIFIED && set_getint( irc, "save_on_quit" ) ) 163 if( ! global.storage->save( irc, TRUE) )156 if( !bitlbee_save( irc ) ) 164 157 irc_usermsg( irc, "Error while saving settings!" ); 165 158 … … 266 259 if( global.conf->runmode == RUNMODE_INETD ) 267 260 g_main_quit( global.loop ); 268 }269 270 /* USE WITH CAUTION!271 Sets pass without checking */272 void irc_setpass (irc_t *irc, const char *pass)273 {274 if (irc->password) g_free (irc->password);275 276 if (pass) {277 irc->password = g_strdup (pass);278 irc_usermsg (irc, "Password successfully changed");279 } else {280 irc->password = NULL;281 }282 261 } 283 262 -
irc.h
r1aa0bb5 rb8ef1b1 137 137 void irc_whois( irc_t *irc, char *nick ); 138 138 int irc_away( irc_t *irc, char *away ); 139 void irc_setpass( irc_t *irc, const char *pass ); /* USE WITH CAUTION! */140 139 141 140 int irc_send( irc_t *irc, char *nick, char *s, int flags ); -
nick.c
r1aa0bb5 rb8ef1b1 27 27 #include "bitlbee.h" 28 28 29 void nick_set( irc_t *irc, c onst char *handle, int proto, constchar *nick )29 void nick_set( irc_t *irc, char *handle, int proto, char *nick ) 30 30 { 31 31 nick_t *m = NULL, *n = irc->nicks; … … 56 56 } 57 57 58 char *nick_get( irc_t *irc, c onst char *handle, int proto, const char *realname )58 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname ) 59 59 { 60 60 static char nick[MAX_NICK_LENGTH+1]; … … 129 129 } 130 130 131 void nick_del( irc_t *irc, c onst char *nick )131 void nick_del( irc_t *irc, char *nick ) 132 132 { 133 133 nick_t *l = NULL, *n = irc->nicks; … … 176 176 } 177 177 178 int nick_ok( c onst char *nick )179 { 180 c onst char *s;178 int nick_ok( char *nick ) 179 { 180 char *s; 181 181 182 182 /* Empty/long nicks are not allowed */ … … 237 237 } 238 238 239 int nick_cmp( c onst char *a, constchar *b )239 int nick_cmp( char *a, char *b ) 240 240 { 241 241 char aa[1024] = "", bb[1024] = ""; … … 253 253 } 254 254 255 char *nick_dup( const char *nick ) 256 { 257 return g_strndup( nick, MAX_NICK_LENGTH ); 258 } 255 char *nick_dup( char *nick ) 256 { 257 char *cp; 258 259 cp = g_new0 ( char, MAX_NICK_LENGTH + 1 ); 260 strncpy( cp, nick, MAX_NICK_LENGTH ); 261 262 return( cp ); 263 } -
nick.h
r1aa0bb5 rb8ef1b1 32 32 } nick_t; 33 33 34 void nick_set( irc_t *irc, c onst char *handle, int proto, constchar *nick );35 char *nick_get( irc_t *irc, c onst char *handle, int proto, const char *realname );36 void nick_del( irc_t *irc, c onst char *nick );34 void nick_set( irc_t *irc, char *handle, int proto, char *nick ); 35 char *nick_get( irc_t *irc, char *handle, int proto, const char *realname ); 36 void nick_del( irc_t *irc, char *nick ); 37 37 void nick_strip( char *nick ); 38 38 39 int nick_ok( c onst char *nick );39 int nick_ok( char *nick ); 40 40 int nick_lc( char *nick ); 41 41 int nick_uc( char *nick ); 42 int nick_cmp( c onst char *a, constchar *b );43 char *nick_dup( c onst char *nick );42 int nick_cmp( char *a, char *b ); 43 char *nick_dup( char *nick ); -
protocols/proxy.c
r1aa0bb5 rb8ef1b1 50 50 #define GAIM_ERR_COND (G_IO_HUP | G_IO_ERR | G_IO_NVAL) 51 51 52 /*FIXME* 53 #ifndef _WIN32 54 if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len) < 0) { 55 closesocket(fd); 56 g_free(phb); 57 return -1; 58 } 59 fcntl(fd, F_SETFL, 0); 60 #endif*/ 61 52 62 char proxyhost[128] = ""; 53 63 int proxyport = 0; … … 73 83 74 84 75 static struct sockaddr_in *gaim_gethostbyname(c onst char *host, int port)85 static struct sockaddr_in *gaim_gethostbyname(char *host, int port) 76 86 { 77 87 static struct sockaddr_in sin; … … 144 154 } 145 155 146 static int proxy_connect_none(c onst char *host, unsigned short port, struct PHB *phb)156 static int proxy_connect_none(char *host, unsigned short port, struct PHB *phb) 147 157 { 148 158 struct sockaddr_in *sin; … … 271 281 } 272 282 273 static int proxy_connect_http(c onst char *host, unsigned short port, struct PHB *phb)283 static int proxy_connect_http(char *host, unsigned short port, struct PHB *phb) 274 284 { 275 285 phb->host = g_strdup(host); … … 355 365 } 356 366 357 static int proxy_connect_socks4(c onst char *host, unsigned short port, struct PHB *phb)367 static int proxy_connect_socks4(char *host, unsigned short port, struct PHB *phb) 358 368 { 359 369 phb->host = g_strdup(host); … … 537 547 } 538 548 539 static int proxy_connect_socks5(c onst char *host, unsigned short port, struct PHB *phb)549 static int proxy_connect_socks5(char *host, unsigned short port, struct PHB *phb) 540 550 { 541 551 phb->host = g_strdup(host); … … 578 588 } 579 589 580 int proxy_connect(c onst char *host, int port, GaimInputFunction func, gpointer data)590 int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data) 581 591 { 582 592 struct PHB *phb; -
protocols/proxy.h
r1aa0bb5 rb8ef1b1 56 56 G_MODULE_EXPORT void gaim_input_remove(gint); 57 57 58 G_MODULE_EXPORT int proxy_connect(c onst char *host, int port, GaimInputFunction func, gpointer data);58 G_MODULE_EXPORT int proxy_connect(char *host, int port, GaimInputFunction func, gpointer data); 59 59 60 60 #endif /* _PROXY_H_ */ -
unix.c
r1aa0bb5 rb8ef1b1 52 52 53 53 global.helpfile = g_strdup( HELP_FILE ); 54 54 55 55 global.conf = conf_load( argc, argv ); 56 56 if( global.conf == NULL ) 57 57 return( 1 ); 58 59 58 60 59 if( global.conf->runmode == RUNMODE_INETD ) 61 60 { … … 71 70 if( i != 0 ) 72 71 return( i ); 73 74 global.storage = storage_init( global.conf->storage );75 if ( global.storage == NULL) {76 log_message( LOGLVL_ERROR, "No such storage backend '%s'", global.conf->storage );77 return( 1 );78 }79 80 72 81 73 /* Catch some signals to tell the user what's happening before quitting */ … … 95 87 if( !getuid() || !geteuid() ) 96 88 log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); 89 if( access( global.conf->configdir, F_OK ) != 0 ) 90 log_message( LOGLVL_WARNING, "The configuration directory %s does not exist. Configuration won't be saved.", CONFIG ); 91 else if( access( global.conf->configdir, R_OK ) != 0 || access( global.conf->configdir, W_OK ) != 0 ) 92 log_message( LOGLVL_WARNING, "Permission problem: Can't read/write from/to %s.", global.conf->configdir ); 97 93 if( help_init( &(global.help) ) == NULL ) 98 94 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE );
Note: See TracChangeset
for help on using the changeset viewer.