Package: bip
Version: 0.7.0-1
Severity: normal
Tags: patch
when you have a user with no default nick/user/realname, even if all
connections have one defined, bip quits with the simple message
'FATAL: Not starting: error in config file.'
The patch fixes the check, and adds a log message.
There is also an invalid check for whether ssl_check_mode has been
defined : the legal value "none" is treated as if the option was
not specified, and bip quits.
The patch removes this check, which may not be the best solution (maybe
change SSL_CHECK_NONE to something != 0)
Not in patch:
The -s option is not documented, and should supersede the $HOME
environment value.
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.21.1-grsec
Locale: LANG=C, LC_CTYPE=fr_FR (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to
C)
Shell: /bin/sh linked to /bin/bash
Versions of packages bip depends on:
ii adduser 3.107 add and remove users and groups
ii libc6 2.7-10 GNU C Library: Shared libraries
ii libssl0.9.8 0.9.8g-8 SSL shared libraries
ii lsb-base 3.2-6 Linux Standard Base 3.2 init scrip
bip recommends no packages.
-- no debconf information
Only in bip-0.7.0-patch: Makefile
Only in bip-0.7.0-patch: config.log
Only in bip-0.7.0-patch: config.status
Only in bip-0.7.0-patch/samples: Makefile
Only in bip-0.7.0-patch/src: .bip.c.swp
Only in bip-0.7.0-patch/src: .deps
Only in bip-0.7.0-patch/src: Makefile
diff -r -u bip-0.7.0/src/bip.c bip-0.7.0-patch/src/bip.c
--- bip-0.7.0/src/bip.c 2008-02-16 11:24:34.000000000 +0100
+++ bip-0.7.0-patch/src/bip.c 2008-04-02 17:14:42.000000000 +0200
@@ -565,6 +565,8 @@
l->ssl_check_mode = SSL_CHECK_BASIC;
if (strcmp(t->pdata, "ca") == 0)
l->ssl_check_mode = SSL_CHECK_CA;
+ if (strcmp(t->pdata, "none") == 0)
+ l->ssl_check_mode = SSL_CHECK_NONE;
break;
#else
case LEX_SSL_CHECK_MODE:
@@ -744,10 +746,12 @@
break;
#ifdef HAVE_LIBSSL
case LEX_SSL_CHECK_MODE:
- if (!strncmp(t->pdata, "basic", 5))
+ if (!strcmp(t->pdata, "basic"))
u->ssl_check_mode = SSL_CHECK_BASIC;
- if (!strncmp(t->pdata, "ca", 2))
+ if (!strcmp(t->pdata, "ca"))
u->ssl_check_mode = SSL_CHECK_CA;
+ if (!strcmp(t->pdata, "none"))
+ u->ssl_check_mode = SSL_CHECK_NONE;
free(t->pdata);
t->pdata = NULL;
break;
@@ -800,44 +804,38 @@
for (hash_it_init(&bip->users, &it); (user = hash_it_item(&it));
hash_it_next(&it)) {
- if (!user->default_nick || !user->default_username ||
- !user->default_realname) {
- for (hash_it_init(&user->connections, &sit);
- (link = hash_it_item(&sit));
- hash_it_next(&sit)) {
+ for (hash_it_init(&user->connections, &sit);
+ (link = hash_it_item(&sit));
+ hash_it_next(&sit)) {
+ if (!user->default_nick || !user->default_username ||
+ !user->default_realname) {
if ((!link->username &&
!user->default_username) ||
(!link->connect_nick &&
!user->default_nick) ||
(!link->realname &&
- !user->default_realname))
+ !user->default_realname)) {
+ conf_die(bip, "user %s, "
+ "connection %s: you must defin"
+ "e nick, user and realname.",
+ user->name, link->name);
link_kill(bip, link);
+ r = 0;
+ }
+ }
-#ifdef HAVE_LIBSSL
- if (link->network->ssl &&
- !link->ssl_check_mode) {
- conf_die(bip, "user %s, "
- "connection %s: you should "
- "define a ssl_check_mode.",
- user->name, link->name);
- return 0;
- }
-#endif
-
- r = 0;
-
- for (hash_it_init(&link->chan_infos, &cit);
- (ci = hash_it_item(&cit));
- hash_it_next(&cit)) {
- if (!ci->name) {
- conf_die(bip, "user %s, "
- "connection "
- "%s: channel must have"
- "a name.", user->name,
- link->name);
- return 0;
- }
- }
+// SSL_CHECK_NONE is 0
+ for (hash_it_init(&link->chan_infos, &cit);
+ (ci = hash_it_item(&cit));
+ hash_it_next(&cit)) {
+ if (!ci->name) {
+ conf_die(bip, "user %s, "
+ "connection "
+ "%s: channel must have"
+ "a name.", user->name,
+ link->name);
+ return 0;
+ }
}
}
@@ -1194,6 +1192,7 @@
check_rlimits();
+ // XXX jj: home VS conf_biphome..
home = getenv("HOME");
if (!home) {
conf_die(&bip, "no $HOME !, do you live in a trailer ?");
Only in bip-0.7.0-patch/src: conf.c
Only in bip-0.7.0-patch/src: conf.h
Only in bip-0.7.0-patch/src: config.h
Only in bip-0.7.0-patch/src: lex.c
Only in bip-0.7.0-patch/src: stamp-h1