Gentoo Archives: gentoo-dev

From: Marko Mikulicic <marko@××××.org>
To: gentoo-dev@g.o
Subject: [gentoo-dev] ntop, msql & allow_severity tcpwrappers
Date: Wed, 10 Jul 2002 18:09:06
Message-Id: 3D2D115D.8000606@seul.org
1 Hello,
2
3 I have noticed something strange in the handling of tcpwrapper's
4 global variables "allow_severity" and "deny_severity".
5
6 I'm using gcc 2.95.3.
7
8 The tcp_wrappers library requires the main program to define
9 those symbols. The ntop package, for example, declares the variables in
10 an include file, and never initializes them.
11 I have changed the code to conditionally initialize the variables
12 and it compiles fine. (this should fix bug #4678).
13
14 However I would like to look deeply in the problem.
15 I don't understand why those symbols are required to be initialized.
16 Declared symbols should be marked as "C" (common) on compilation
17 and promoted to "B" (bss uninitialized). I tried with test programs
18 and also linking libwrap.a, the variables are marked "B" by nm.
19
20 The only reference to allow_severity in ntop is in "globals.h" file
21 and is *not* marked as extern. In tcp_wrappers is marked as extern.
22
23 I cannot regenerate the problem with a simpler program, it
24 always correctly resolves the non extern multiple declaration
25 in bss unitialized symbol.
26
27 Does anyone know why is this happening, and why this
28 thing does obviously not happen to the ntop and mysql developers ?
29
30 Marko