tags 134729 + patch tags 278906 + patch thanks Hello,
Please find enclosed a possible patch for these bugs. The "tsocks" preload library exports functions which are *not* functions which it is trying to override. The enclosed patch prevents this from happening. I got the idea for this patch from the write up of Ulrich Drepper on shared libraries under http://people.redhat.com/~drepper/. As far as I can see the library works with these patches and does not exhibit the bugs. Regards, Kapil. --
diff -u tsocks-1.8beta5/debian/changelog tsocks-1.8beta5/debian/changelog
--- tsocks-1.8beta5/debian/changelog
+++ tsocks-1.8beta5/debian/changelog
@@ -1,3 +1,15 @@
+tsocks (1.8beta5-3.1) unstable; urgency=low
+
+ * NMU
+ * parser.c: added visibility "hidden" attribute to functions
+ read_config, is_local, pick_server and strsplit.
+ Closes: #134729,#278906.
+ * common.c: added visibility "hidden" attribute to functions
+ resolve_ip, set_log_options and show_msg. This prevents
+ bugs like those above recurring.
+
+ -- Kapil Hari Paranjape <[EMAIL PROTECTED]> Thu, 19 Oct 2006 17:23:44 +0530
+
tsocks (1.8beta5-3) unstable; urgency=low
* TSOCKS_CONFFILE -> TSOCKS_CONF_FILE manpage bug (closes: #311805)
only in patch2:
unchanged:
--- tsocks-1.8beta5.orig/common.c
+++ tsocks-1.8beta5/common.c
@@ -25,7 +25,8 @@
FILE *logfile = NULL; /* File to which messages should be logged */
int logstamp = 0; /* Timestamp (and pid stamp) messages */
-unsigned int resolve_ip(char *host, int showmsg, int allownames) {
+unsigned int __attribute__ ((visibility ("hidden")))
+resolve_ip(char *host, int showmsg, int allownames) {
struct hostent *new;
unsigned int hostaddr;
struct in_addr *ip;
@@ -64,7 +65,8 @@
/* be logged instead of to standard error */
/* timestamp - This indicates that messages should be prefixed */
/* with timestamps (and the process id) */
-void set_log_options(int level, char *filename, int timestamp) {
+void __attribute__ ((visibility ("hidden")))
+set_log_options(int level, char *filename, int timestamp) {
loglevel = level;
if (loglevel < MSGERR)
@@ -78,7 +80,8 @@
logstamp = timestamp;
}
-void show_msg(int level, char *fmt, ...) {
+void __attribute__ ((visibility ("hidden")))
+show_msg(int level, char *fmt, ...) {
va_list ap;
int saveerr;
extern char *progname;
only in patch2:
unchanged:
--- tsocks-1.8beta5.orig/parser.c
+++ tsocks-1.8beta5/parser.c
@@ -33,7 +33,8 @@
static int handle_defpass(struct parsedfile *, int, char *);
static int make_netent(char *value, struct netent **ent);
-int read_config (char *filename, struct parsedfile *config) {
+int __attribute__ ((visibility ("hidden")))
+read_config (char *filename, struct parsedfile *config) {
FILE *conf;
char line[MAXLINE];
int rc = 0;
@@ -577,7 +578,8 @@
return(0);
}
-int is_local(struct parsedfile *config, struct in_addr *testip) {
+int __attribute__ ((visibility ("hidden")))
+is_local(struct parsedfile *config, struct in_addr *testip) {
struct netent *ent;
for (ent = (config->localnets); ent != NULL; ent = ent -> next) {
@@ -591,7 +593,8 @@
}
/* Find the appropriate server to reach an ip */
-int pick_server(struct parsedfile *config, struct serverent **ent,
+int __attribute__ ((visibility ("hidden")))
+pick_server(struct parsedfile *config, struct serverent **ent,
struct in_addr *ip, unsigned int port) {
struct netent *net;
char ipbuf[64];
@@ -635,7 +638,8 @@
/* the start pointer is set to be NULL. The difference between */
/* standard strsep and this function is that this one will */
/* set *separator to the character separator found if it isn't null */
-char *strsplit(char *separator, char **text, const char *search) {
+char __attribute__ ((visibility ("hidden")))
+*strsplit(char *separator, char **text, const char *search) {
int len;
char *ret;
signature.asc
Description: Digital signature

