Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#1241 closed enhancement (duplicate)

routerlists read from torrc not concatenated

Reported by: aakova Owned by: nickm
Priority: Low Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version: 0.2.1.22
Severity: Keywords:
Cc: aakova, arma, nickm, Sebastian Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

[ If a list of nodes is specified in the torrc like this:

ExcludeNodes $7360815c9f8471ba6a9335d00c1c1ef4e9c1162d
ExcludeNodes $73ecf797130872f13ccd2cc051bd98ba68a8c781
ExcludeNodes $2b560cda2b2faf392bec929aae7215f4e8c08af8
ExcludeNodes $437492a449c407425b58ef530f4461d9ed9b28fa

only the last entry ends up in the final rotuerlist. It would be desirable
if subsequent lines were concatenated into the final list. ]

[ I've never been one for treating comments as 'authoritative', but... the
comment preceeding src\or\config.c:config_assign indicates several
behaviors, in particular this one occurs when ((use_defaults == 0) &&
(clear_first == 0)). ]

  • Here are the use cases:
  • 1. A non-empty AllowInvalid line in your torrc. Appends to current
  • if linelist, replaces current if csv.
  • 2. An empty AllowInvalid line in your torrc. Should clear it.
  • 3. "RESETCONF AllowInvalid" sets it to default.
  • 4. "SETCONF AllowInvalid" makes it NULL.
  • 5. "SETCONF AllowInvalid=foo" clears it and sets it to "foo". *
  • Use_defaults Clear_first
  • 0 0 "append"
  • 1 0 undefined, don't use
  • 0 1 "set to null first"
  • 1 1 "set to defaults first"
  • Return 0 on success, -1 on bad key, -2 on bad value.

src\or\config.c:config_assign_value:

case CONFIG_TYPE_ROUTERSET:

[ If there is already a routerset, delete it, and create a new, empty one to
fill in: ]

if (*(routerset_t)lvalue) {

routerset_free(*(routerset_t)lvalue);

}
*(routerset_t)lvalue = routerset_new();
if (routerset_parse(*(routerset_t
)lvalue, c->value, c->key)<0) {

tor_snprintf(buf, sizeof(buf), "Invalid exit list '%s' for option '%s'",

c->value, c->key);

*msg = tor_strdup(buf);
return -1;

}
break;

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (5)

comment:1 Changed 10 years ago by Sebastian

don't think that's worth fixing, the docs don't claim this should work and I don't see the big benefit?

comment:2 Changed 10 years ago by arma

Yeah, we should leave it as-is. There are some config options that append to each
other, and some that replace. If you want to name more than one, then put them on
one line and separate them with commas. Changing the behavior at this point will
confuse far more people than it will help.

comment:3 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-final
Owner: set to nickm
Status: newassigned

We should warn if a single config file contains multiple instances of a single-line option, though.

comment:4 Changed 9 years ago by nickm

Resolution: Noneduplicate
Status: assignedclosed

Actually, the part of this worth fixing was a duplicate of bug #1384, which has better analysis of how to write a fix. Closing.

comment:5 Changed 7 years ago by nickm

Component: Tor RelayTor
Note: See TracTickets for help on using tickets.