[tor-commits] [tor/master] Merge remote branch 'origin/maint-0.2.2'

2011-02-22 Thread nickm
commit 933ffd536daf5b00e1ddcb517b2e4e73f2bcb286
Merge: ce4f879 613073e
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 12:47:47 2011 -0500

Merge remote branch 'origin/maint-0.2.2'

 changes/bug2504 |5 +
 src/common/compat.c |2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --combined src/common/compat.c
index 1b103e9,d29cacf..8e022dc
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@@ -101,35 -101,6 +101,35 @@@
  #include strlcat.c
  #endif
  
 +/** As open(path, flags, mode), but return an fd with the close-on-exec mode
 + * set. */
 +int
 +tor_open_cloexec(const char *path, int flags, unsigned mode)
 +{
 +#ifdef O_CLOEXEC
 +  return open(path, flags|O_CLOEXEC, mode);
 +#else
 +  int fd = open(path, flags, mode);
 +#ifdef FD_CLOEXEC
 +  if (fd = 0)
 +fcntl(fd, F_SETFD, FD_CLOEXEC);
 +#endif
 +  return fd;
 +#endif
 +}
 +
 +/** DOCDOC */
 +FILE *
 +tor_fopen_cloexec(const char *path, const char *mode)
 +{
 +  FILE *result = fopen(path, mode);
 +#ifdef FD_CLOEXEC
 +  if (result != NULL)
 +fcntl(fileno(result), F_SETFD, FD_CLOEXEC);
 +#endif
 +  return result;
 +}
 +
  #ifdef HAVE_SYS_MMAN_H
  /** Try to create a memory mapping for bfilename/b and return it.  On
   * failure, return NULL.  Sets errno properly, using ERANGE to mean
@@@ -145,7 -116,7 +145,7 @@@ tor_mmap_file(const char *filename
  
tor_assert(filename);
  
 -  fd = open(filename, O_RDONLY, 0);
 +  fd = tor_open_cloexec(filename, O_RDONLY, 0);
if (fd0) {
  int save_errno = errno;
  int severity = (errno == ENOENT) ? LOG_INFO : LOG_WARN;
@@@ -718,7 -689,7 +718,7 @@@ tor_lockfile_lock(const char *filename
*locked_out = 0;
  
log_info(LD_FS, Locking \%s\, filename);
 -  fd = open(filename, O_RDWR|O_CREAT|O_TRUNC, 0600);
 +  fd = tor_open_cloexec(filename, O_RDWR|O_CREAT|O_TRUNC, 0600);
if (fd  0) {
  log_warn(LD_FS,Couldn't open \%s\ for locking: %s, filename,
   strerror(errno));
@@@ -728,7 -699,7 +728,7 @@@
  #ifdef WIN32
_lseek(fd, 0, SEEK_SET);
if (_locking(fd, blocking ? _LK_LOCK : _LK_NBLCK, 1)  0) {
- if (errno != EACCESS  errno != EDEADLOCK)
+ if (errno != EACCES  errno != EDEADLOCK)
log_warn(LD_FS,Couldn't lock \%s\: %s, filename, strerror(errno));
  else
*locked_out = 1;
@@@ -937,16 -908,8 +937,16 @@@ mark_socket_open(int s
  int
  tor_open_socket(int domain, int type, int protocol)
  {
 -  int s = socket(domain, type, protocol);
 +  int s;
 +#ifdef SOCK_CLOEXEC
 +#define LINUX_CLOEXEC_OPEN_SOCKET
 +  type |= SOCK_CLOEXEC;
 +#endif
 +  s = socket(domain, type, protocol);
if (s = 0) {
 +#if !defined(LINUX_CLOEXEC_OPEN_SOCKET)  defined(FD_CLOEXEC)
 +fcntl(s, F_SETFD, FD_CLOEXEC);
 +#endif
  socket_accounting_lock();
  ++n_sockets_open;
  mark_socket_open(s);
@@@ -959,17 -922,8 +959,17 @@@
  int
  tor_accept_socket(int sockfd, struct sockaddr *addr, socklen_t *len)
  {
 -  int s = accept(sockfd, addr, len);
 +  int s;
 +#if defined(HAVE_ACCEPT4)  defined(SOCK_CLOEXEC)
 +#define LINUX_CLOEXEC_ACCEPT
 +  s = accept4(sockfd, addr, len, SOCK_CLOEXEC);
 +#else
 +  s = accept(sockfd, addr, len);
 +#endif
if (s = 0) {
 +#if !defined(LINUX_CLOEXEC_ACCEPT)  defined(FD_CLOEXEC)
 +fcntl(s, F_SETFD, FD_CLOEXEC);
 +#endif
  socket_accounting_lock();
  ++n_sockets_open;
  mark_socket_open(s);
@@@ -1025,17 -979,8 +1025,17 @@@ tor_socketpair(int family, int type, in
  //don't use win32 socketpairs (they are always bad)
  #if defined(HAVE_SOCKETPAIR)  !defined(MS_WINDOWS)
int r;
 +#ifdef SOCK_CLOEXEC
 +  type |= SOCK_CLOEXEC;
 +#endif
r = socketpair(family, type, protocol, fd);
if (r == 0) {
 +#if !defined(SOCK_CLOEXEC)  defined(FD_CLOEXEC)
 +if (fd[0] = 0)
 +  fcntl(fd[0], F_SETFD, FD_CLOEXEC);
 +if (fd[1] = 0)
 +  fcntl(fd[1], F_SETFD, FD_CLOEXEC);
 +#endif
  socket_accounting_lock();
  if (fd[0] = 0) {
++n_sockets_open;
@@@ -1981,52 -1926,6 +1981,52 @@@ spawn_exit(void
  #endif
  }
  
 +/** Implementation logic for compute_num_cpus(). */
 +static int
 +compute_num_cpus_impl(void)
 +{
 +#ifdef MS_WINDOWS
 +  SYSTEM_INFO info;
 +  memset(info, 0, sizeof(info));
 +  GetSystemInfo(info);
 +  if (info.dwNumberOfProcessors = 1  info.dwNumberOfProcessors  INT_MAX)
 +return (int)info.dwNumberOfProcessors;
 +  else
 +return -1;
 +#elif defined(HAVE_SYSCONF)  defined(_SC_NPROCESSORS_CONF)
 +  long cpus = sysconf(_SC_NPROCESSORS_CONF);
 +  if (cpus = 1  cpus  INT_MAX)
 +return (int)cpus;
 +  else
 +return -1;
 +#else
 +  return -1;
 +#endif
 +}
 +
 +#define MAX_DETECTABLE_CPUS 16
 +
 +/** Return how many CPUs we are running with.  We assume that nobody is
 + * using hot-swappable CPUs, so we don't recompute this after the first
 + * time.  Return -1 if we don't know how to tell the number of CPUs on this
 + * system.
 + */
 +int
 +compute_num_cpus(void)
 +{
 +  static int num_cpus = -2;
 +  if (num_cpus == -2) {
 +

[tor-commits] [tor/maint-0.2.2] Add manpage entry for logging domains

2011-02-22 Thread nickm
commit 23f8bedddb1b3497ea8bbafef90ae24893be9a9e
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Jan 25 15:02:36 2011 -0500

Add manpage entry for logging domains

Fixes issue 2215.
---
 changes/log_domains |5 +
 doc/tor.1.txt   |   23 +++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/changes/log_domains b/changes/log_domains
new file mode 100644
index 000..f4cfe6f
--- /dev/null
+++ b/changes/log_domains
@@ -0,0 +1,5 @@
+  o Documentation
+
+- Add documentation for configuring logging at different severities in
+  different log domains.  We've had this feature since 0.2.1.1-alpha, but
+  for some reason it never made it into the manpage.  Fixes bug 2215.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index c8608eb..9a7ee07 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -323,6 +323,29 @@ Other options can be specified either on the command-line 
(--option
 Messages are sent to all the logs that match their severity
 level.
 
+**Log** **[**__domain__,...**]**__minSeverity__[-__maxSeverity__] ... **file** 
__FILENAME__ +
+
+**Log** **[**__domain__,...**]**__minSeverity__[-__maxSeverity__] ... 
**stderr**|**stdout**|**syslog** ::
+As above, but select messages by range of log severity __and__ by a
+set of logging domains.  Each logging domain corresponds to an area of
+functionality inside Tor.  You can specify any number of severity ranges
+for a single log statement, each of them prefixed by a comma-separated
+list of logging domains.  You can prefix a domain with ~ to indicate
+negation, and use * to indicate all domains.  If you specify a severity
+range without a list of domains, it matches all domains. +
+ +
+This is an advanced feature which is most useful for debugging one or two
+of Tor's subsystems at a time. +
+ +
+The currently recognized domains are: general, crypto, net, config, fs,
+protocol, mm, http, app, control, circ, rend, bug, dir, dirserv, or, edge,
+acct, hist, and handshake.  Domain names are case-insensitive. +
+ +
+For example, `Log [handshake]debug [*,~net,~mm]info notice stdout` sends
+to stdout: all handshake messages of any severity, all info-and-higher
+messages from domains other than networking and memory management, and all
+messages of severity notice or higher.
+
 **OutboundBindAddress** __IP__::
 Make all outbound connections originate from the IP address specified. This
 is only useful when you have multiple network interfaces, and you want all



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


[tor-commits] [tor/master] Add manpage entry for logging domains

2011-02-22 Thread nickm
commit 23f8bedddb1b3497ea8bbafef90ae24893be9a9e
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Jan 25 15:02:36 2011 -0500

Add manpage entry for logging domains

Fixes issue 2215.
---
 changes/log_domains |5 +
 doc/tor.1.txt   |   23 +++
 2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/changes/log_domains b/changes/log_domains
new file mode 100644
index 000..f4cfe6f
--- /dev/null
+++ b/changes/log_domains
@@ -0,0 +1,5 @@
+  o Documentation
+
+- Add documentation for configuring logging at different severities in
+  different log domains.  We've had this feature since 0.2.1.1-alpha, but
+  for some reason it never made it into the manpage.  Fixes bug 2215.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index c8608eb..9a7ee07 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -323,6 +323,29 @@ Other options can be specified either on the command-line 
(--option
 Messages are sent to all the logs that match their severity
 level.
 
+**Log** **[**__domain__,...**]**__minSeverity__[-__maxSeverity__] ... **file** 
__FILENAME__ +
+
+**Log** **[**__domain__,...**]**__minSeverity__[-__maxSeverity__] ... 
**stderr**|**stdout**|**syslog** ::
+As above, but select messages by range of log severity __and__ by a
+set of logging domains.  Each logging domain corresponds to an area of
+functionality inside Tor.  You can specify any number of severity ranges
+for a single log statement, each of them prefixed by a comma-separated
+list of logging domains.  You can prefix a domain with ~ to indicate
+negation, and use * to indicate all domains.  If you specify a severity
+range without a list of domains, it matches all domains. +
+ +
+This is an advanced feature which is most useful for debugging one or two
+of Tor's subsystems at a time. +
+ +
+The currently recognized domains are: general, crypto, net, config, fs,
+protocol, mm, http, app, control, circ, rend, bug, dir, dirserv, or, edge,
+acct, hist, and handshake.  Domain names are case-insensitive. +
+ +
+For example, `Log [handshake]debug [*,~net,~mm]info notice stdout` sends
+to stdout: all handshake messages of any severity, all info-and-higher
+messages from domains other than networking and memory management, and all
+messages of severity notice or higher.
+
 **OutboundBindAddress** __IP__::
 Make all outbound connections originate from the IP address specified. This
 is only useful when you have multiple network interfaces, and you want all



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


[tor-commits] [tor/master] Simplify syntax for negated log domains

2011-02-22 Thread nickm
commit e261a1a3e6513eeafa1b53b83ebfec7f5d834a39
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Jan 25 15:03:36 2011 -0500

Simplify syntax for negated log domains

Previously if you wanted to say All messages except network
messages, you needed to say [*,~net] and if you said [~net] by
mistake, you would get no messages at all.  Now, if you say [~net],
you get everything except networking messages.
---
 changes/log_domains |6 +-
 doc/tor.1.txt   |2 +-
 src/common/log.c|5 -
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/changes/log_domains b/changes/log_domains
index f4cfe6f..939b9a9 100644
--- a/changes/log_domains
+++ b/changes/log_domains
@@ -1,5 +1,9 @@
-  o Documentation
+  o Minor features
+- Make it simpler to specify All log domains except for A and B.
+  Previously you needed to say [*,~A,~B].  Now you can just say
+  [~A,~B].
 
+  o Documentation
 - Add documentation for configuring logging at different severities in
   different log domains.  We've had this feature since 0.2.1.1-alpha, but
   for some reason it never made it into the manpage.  Fixes bug 2215.
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 9a7ee07..17cdf37 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -341,7 +341,7 @@ Other options can be specified either on the command-line 
(--option
 protocol, mm, http, app, control, circ, rend, bug, dir, dirserv, or, edge,
 acct, hist, and handshake.  Domain names are case-insensitive. +
  +
-For example, `Log [handshake]debug [*,~net,~mm]info notice stdout` sends
+For example, `Log [handshake]debug [~net,~mm]info notice stdout` sends
 to stdout: all handshake messages of any severity, all info-and-higher
 messages from domains other than networking and memory management, and all
 messages of severity notice or higher.
diff --git a/src/common/log.c b/src/common/log.c
index 2fef2cc..28fca4e 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -919,7 +919,10 @@ parse_log_severity_config(const char **cfg_ptr,
   smartlist_free(domains_list);
   if (err)
 return -1;
-  domains = ~neg_domains;
+  if (domains == 0  neg_domains)
+domains = ~neg_domains;
+  else
+domains = ~neg_domains;
   cfg = eat_whitespace(closebracket+1);
 } else {
   ++got_an_unqualified_range;



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


[tor-commits] [tor/master] Thou shalt not overflow even stupidly small buffers

2011-02-22 Thread nickm
commit 0ab8b7c0f22bd45d7108ce0185e027cd8e469593
Author: Robert Ransom rransom.8...@gmail.com
Date:   Fri Feb 4 05:50:44 2011 -0800

Thou shalt not overflow even stupidly small buffers
---
 src/common/log.c |   10 ++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/common/log.c b/src/common/log.c
index f58b05b..4b21fd9 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -223,21 +223,31 @@ format_msg(char *buf, size_t buf_len,
   size_t n;
   int r;
   char *end_of_prefix;
+  char *buf_end;
 
   assert(buf_len = 16); /* prevent integer underflow and general stupidity */
   buf_len -= 2; /* subtract 2 characters so we have room for \n\0 */
+  buf_end = buf+buf_len; /* point *after* the last char we can write to */
 
   n = _log_prefix(buf, buf_len, severity);
   end_of_prefix = buf+n;
 
   if (log_domains_are_logged) {
 char *cp = buf+n;
+if (cp == buf_end) goto format_msg_no_room_for_domains;
 *cp++ = '{';
+if (cp == buf_end) goto format_msg_no_room_for_domains;
 cp = domain_to_string(domain, cp, (buf+buf_len-cp));
+if (cp == buf_end) goto format_msg_no_room_for_domains;
 *cp++ = '}';
+if (cp == buf_end) goto format_msg_no_room_for_domains;
 *cp++ = ' ';
+if (cp == buf_end) goto format_msg_no_room_for_domains;
 end_of_prefix = cp;
 n = cp-buf;
+  format_msg_no_room_for_domains:
+/* This will leave end_of_prefix and n unchanged, and thus cause
+ * whatever log domain string we had written to be clobbered. */
   }
 
   if (funcname  should_log_function_name(domain, severity)) {



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


[tor-commits] [tor/master] That shalt also not have a label without a statement.

2011-02-22 Thread nickm
commit ce149c10227bd4d65bfa62898e729430981328c1
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 12:52:52 2011 -0500

That shalt also not have a label without a statement.
---
 src/common/log.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/common/log.c b/src/common/log.c
index 4b21fd9..cfa0721 100644
--- a/src/common/log.c
+++ b/src/common/log.c
@@ -248,6 +248,7 @@ format_msg(char *buf, size_t buf_len,
   format_msg_no_room_for_domains:
 /* This will leave end_of_prefix and n unchanged, and thus cause
  * whatever log domain string we had written to be clobbered. */
+;
   }
 
   if (funcname  should_log_function_name(domain, severity)) {



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


[tor-commits] [tor/master] Merge remote branch 'origin/maint-0.2.2'

2011-02-22 Thread nickm
commit b7f201f74606aff1f77551449bebe8783a59733a
Merge: 46b0746 cdc59c1
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 14:10:42 2011 -0500

Merge remote branch 'origin/maint-0.2.2'

Conflicts:
src/or/policies.c
src/or/policies.h

 changes/bug2366   |8 
 src/or/policies.c |8 
 src/or/policies.h |1 +
 src/or/router.c   |   15 +--
 4 files changed, 26 insertions(+), 6 deletions(-)

diff --combined src/or/policies.c
index d0406d3,38c2f7c..2cf9982
--- a/src/or/policies.c
+++ b/src/or/policies.c
@@@ -11,7 -11,6 +11,7 @@@
  #include or.h
  #include config.h
  #include dirserv.h
 +#include nodelist.h
  #include policies.h
  #include routerparse.h
  #include ht.h
@@@ -262,7 -261,7 +262,7 @@@ fascist_firewall_allows_address_or(cons
  /** Return true iff we think our firewall will let us make an OR connection to
   * bri/b. */
  int
 -fascist_firewall_allows_or(routerinfo_t *ri)
 +fascist_firewall_allows_or(const routerinfo_t *ri)
  {
/*  proposal 118 */
tor_addr_t addr;
@@@ -270,22 -269,6 +270,22 @@@
return fascist_firewall_allows_address_or(addr, ri-or_port);
  }
  
 +/** Return true iff we think our firewall will let us make an OR connection to
 + * bnode/b. */
 +int
 +fascist_firewall_allows_node(const node_t *node)
 +{
 +  if (node-ri) {
 +return fascist_firewall_allows_or(node-ri);
 +  } else if (node-rs) {
 +tor_addr_t addr;
 +tor_addr_from_ipv4h(addr, node-rs-addr);
 +return fascist_firewall_allows_address_or(addr, node-rs-or_port);
 +  } else {
 +return 1;
 +  }
 +}
 +
  /** Return true iff we think our firewall will let us make a directory
   * connection to addr:port. */
  int
@@@ -875,11 -858,23 +875,19 @@@ policies_parse_exit_policy(config_line_
return 0;
  }
  
+ /** Add reject *:* to the end of the policy in *bdest/b, allocating
+  * *bdest/b as needed. */
+ void
+ policies_exit_policy_append_reject_star(smartlist_t **dest)
+ {
+   append_exit_policy_string(dest, reject *:*);
+ }
+ 
 -/** Replace the exit policy of br/b with reject *:*. */
 +/** Replace the exit policy of bnode/b with reject *:* */
  void
 -policies_set_router_exitpolicy_to_reject_all(routerinfo_t *r)
 +policies_set_node_exitpolicy_to_reject_all(node_t *node)
  {
 -  addr_policy_t *item;
 -  addr_policy_list_free(r-exit_policy);
 -  r-exit_policy = smartlist_create();
 -  item = router_parse_addr_policy_item_from_string(reject *:*, -1);
 -  smartlist_add(r-exit_policy, item);
 +  node-rejects_all = 1;
  }
  
  /** Return 1 if there is at least one /8 subnet in bpolicy/b that
@@@ -1088,7 -1083,7 +1096,7 @@@ policy_summary_split(smartlist_t *summa
int start_at_index;
  
int i = 0;
 -  /*  Do a binary search if run time matters */
 +
while (AT(i)-prt_max  prt_min)
  i++;
if (AT(i)-prt_min != prt_min) {
@@@ -1301,195 -1296,6 +1309,195 @@@ policy_summarize(smartlist_t *policy
return result;
  }
  
 +/** Convert a summarized policy string into a short_policy_t.  Return NULL
 + * if the string is not well-formed. */
 +short_policy_t *
 +parse_short_policy(const char *summary)
 +{
 +  const char *orig_summary = summary;
 +  short_policy_t *result;
 +  int is_accept;
 +  int n_entries;
 +  short_policy_entry_t entries[MAX_EXITPOLICY_SUMMARY_LEN]; /* overkill */
 +  const char *next;
 +
 +  if (!strcmpstart(summary, accept )) {
 +is_accept = 1;
 +summary += strlen(accept );
 +  } else if (!strcmpstart(summary, reject )) {
 +is_accept = 0;
 +summary += strlen(reject );
 +  } else {
 +log_fn(LOG_PROTOCOL_WARN, LD_DIR, Unrecognized policy summary keyword);
 +return NULL;
 +  }
 +
 +  n_entries = 0;
 +  for ( ; *summary; summary = next) {
 +const char *comma = strchr(summary, ',');
 +unsigned low, high;
 +char dummy;
 +char ent_buf[32];
 +
 +next = comma ? comma+1 : strchr(summary, '\0');
 +
 +if (n_entries == MAX_EXITPOLICY_SUMMARY_LEN) {
 +  log_fn(LOG_PROTOCOL_WARN, LD_DIR, Impossibly long policy summary %s,
 + escaped(orig_summary));
 +  return NULL;
 +}
 +
 +if (! TOR_ISDIGIT(*summary) || next-summary  (int)(sizeof(ent_buf)-1)) {
 +  /* unrecognized entry format. skip it. */
 +  continue;
 +}
 +if (next-summary  2) {
 +  /* empty; skip it. */
 +  continue;
 +}
 +
 +memcpy(ent_buf, summary, next-summary-1);
 +ent_buf[next-summary-1] = '\0';
 +
 +if (tor_sscanf(ent_buf, %u-%u%c, low, high, dummy) == 2) {
 +  if (low1 || low65535 || high1 || high65535) {
 +log_fn(LOG_PROTOCOL_WARN, LD_DIR,
 +   Found bad entry in policy summary %s, escaped(orig_summary));
 +return NULL;
 +  }
 +} else if (tor_sscanf(ent_buf, %u%c, low, dummy) == 1) {
 +  if (low1 || low65535) {
 +log_fn(LOG_PROTOCOL_WARN, LD_DIR,
 +   Found bad entry in policy summary %s, escaped(orig_summary));
 +return NULL;
 +  }
 +  high = low;
 +} 

[tor-commits] [tor/master] Merge remote branch 'sebastian/bug2496'

2011-02-22 Thread nickm
commit 2eadbd41f0d0356898c75d7fab032109a85bc9e9
Merge: b7f201f 7736f44
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 14:17:11 2011 -0500

Merge remote branch 'sebastian/bug2496'

 src/or/config.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --combined src/or/config.c
index 97a2b32,1dc042d..aa4d974
--- a/src/or/config.c
+++ b/src/or/config.c
@@@ -197,7 -197,6 +197,7 @@@ static config_var_t _option_vars[] = 
V(CircuitStreamTimeout,INTERVAL, 0),
V(CircuitPriorityHalflife, DOUBLE,  -100.0), /*negative:'Use 
default'*/
V(ClientDNSRejectInternalAddresses, BOOL,1),
 +  V(ClientRejectInternalAddresses, BOOL,   1),
V(ClientOnly,  BOOL, 0),
V(ConsensusParams, STRING,   NULL),
V(ConnLimit,   UINT, 1000),
@@@ -267,7 -266,6 +267,7 @@@
  #endif
OBSOLETE(Group),
V(HardwareAccel,   BOOL, 0),
 +  V(HeartbeatPeriod, INTERVAL, 6 hours),
V(AccelName,   STRING,   NULL),
V(AccelDir,FILENAME, NULL),
V(HashedControlPassword,   LINELIST, NULL),
@@@ -293,7 -291,6 +293,7 @@@
OBSOLETE(IgnoreVersion),
V(KeepalivePeriod, INTERVAL, 5 minutes),
VAR(Log, LINELIST, Logs, NULL),
 +  V(LogMessageDomains,   BOOL, 0),
OBSOLETE(LinkPadding),
OBSOLETE(LogLevel),
OBSOLETE(LogFile),
@@@ -416,7 -413,6 +416,7 @@@ static config_var_t testing_tor_network
V(AuthDirMaxServersPerAddr,UINT, 0),
V(AuthDirMaxServersPerAuthAddr,UINT, 0),
V(ClientDNSRejectInternalAddresses, BOOL,0),
 +  V(ClientRejectInternalAddresses, BOOL,   0),
V(ExitPolicyRejectPrivate, BOOL, 0),
V(V3AuthVotingInterval,INTERVAL, 5 minutes),
V(V3AuthVoteDelay, INTERVAL, 20 seconds),
@@@ -1390,10 -1386,12 +1390,12 @@@ options_act(or_options_t *old_options
  print_notice = 1;
} else {
  options-DirReqStatistics = 0;
- log_notice(LD_CONFIG, Configured to measure directory request 
-   statistics, but no GeoIP database found! 
-   Please specify a GeoIP database using the 
-   GeoIPFile option!);
+ /* Don't warn Tor clients, they don't use statistics */
+ if (options-ORPort)
+   log_notice(LD_CONFIG, Configured to measure directory request 
+ statistics, but no GeoIP database found. 
+ Please specify a GeoIP database using the 
+ GeoIPFile option.);
}
  }
  if ((!old_options || !old_options-EntryStatistics) 
@@@ -1404,9 -1402,9 +1406,9 @@@
} else {
  options-EntryStatistics = 0;
  log_notice(LD_CONFIG, Configured to measure entry node 
-   statistics, but no GeoIP database found! 
+   statistics, but no GeoIP database found. 
Please specify a GeoIP database using the 
-   GeoIPFile option!);
+   GeoIPFile option.);
}
  }
  if ((!old_options || !old_options-ExitPortStatistics) 
@@@ -2891,9 -2889,7 +2893,9 @@@ compute_publishserverdescriptor(or_opti
  else if (!strcasecmp(string, bridge))
*auth |= BRIDGE_AUTHORITY;
  else if (!strcasecmp(string, hidserv))
 -  *auth |= HIDSERV_AUTHORITY;
 +  log_warn(LD_CONFIG,
 +   PublishServerDescriptor hidserv is invalid. See 
 +   PublishHidServDescriptors.);
  else if (!strcasecmp(string, ) || !strcmp(string, 0))
/* no authority */;
  else
@@@ -2917,10 -2913,6 +2919,10 @@@
   * will generate too many circuits and potentially overload the network. */
  #define MIN_CIRCUIT_STREAM_TIMEOUT 10
  
 +/** Lowest allowable value for HeartbeatPeriod; if this is too low, we might
 + * expose more information than we're comfortable with. */
 +#define MIN_HEARTBEAT_PERIOD (30*60)
 +
  /** Return 0 if every setting in boptions/b is reasonable, and a
   * permissible transition from bold_options/b. Else return -1.
   * Should have no side effects, except for normalizing the contents of
@@@ -3383,13 -3375,6 +3385,13 @@@ options_validate(or_options_t *old_opti
  options-CircuitStreamTimeout = MIN_CIRCUIT_STREAM_TIMEOUT;
}
  
 +  if (options-HeartbeatPeriod 
 +  options-HeartbeatPeriod  MIN_HEARTBEAT_PERIOD) {
 +log_warn(LD_CONFIG, HeartbeatPeriod option is too short; 
 + raising to %d seconds., MIN_HEARTBEAT_PERIOD);
 +options-HeartbeatPeriod = MIN_HEARTBEAT_PERIOD;
 +  }
 +
if (options-KeepalivePeriod  1)
  REJECT(KeepalivePeriod option must be positive.);
  
@@@ -3415,11 -3400,6 +3417,11 @@@
 PerConnBWBurst, msg)  0)
  return -1;
  
 +  if 

[tor-commits] [tor/master] Don't tell Tor client users about missing geoip

2011-02-22 Thread nickm
commit 7736f44698798111be413ca3285a77ce1e4d6b0c
Author: Sebastian Hahn sebast...@torproject.org
Date:   Sun Feb 6 00:25:33 2011 +0100

Don't tell Tor client users about missing geoip

They don't need the geoip file for stats, so a missing geoipfile is not
a big issue. Also make the log message a bit friendlier. Fixes bug 2496.
---
 src/or/config.c |   14 --
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/or/config.c b/src/or/config.c
index 1fa8466..1dc042d 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1386,10 +1386,12 @@ options_act(or_options_t *old_options)
 print_notice = 1;
   } else {
 options-DirReqStatistics = 0;
-log_notice(LD_CONFIG, Configured to measure directory request 
-  statistics, but no GeoIP database found! 
-  Please specify a GeoIP database using the 
-  GeoIPFile option!);
+/* Don't warn Tor clients, they don't use statistics */
+if (options-ORPort)
+  log_notice(LD_CONFIG, Configured to measure directory request 
+statistics, but no GeoIP database found. 
+Please specify a GeoIP database using the 
+GeoIPFile option.);
   }
 }
 if ((!old_options || !old_options-EntryStatistics) 
@@ -1400,9 +1402,9 @@ options_act(or_options_t *old_options)
   } else {
 options-EntryStatistics = 0;
 log_notice(LD_CONFIG, Configured to measure entry node 
-  statistics, but no GeoIP database found! 
+  statistics, but no GeoIP database found. 
   Please specify a GeoIP database using the 
-  GeoIPFile option!);
+  GeoIPFile option.);
   }
 }
 if ((!old_options || !old_options-ExitPortStatistics) 



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


[tor-commits] [torsocks/master] Replace Makefile.cvs with autogen.sh

2011-02-22 Thread hoganrobert
commit 3205b8fd332024bb693df84af6511a804b39bb4a
Author: Robert Hogan rob...@roberthogan.net
Date:   Tue Feb 22 19:13:09 2011 +

Replace Makefile.cvs with autogen.sh

There, that wasn't so hard - was it. Autogen.sh stolen from tor.
---
 Makefile.cvs |8 
 autogen.sh   |   13 +
 2 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/Makefile.cvs b/Makefile.cvs
deleted file mode 100644
index d160702..000
--- a/Makefile.cvs
+++ /dev/null
@@ -1,8 +0,0 @@
-default: all
-
-all:
-   aclocal
-   autoheader
-   automake
-   autoconf
-
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 000..0592f16
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -x `which autoreconf 2/dev/null` ] ; then
+  exec autoreconf -ivf
+fi
+
+set -e
+
+# Run this to generate all the initial makefiles, etc.
+aclocal  \
+   autoheader  \
+   autoconf  \
+   automake --add-missing --copy

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


[tor-commits] [tor/master] Merge branch 'maint-0.2.2'

2011-02-22 Thread arma
commit 108f48dfc7f1b6bdace9b859e01dbab79aeff071
Merge: 2eadbd4 4f730e4
Author: Roger Dingledine a...@torproject.org
Date:   Tue Feb 22 14:44:32 2011 -0500

Merge branch 'maint-0.2.2'

 doc/spec/README |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

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


[tor-commits] r24254: {website} karen noticed we were duplicating the first how tor works (website/trunk/about/en)

2011-02-22 Thread Roger Dingledine
Author: arma
Date: 2011-02-22 20:08:33 + (Tue, 22 Feb 2011)
New Revision: 24254

Modified:
   website/trunk/about/en/overview.wml
Log:
karen noticed we were duplicating the first how tor works picture on
our overview page.


Modified: website/trunk/about/en/overview.wml
===
--- website/trunk/about/en/overview.wml 2011-02-22 03:30:33 UTC (rev 24253)
+++ website/trunk/about/en/overview.wml 2011-02-22 20:08:33 UTC (rev 24254)
@@ -148,8 +148,6 @@
 single point can tell where the data came from or where it's going.
 /p
 
-pimg alt=Tor circuit step one src=$(IMGROOT)/htw1.png/p
-
 p
 To create a private network pathway with Tor, the user's software or
 client incrementally builds a circuit of encrypted connections through

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


[tor-commits] [tor/maint-0.2.1] Simplest fix to bug2402: do not include SVN versions

2011-02-22 Thread nickm
commit a1073ee956021ead19d30c2151510dbaced416a8
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Jan 25 14:08:13 2011 -0500

Simplest fix to bug2402: do not include SVN versions

When we stopped using svn, 0.2.1.x lost the ability to notice its svn
revision and report it in the version number.  However, it kept
looking at the micro-revision.i file... so if you switched to master,
built tor, then switched to 0.2.1.x, you'd get a micro-revision.i file
from master reported as an SVN tag.  This patch takes out the include
the svn tag logic entirely.

Bugfix on 0.2.1.15-rc; fixes bug 2402.
---
 changes/bug2402 |4 
 src/or/config.c |   11 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/changes/bug2402 b/changes/bug2402
new file mode 100644
index 000..f16f677
--- /dev/null
+++ b/changes/bug2402
@@ -0,0 +1,4 @@
+  o Minor bugfixes (build)
+- Do not include Git version tags as though they were SVN tags when
+  generating a tarball from inside a repository that has switched between
+  branches.  Bugfix on 0.2.1.15-rc; fixes bug 2402.
diff --git a/src/or/config.c b/src/or/config.c
index f8cfd29..c5d6540 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -827,16 +827,7 @@ static char *_version = NULL;
 const char *
 get_version(void)
 {
-  if (_version == NULL) {
-if (strlen(tor_svn_revision)) {
-  size_t len = strlen(VERSION)+strlen(tor_svn_revision)+8;
-  _version = tor_malloc(len);
-  tor_snprintf(_version, len, %s (r%s), VERSION, tor_svn_revision);
-} else {
-  _version = tor_strdup(VERSION);
-}
-  }
-  return _version;
+  return VERSION;
 }
 
 /** Release additional memory allocated in options



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


[tor-commits] [tor/maint-0.2.1] Merge remote branch 'public/bug2402_nothing' into maint-0.2.1

2011-02-22 Thread nickm
commit 7605985b3ff71cee7fabdf023baf298b218d04c1
Merge: 372773d a1073ee
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 15:54:13 2011 -0500

Merge remote branch 'public/bug2402_nothing' into maint-0.2.1

 changes/bug2402 |4 
 src/or/config.c |   11 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --combined src/or/config.c
index 8397b23,c5d6540..209a92d
--- a/src/or/config.c
+++ b/src/or/config.c
@@@ -827,16 -827,7 +827,7 @@@ static char *_version = NULL
  const char *
  get_version(void)
  {
-   if (_version == NULL) {
- if (strlen(tor_svn_revision)) {
-   size_t len = strlen(VERSION)+strlen(tor_svn_revision)+8;
-   _version = tor_malloc(len);
-   tor_snprintf(_version, len, %s (r%s), VERSION, tor_svn_revision);
- } else {
-   _version = tor_strdup(VERSION);
- }
-   }
-   return _version;
+   return VERSION;
  }
  
  /** Release additional memory allocated in options
@@@ -2878,9 -2869,7 +2869,9 @@@ compute_publishserverdescriptor(or_opti
  else if (!strcasecmp(string, bridge))
*auth |= BRIDGE_AUTHORITY;
  else if (!strcasecmp(string, hidserv))
 -  *auth |= HIDSERV_AUTHORITY;
 +  log_warn(LD_CONFIG,
 +   PublishServerDescriptor hidserv is invalid. See 
 +   PublishHidServDescriptors.);
  else if (!strcasecmp(string, ) || !strcmp(string, 0))
/* no authority */;
  else
@@@ -3370,11 -3359,6 +3361,11 @@@ options_validate(or_options_t *old_opti
 RelayBandwidthBurst, msg)  0)
  return -1;
  
 +  if (options-RelayBandwidthRate  !options-RelayBandwidthBurst)
 +options-RelayBandwidthBurst = options-RelayBandwidthRate;
 +  if (options-RelayBandwidthBurst  !options-RelayBandwidthRate)
 +options-RelayBandwidthRate = options-RelayBandwidthBurst;
 +
if (server_mode(options)) {
  if (options-BandwidthRate  ROUTER_REQUIRED_MIN_BANDWIDTH) {
r = tor_snprintf(buf, sizeof(buf),
@@@ -3406,6 -3390,9 +3397,6 @@@
  }
}
  
 -  if (options-RelayBandwidthRate  !options-RelayBandwidthBurst)
 -options-RelayBandwidthBurst = options-RelayBandwidthRate;
 -
if (options-RelayBandwidthRate  options-RelayBandwidthBurst)
  REJECT(RelayBandwidthBurst must be at least equal 
 to RelayBandwidthRate.);

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


[tor-commits] [tor/maint-0.2.2] changes file for removing torspec from the tarball

2011-02-22 Thread nickm
commit e606f19fa369c7ad5934793cb4f72f97972b52bc
Author: Roger Dingledine a...@torproject.org
Date:   Tue Feb 22 14:50:00 2011 -0500

changes file for removing torspec from the tarball
---
 changes/torspec.git |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/changes/torspec.git b/changes/torspec.git
new file mode 100644
index 000..ba33ca2
--- /dev/null
+++ b/changes/torspec.git
@@ -0,0 +1,5 @@
+  o Packaging changes:
+- Stop shipping the Tor specs files and development proposal documents
+  in the tarball. They are now in a separate git repository at
+  git://git.torproject.org/torspec.git
+

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


[tor-commits] [tor/master] changes file for removing torspec from the tarball

2011-02-22 Thread nickm
commit e606f19fa369c7ad5934793cb4f72f97972b52bc
Author: Roger Dingledine a...@torproject.org
Date:   Tue Feb 22 14:50:00 2011 -0500

changes file for removing torspec from the tarball
---
 changes/torspec.git |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/changes/torspec.git b/changes/torspec.git
new file mode 100644
index 000..ba33ca2
--- /dev/null
+++ b/changes/torspec.git
@@ -0,0 +1,5 @@
+  o Packaging changes:
+- Stop shipping the Tor specs files and development proposal documents
+  in the tarball. They are now in a separate git repository at
+  git://git.torproject.org/torspec.git
+



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


[tor-commits] [tor/maint-0.2.1] Issues with router_get_by_nickname()

2011-02-22 Thread nickm
commit 7488fe5a224bf1c40d22769ff3986361d947d6f7
Author: Robert Hogan rob...@roberthogan.net
Date:   Sun Oct 17 12:27:57 2010 +0100

Issues with router_get_by_nickname()

https://trac.torproject.org/projects/tor/ticket/1859

Use router_get_by_digest() instead of router_get_by_hexdigest()
in circuit_discard_optional_exit_enclaves() and
rend_client_get_random_intro(), per Nick's comments.

Using router_get_by_digest() in rend_client_get_random_intro() will
break hidden services published by Tor versions pre 0.1.2.18 and
0.2.07-alpha as they only publish by nickname. This is acceptable
however as these versions only publish to authority tor26 and
don't work for versions in the 0.2.2.x series anyway.
---
 src/or/connection_edge.c |2 +-
 src/or/rendclient.c  |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/or/connection_edge.c b/src/or/connection_edge.c
index eba83ba..f72aa94 100644
--- a/src/or/connection_edge.c
+++ b/src/or/connection_edge.c
@@ -571,7 +571,7 @@ circuit_discard_optional_exit_enclaves(extend_info_t *info)
 !edge_conn-chosen_exit_retries)
   continue;
 r1 = router_get_by_nickname(edge_conn-chosen_exit_name, 0);
-r2 = router_get_by_hexdigest(info-identity_digest);
+r2 = router_get_by_digest(info-identity_digest);
 if (!r1 || !r2 || r1 != r2)
   continue;
 tor_assert(edge_conn-socks_request);
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 97fb6f0..ca3f213 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -810,7 +810,7 @@ rend_client_get_random_intro(const rend_data_t *rend_query)
   intro = smartlist_get(entry-parsed-intro_nodes, i);
   /* Do we need to look up the router or is the extend info complete? */
   if (!intro-extend_info-onion_key) {
-router = router_get_by_hexdigest(intro-extend_info-identity_digest);
+router = router_get_by_digest(intro-extend_info-identity_digest);
 if (!router) {
   log_info(LD_REND, Unknown router with nickname '%s'; trying another.,
intro-extend_info-nickname);



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


[tor-commits] [tor/maint-0.2.2] Fix a remaining bug in Robert's bug1859 fix.

2011-02-22 Thread nickm
commit 2392290c1887b732fd2309e57ce04ab71b9b4e69
Author: Nick Mathewson ni...@torproject.org
Date:   Thu Oct 21 11:08:15 2010 -0400

Fix a remaining bug in Robert's bug1859 fix.

When intro-extend_info is created for an introduction point, it
only starts out with a nickname, not necessarily an identity digest.
Thus, doing router_get_by_digest isn't necessarily safe.
---
 src/or/rendclient.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index ca3f213..1f253c1 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -810,7 +810,10 @@ rend_client_get_random_intro(const rend_data_t *rend_query)
   intro = smartlist_get(entry-parsed-intro_nodes, i);
   /* Do we need to look up the router or is the extend info complete? */
   if (!intro-extend_info-onion_key) {
-router = router_get_by_digest(intro-extend_info-identity_digest);
+if (tor_digest_is_zero(intro-extend_info-identity_digest))
+  router = router_get_by_hexdigest(intro-extend_info-nickname);
+else
+  router = router_get_by_digest(intro-extend_info-identity_digest);
 if (!router) {
   log_info(LD_REND, Unknown router with nickname '%s'; trying another.,
intro-extend_info-nickname);



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


[tor-commits] [tor/master] Merge remote branch 'origin/maint-0.2.2'

2011-02-22 Thread nickm
commit bbf782dc13915c579396d94efbdf87b5c32b70d3
Merge: 3d4c2ff 06deec1
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 17:21:34 2011 -0500

Merge remote branch 'origin/maint-0.2.2'

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


[tor-commits] [tor/maint-0.2.2] Remove doc/spec/Makefile.in from list of generated files

2011-02-22 Thread nickm
commit 10ad3442e11fb5a54c19eef7425bc317a9cc0969
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 17:51:03 2011 -0500

Remove doc/spec/Makefile.in from list of generated files
---
 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 68c593a..7cdb330 100644
--- a/configure.in
+++ b/configure.in
@@ -866,7 +866,7 @@ fi
 
 CPPFLAGS=$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl 
$TOR_CPPFLAGS_zlib
 
-AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl 
contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile 
contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist 
contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist 
contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile 
doc/Makefile doc/design-paper/Makefile doc/spec/Makefile src/config/Makefile 
src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile 
contrib/suse/Makefile contrib/suse/tor.sh])
+AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl 
contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile 
contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist 
contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist 
contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile 
doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile 
src/or/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile 
contrib/suse/tor.sh])
 AC_OUTPUT
 
 if test -x /usr/bin/perl  test -x ./contrib/updateVersions.pl ; then



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


[tor-commits] [tor/master] Remove doc/spec/Makefile.in from list of generated files

2011-02-22 Thread nickm
commit 10ad3442e11fb5a54c19eef7425bc317a9cc0969
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 17:51:03 2011 -0500

Remove doc/spec/Makefile.in from list of generated files
---
 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/configure.in b/configure.in
index 68c593a..7cdb330 100644
--- a/configure.in
+++ b/configure.in
@@ -866,7 +866,7 @@ fi
 
 CPPFLAGS=$CPPFLAGS $TOR_CPPFLAGS_libevent $TOR_CPPFLAGS_openssl 
$TOR_CPPFLAGS_zlib
 
-AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl 
contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile 
contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist 
contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist 
contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile 
doc/Makefile doc/design-paper/Makefile doc/spec/Makefile src/config/Makefile 
src/common/Makefile src/or/Makefile src/win32/Makefile src/tools/Makefile 
contrib/suse/Makefile contrib/suse/tor.sh])
+AC_CONFIG_FILES([Makefile tor.spec Doxyfile contrib/tor.sh contrib/torctl 
contrib/torify contrib/tor.logrotate contrib/Makefile contrib/osx/Makefile 
contrib/osx/TorBundleDesc.plist contrib/osx/TorBundleInfo.plist 
contrib/osx/TorDesc.plist contrib/osx/TorInfo.plist 
contrib/osx/TorStartupDesc.plist src/config/torrc.sample doc/tor.1 src/Makefile 
doc/Makefile doc/design-paper/Makefile src/config/Makefile src/common/Makefile 
src/or/Makefile src/win32/Makefile src/tools/Makefile contrib/suse/Makefile 
contrib/suse/tor.sh])
 AC_OUTPUT
 
 if test -x /usr/bin/perl  test -x ./contrib/updateVersions.pl ; then



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


[tor-commits] [tor/master] Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

2011-02-22 Thread nickm
commit 596f7a39b69c5c3c5f2427e65056af6cc2bb0f64
Merge: 06deec1 10ad344
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 17:53:09 2011 -0500

Merge remote branch 'origin/maint-0.2.1' into maint-0.2.2

Conflicts:
configure.in

 configure.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --combined configure.in
index 9cbfbb1,7cdb330..f30402d
--- a/configure.in
+++ b/configure.in
@@@ -1,10 -1,11 +1,10 @@@
 -dnl $Id$
  dnl Copyright (c) 2001-2004, Roger Dingledine
  dnl Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
  dnl Copyright (c) 2007-2008, The Tor Project, Inc.
  dnl See LICENSE for licensing information
  
  AC_INIT
 -AM_INIT_AUTOMAKE(tor, 0.2.1.25)
 +AM_INIT_AUTOMAKE(tor, 0.2.2.19-alpha)
  AM_CONFIG_HEADER(orconfig.h)
  
  AC_CANONICAL_HOST
@@@ -19,6 -20,21 +19,6 @@@ f
  # the += operator on it in src/or/Makefile.am
  CPPFLAGS=$CPPFLAGS -I\${top_srcdir}/src/common
  
 -AC_ARG_ENABLE(debug,
 - AS_HELP_STRING(--enable-debug, compile with debugging info),
 -[if test x$enableval = xyes; then
 -CFLAGS=$CFLAGS -g
 -fi])
 -
 -# ideally, we should make this into a no-op, and detect whether we're
 -#compiling for the iphone by using $target.
 -AC_ARG_ENABLE(iphone,
 - AS_HELP_STRING(--enable-iphone, compile with iPhone support),
 - [if test x$enableval = xyes ; then
 -   tor_cv_iphone=true
 -   CFLAGS=$CFLAGS -D__DARWIN_UNIX03 -DIPHONE
 -  fi])
 -
  #020 We should make these enabled or not, before 0.2.0.x-final
  AC_ARG_ENABLE(buf-freelists,
 AS_HELP_STRING(--disable-buf-freelists, disable freelists for buffer RAM))
@@@ -30,8 -46,6 +30,8 @@@ AC_ARG_ENABLE(static-openssl
 AS_HELP_STRING(--enable-static-openssl, Link against a static openssl 
library. Requires --with-openssl-dir))
  AC_ARG_ENABLE(static-libevent,
 AS_HELP_STRING(--enable-static-libevent, Link against a static libevent 
library. Requires --with-libevent-dir))
 +AC_ARG_ENABLE(static-zlib,
 +   AS_HELP_STRING(--enable-static-zlib, Link against a static zlib library. 
Requires --with-zlib-dir))
  
  if test x$enable_buf_freelists != xno; then
AC_DEFINE(ENABLE_BUF_FREELISTS, 1,
@@@ -51,15 -65,6 +51,15 @@@ AC_ARG_ENABLE(transparent
  *) AC_MSG_ERROR(bad value for --enable-transparent) ;;
esac], [transparent=true])
  
 +AC_ARG_ENABLE(asciidoc,
 + AS_HELP_STRING(--disable-asciidoc, don't use asciidoc (disables building 
of manpages)),
 + [case ${enableval} in
 +yes) asciidoc=true ;;
 +no)  asciidoc=false ;;
 +*) AC_MSG_ERROR(bad value for --disable-asciidoc) ;;
 +  esac], [asciidoc=true])
 +
 +
  AC_ARG_ENABLE(threads,
   AS_HELP_STRING(--disable-threads, disable multi-threading support))
  
@@@ -85,32 -90,18 +85,32 @@@ case $host i
   ;;
  esac
  
 -AC_ARG_ENABLE(geoip-stats,
 - AS_HELP_STRING(--enable-geoip-stats, enable code for directories to 
collect per-country statistics))
 -
 -if test $enable_geoip_stats = yes; then
 -  AC_DEFINE(ENABLE_GEOIP_STATS, 1, [Defined if we try to collect per-country 
statistics])
 -fi
 -
  AC_ARG_ENABLE(gcc-warnings,
   AS_HELP_STRING(--enable-gcc-warnings, enable verbose warnings))
  AC_ARG_ENABLE(gcc-warnings-advisory,
   AS_HELP_STRING(--enable-gcc-warnings-advisory, [enable verbose warnings, 
excluding -Werror]))
  
 +dnl Adam shostack suggests the following for Windows:
 +dnl -D_FORTIFY_SOURCE=2 -fstack-protector-all
 +dnl Others suggest '/gs /safeseh /nxcompat /dynamicbase' for non-gcc on 
Windows
 +dnl This requires that we use gcc and that we add -O2 to the CFLAGS.
 +AC_ARG_ENABLE(gcc-hardening,
 + AS_HELP_STRING(--enable-gcc-hardening, enable compiler security checks),
 +[if test x$enableval = xyes; then
 +CFLAGS=$CFLAGS -D_FORTIFY_SOURCE=2 -fstack-protector-all
 +CFLAGS=$CFLAGS -fwrapv -fPIE -Wstack-protector
 +CFLAGS=$CFLAGS --param ssp-buffer-size=1
 +LDFLAGS=$LDFLAGS -pie
 +fi])
 +
 +dnl Linker hardening options
 +dnl Currently these options are ELF specific - you can't use this with MacOSX
 +AC_ARG_ENABLE(linker-hardening,
 +AS_HELP_STRING(--enable-linker-hardening, enable linker security 
fixups),
 +[if test x$enableval = xyes; then
 +LDFLAGS=$LDFLAGS -z relro -z now
 +fi])
 +
  AC_ARG_ENABLE(local-appdata,
 AS_HELP_STRING(--enable-local-appdata, default to host local application 
data paths on Windows))
  if test $enable_local_appdata = yes; then
@@@ -123,18 -114,6 +123,18 @@@ AC_PROG_CP
  AC_PROG_MAKE_SET
  AC_PROG_RANLIB
  
 +dnl autoconf 2.59 appears not to support AC_PROG_SED
 +AC_CHECK_PROG([SED],[sed],[sed],[/bin/false])
 +
 +dnl check for asciidoc and a2x
 +AC_PATH_PROG([ASCIIDOC], [asciidoc], none)
 +AC_PATH_PROG([A2X], [a2x], none)
 +
 +AM_CONDITIONAL(USE_ASCIIDOC, test x$asciidoc = xtrue)
 +
 +AC_PATH_PROG([SHA1SUM], [sha1sum], none)
 +AC_PATH_PROG([OPENSSL], [openssl], none)
 +
  TORUSER=_tor
  AC_ARG_WITH(tor-user,
  [  --with-tor-user=NAMESpecify username for tor daemon ],
@@@ 

[tor-commits] [tor/master] Merge remote branch 'origin/maint-0.2.2'

2011-02-22 Thread nickm
commit c2f111a631292b38b25635334afd628cb1024265
Merge: bbf782d 596f7a3
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 17:55:17 2011 -0500

Merge remote branch 'origin/maint-0.2.2'

Conflicts:
configure.in

 configure.in |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --combined configure.in
index 2669511,f30402d..d7cb91f
--- a/configure.in
+++ b/configure.in
@@@ -4,7 -4,7 +4,7 @@@ dnl Copyright (c) 2007-2008, The Tor Pr
  dnl See LICENSE for licensing information
  
  AC_INIT
 -AM_INIT_AUTOMAKE(tor, 0.2.2.19-alpha)
 +AM_INIT_AUTOMAKE(tor, 0.2.3.0-alpha-dev)
  AM_CONFIG_HEADER(orconfig.h)
  
  AC_CANONICAL_HOST
@@@ -59,24 -59,6 +59,24 @@@ AC_ARG_ENABLE(asciidoc
  *) AC_MSG_ERROR(bad value for --disable-asciidoc) ;;
esac], [asciidoc=true])
  
 +# By default, we're not ready to ship a NAT-PMP aware Tor
 +AC_ARG_ENABLE(nat-pmp,
 + AS_HELP_STRING(--enable-nat-pmp, enable NAT-PMP support),
 + [case ${enableval} in
 +yes) natpmp=true ;;
 +no)  natpmp=false ;;
 +* ) AC_MSG_ERROR(bad value for --enable-nat-pmp) ;;
 +  esac], [natpmp=false])
 +
 +# By default, we're not ready to ship a UPnP aware Tor
 +AC_ARG_ENABLE(upnp,
 + AS_HELP_STRING(--enable-upnp, enable UPnP support),
 + [case ${enableval} in
 +yes) upnp=true ;;
 +no)  upnp=false ;;
 +* ) AC_MSG_ERROR(bad value for --enable-upnp) ;;
 +  esac], [upnp=false])
 +
  
  AC_ARG_ENABLE(threads,
   AS_HELP_STRING(--disable-threads, disable multi-threading support))
@@@ -136,9 -118,6 +136,9 @@@ if test $enable_local_appdata = yes
  [Defined if we default to host local appdata paths on Windows])
  fi
  
 +AC_ARG_ENABLE(bufferevents,
 + AS_HELP_STRING(--enable-bufferevents, use Libevent's buffered IO.))
 +
  AC_PROG_CC
  AC_PROG_CPP
  AC_PROG_MAKE_SET
@@@ -153,33 -132,6 +153,33 @@@ AC_PATH_PROG([A2X], [a2x], none
  
  AM_CONDITIONAL(USE_ASCIIDOC, test x$asciidoc = xtrue)
  
 +AM_CONDITIONAL(USE_FW_HELPER, test x$natpmp = xtrue || test x$upnp = xtrue)
 +AM_CONDITIONAL(NAT_PMP, test x$natpmp = xtrue)
 +AM_CONDITIONAL(MINIUPNPC, test x$upnp = xtrue)
 +AM_PROG_CC_C_O
 +
 +ifdef([AC_C_FLEXIBLE_ARRAY_MEMBER], [
 +AC_C_FLEXIBLE_ARRAY_MEMBER
 +], [
 + dnl Maybe we've got an old autoconf...
 + AC_CACHE_CHECK([for flexible array members],
 + tor_cv_c_flexarray,
 + [AC_COMPILE_IFELSE(
 +   AC_LANG_PROGRAM([
 + struct abc { int a; char b[]; };
 +], [
 + struct abc *def = malloc(sizeof(struct abc)+sizeof(char));
 + def-b[0] = 33;
 +]),
 +  [tor_cv_c_flexarray=yes],
 +  [tor_cv_c_flexarray=no])])
 + if test $tor_cv_flexarray = yes ; then
 +   AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [])
 + else
 +   AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
 + fi
 +])
 +
  AC_PATH_PROG([SHA1SUM], [sha1sum], none)
  AC_PATH_PROG([OPENSSL], [openssl], none)
  
@@@ -271,28 -223,7 +271,28 @@@ dnl ---
  dnl Check for functions before libevent, since libevent-1.2 apparently
  dnl exports strlcpy without defining it in a header.
  
 -AC_CHECK_FUNCS(gettimeofday ftime socketpair uname inet_aton strptime 
getrlimit strlcat strlcpy strtoull getaddrinfo localtime_r gmtime_r memmem 
strtok_r writev readv flock prctl vasprintf)
 +AC_CHECK_FUNCS(
 +  accept4 \
 +flock \
 +ftime \
 +getaddrinfo \
 +getrlimit \
 +gettimeofday \
 +gmtime_r \
 +inet_aton \
 +localtime_r \
 +memmem \
 +prctl \
 +socketpair \
 +strlcat \
 +strlcpy \
 +strptime \
 +strtok_r \
 +strtoull \
 +sysconf \
 +uname \
 +vasprintf \
 +)
  
  using_custom_malloc=no
  if test x$enable_openbsd_malloc = xyes ; then
@@@ -371,7 -302,7 +371,7 @@@ AC_CHECK_MEMBERS([struct event.min_heap
  [#include event.h
  ])
  
 -AC_CHECK_HEADERS(event2/event.h event2/dns.h)
 +AC_CHECK_HEADERS(event2/event.h event2/dns.h event2/bufferevent_ssl.h)
  
  LIBS=$save_LIBS
  LDFLAGS=$save_LDFLAGS
@@@ -391,54 -322,6 +391,54 @@@ els
  fi
  AC_SUBST(TOR_LIBEVENT_LIBS)
  
 +dnl This isn't the best test for Libevent 2.0.3-alpha.  Once it's released,
 +dnl we can do much better.
 +if test $enable_bufferevents = yes ; then
 +  if test $ac_cv_header_event2_bufferevent_ssl_h != yes ; then
 +AC_MSG_ERROR([You've asked for bufferevent support, but you're using a 
version of Libevent without SSL support.  This won't work.  We need Libevent 
2.0.8-rc or later, and you don't seem to even have Libevent 2.0.3-alpha.])
 +  else
 +
 +CPPFLAGS=$CPPFLAGS $TOR_CPPFLAGS_libevent
 +
 +# Check for the right version.  First see if version detection works.
 +AC_MSG_CHECKING([whether we can detect the Libevent version])
 +AC_COMPILE_IFELSE([AC_LANG_SOURCE([
 +#include event2/event.h
 +#if !defined(LIBEVENT_VERSION_NUMBER) || LIBEVENT_VERSION_NUMBER  10
 +#error
 +int x = y(zz);
 +#else
 +int x = 1;
 +#endif
 +  ])], 

[tor-commits] [tor/maint-0.2.2] Merge remote branch 'arma/bug2403' into maint-0.2.2

2011-02-22 Thread nickm
commit 16b8b9b00f414343030c29990930c0e52a01fd84
Merge: 530e87c a2727f6
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Feb 22 18:38:03 2011 -0500

Merge remote branch 'arma/bug2403' into maint-0.2.2

 changes/bug2403   |6 ++
 src/or/circuitbuild.c |3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

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


[tor-commits] [tor/master] prevent same entry and exit for insane edge case

2011-02-22 Thread nickm
commit a2727f62494b8a56152214017ac8fb348dd064be
Author: Roger Dingledine a...@torproject.org
Date:   Tue Feb 22 17:54:25 2011 -0500

prevent same entry and exit for insane edge case
---
 changes/bug2403   |6 ++
 src/or/circuitbuild.c |3 ++-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/changes/bug2403 b/changes/bug2403
new file mode 100644
index 000..3b29b37
--- /dev/null
+++ b/changes/bug2403
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+- In the special case where you configure a public exit relay as your
+  bridge, Tor would be willing to use that exit relay as the last
+  hop in your circuit as well. Now we fail that circuit instead.
+  Bugfix on 0.2.0.12-alpha. Fixes bug 2403. Reported by piebeer.
+
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 4f8f5fb..b3c9f0e 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -4063,7 +4063,6 @@ choose_random_entry(cpath_build_state_t *state)
   int preferred_min, consider_exit_family = 0;
 
   if (chosen_exit) {
-smartlist_add(exit_family, chosen_exit);
 routerlist_add_family(exit_family, chosen_exit);
 consider_exit_family = 1;
   }
@@ -4086,6 +4085,8 @@ choose_random_entry(cpath_build_state_t *state)
   r = entry_is_live(entry, need_uptime, need_capacity, 0, msg);
   if (!r)
 continue; /* down, no point */
+  if (r == chosen_exit)
+continue; /* don't pick the same node for entry and exit */
   if (consider_exit_family  smartlist_isin(exit_family, r))
 continue; /* avoid relays that are family members of our exit */
   if (options-EntryNodes 



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


[tor-commits] [tor/release-0.2.1] Simplest fix to bug2402: do not include SVN versions

2011-02-22 Thread arma
commit a1073ee956021ead19d30c2151510dbaced416a8
Author: Nick Mathewson ni...@torproject.org
Date:   Tue Jan 25 14:08:13 2011 -0500

Simplest fix to bug2402: do not include SVN versions

When we stopped using svn, 0.2.1.x lost the ability to notice its svn
revision and report it in the version number.  However, it kept
looking at the micro-revision.i file... so if you switched to master,
built tor, then switched to 0.2.1.x, you'd get a micro-revision.i file
from master reported as an SVN tag.  This patch takes out the include
the svn tag logic entirely.

Bugfix on 0.2.1.15-rc; fixes bug 2402.
---
 changes/bug2402 |4 
 src/or/config.c |   11 +--
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/changes/bug2402 b/changes/bug2402
new file mode 100644
index 000..f16f677
--- /dev/null
+++ b/changes/bug2402
@@ -0,0 +1,4 @@
+  o Minor bugfixes (build)
+- Do not include Git version tags as though they were SVN tags when
+  generating a tarball from inside a repository that has switched between
+  branches.  Bugfix on 0.2.1.15-rc; fixes bug 2402.
diff --git a/src/or/config.c b/src/or/config.c
index f8cfd29..c5d6540 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -827,16 +827,7 @@ static char *_version = NULL;
 const char *
 get_version(void)
 {
-  if (_version == NULL) {
-if (strlen(tor_svn_revision)) {
-  size_t len = strlen(VERSION)+strlen(tor_svn_revision)+8;
-  _version = tor_malloc(len);
-  tor_snprintf(_version, len, %s (r%s), VERSION, tor_svn_revision);
-} else {
-  _version = tor_strdup(VERSION);
-}
-  }
-  return _version;
+  return VERSION;
 }
 
 /** Release additional memory allocated in options



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