Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#1384 closed defect (fixed)

Document what happens if options are defined more than once

Reported by: Sebastian Owned by:
Priority: Medium Milestone: Tor: 0.2.2.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: Documentation
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

Currently, we're allowing users to set some options like DataDirectory or User as often as they want. I've looked around, but we don't tell anyone what will happen in that case - currently, the option that is defined later will win, and command-line options win over torrc options.

Did I just not find this anywhere, or is that more than an implementation detail? Do we want to warn when some option is specified twice, and it can only have one value?

Question raised by roconnor on #tor, who wants to package Tor for NixOS.

Child Tickets

Change History (8)

comment:1 Changed 9 years ago by nickm

Priority: majorminor

It seems reasonable to disallow any options that do not have a defined meaning when they appear more than once to appear more than once in a single configuration file.

This should probably happen in config_assign(), between pass 1 and pass 2. The check could be as simple as making a bitarray with as many entries as are in fmt->vars, then iterating over the list of configuration options and using config_find_option to look up the index of each one, using the bitarray to track which ones we've already seen.

comment:2 Changed 9 years ago by nickm

Milestone: Tor: 0.2.2.x-final
Priority: minornormal

Closed bug #1241 as a duplicate of this; apparently this is confusing users.

comment:3 Changed 9 years ago by nickm

Status: newneeds_review

Possibly implemented in branch bug1384 in my public repository.

comment:4 Changed 9 years ago by Sebastian

This doesn't compile without warnings on OS X 10.6 for me, and in the changes file, you didn't notice which bug got closed by this branch. bug1384 in my repo has a fix for both.

comment:5 Changed 9 years ago by nickm

Other than that, looks ok?

comment:6 Changed 9 years ago by Sebastian

yes, looks good. Sorry

comment:7 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

ok; merging.

comment:8 Changed 7 years ago by nickm

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