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

Re: [or-cvs] various bugfixes and updates



On Thu, 2003-09-25 at 06:42, Roger Dingledine wrote:

 [...] 
>  static int init_descriptor(void) {
>    routerinfo_t *ri;
> +  char localhostname[256];
> +
> +  if(gethostname(localhostname,sizeof(localhostname)) < 0) {
> +    log_fn(LOG_ERR,"Error obtaining local hostname");
> +    return -1;
> +  }
>    ri = tor_malloc(sizeof(routerinfo_t));
> -  ri->address = strdup("XXXXXXX"); /*XXX*/
> +  ri->address = strdup(localhostname);

This won't work in the real world.  You need a way for users to specify
their own hostnames for two reasons:
   1) So you can have an OR running on tor.freehaven.net, not
moria.mit.edu.
   2) So people behind proxies can stick an OR on outer.foo.com, not
inner.foo.com.

Attachment: signature.asc
Description: This is a digitally signed message part