[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torsocks/osx] Fix 'symbol res_send() was not found in any shared library'



commit 441fb10e475efa3cf9977fcf223db8344b005555
Author: Robert Hogan <robert@xxxxxxxxxxxxxxx>
Date:   Sun Feb 13 12:41:23 2011 +0000

    Fix 'symbol res_send() was not found in any shared library'
    
    Solution found by Nicolas Pouillard (nicolas.pouillard@xxxxxxxxx).
    However I am still not clear why this is necessary for just this
    symbol on Linux.
    
    To test that it works:
     cd test/
     gcc -fPIC  -g -O2 -Wall -I. -o resinit resinit.c -lc -lresolv
     cd ..
     export TORSOCKS_DEBUG=2
     torsocks test/resinit
    Expected result:
     12:45:33 libtorsocks(21307): Got res_send request
    
    http://code.google.com/p/torsocks/issues/detail?id=3
---
 src/expansion_table.h |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/src/expansion_table.h b/src/expansion_table.h
index 441a009..e981f5d 100644
--- a/src/expansion_table.h
+++ b/src/expansion_table.h
@@ -1,6 +1,6 @@
 /***************************************************************************
  *                                                                         *
- *   Copyright (C) 2010 alex@xxxxxxxxxxxxx                                 *
+ *   Copyright (C) 2010 Alex Rosenberg <alex@xxxxxxxxxxxxx>                *
  *   Copyright (C) 2011 Robert Hogan <robert@xxxxxxxxxxxxxxx>              *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -76,7 +76,12 @@
 /*RES_FUNC  (ERR,    int,                RES_INIT_,          res_init,                      res_init,            "res_init") */
 RES_FUNC    (ERR,    int,                RES_QUERY_,         res_query,                     res_query,           "res_query")
 RES_FUNC    (ERR,    int,                RES_SEARCH_,        res_search,                    res_search,          "res_search")
+#if defined(__APPLE__) || defined(__darwin__)
 RES_FUNC    (ERR,    int,                RES_SEND_,          res_send,                      res_send,            "res_send")
+#else
+/* It is a bit of a mystery why this is required on Linux. See http://code.google.com/p/torsocks/issues/detail?id=3 */
+RES_FUNC    (ERR,    int,                RES_SEND_,          res_send,                      res_send,            "__res_send")
+#endif
 RES_FUNC    (ERR,    int,                RES_QUERYDOMAIN_,   res_querydomain,               res_querydomain,     "res_querydomain")
 
 DNS_FUNC    (ERR,    struct hostent *,   GETHOSTBYNAME_,     gethostbyname,                 gethostbyname,       "gethostbyname")



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits