Opened 13 years ago

Last modified 7 years ago

#257 closed defect (Fixed)

saveconf gives me a 250 OK even if it failed

Reported by: edmanm Owned by: arma
Priority: Low Milestone:
Component: Core Tor/Tor Version:
Severity: Keywords:
Cc: edmanm Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

If I send a SAVECONF to Tor, Tor sends me a 250 OK even if Tor's logs tell me it had a problem
and my changes weren't actually saved.

[edmanm@adrastea:~]$ telnet localhost 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
authenticate
250 OK
setconf nickname=testnickname
250 OK
saveconf
250 OK
quit
250 closing connection
Connection closed by foreign host.

[edmanm@adrastea:~]$ tor -ControlPort 9051
Feb 19 16:54:39.290 [notice] Tor v0.1.1.13-alpha. This is experimental software. Do not rely on it for strong anonymity.
Feb 19 16:54:39.293 [notice] Initialized libevent version 1.1a using method poll. Good.
Feb 19 16:54:39.294 [notice] connection_create_listener(): Opening Socks listener on 127.0.0.1:9050
Feb 19 16:54:39.295 [notice] connection_create_listener(): Opening Control listener on 127.0.0.1:9051
Feb 19 16:54:40.701 [notice] We now have enough directory information to build circuits.
Feb 19 16:54:43.262 [notice] Tor has successfully opened a circuit. Looks like it's working.
Feb 19 16:55:13.503 [notice] write_configuration_file(): Renaming old configuration file to "/Library/tor/torrc.orig.1"
Feb 19 16:55:13.503 [warn] Couldn't open "/Library/tor/torrc.tmp" for writing: Permission denied

[Automatically added by flyspray2trac: Operating System: All]

Child Tickets

Change History (7)

comment:1 Changed 13 years ago by arma

This is fixed in CVS now, and will be in 0.1.1.14-alpha. Thanks for letting us know.

Can you give CVS a try and let me know if it's actually fixed?

comment:2 Changed 13 years ago by edmanm

I don't believe it's completely fixed. Tor still tells me 250 OK but the logs still say otherwise.

[edmanm@adrastea:~]$ telnet localhost 9051
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
authenticate
250 OK
setconf nickname=testnickname
250 OK
saveconf
250 OK
quit
250 closing connection
Connection closed by foreign host.

[edmanm@adrastea:~]$ /usr/local/bin/tor -ControlPort 9051
Feb 19 18:56:51.371 [notice] Tor v0.1.1.13-alpha-cvs. This is experimental software. Do not rely on it for strong anonymity.
Feb 19 18:56:51.377 [notice] Configuration file "/usr/local/etc/tor/torrc" not present, using reasonable defaults.
Feb 19 18:56:51.379 [notice] Initialized libevent version 1.1a using method poll. Good.
Feb 19 18:56:51.380 [notice] connection_create_listener(): Opening Socks listener on 127.0.0.1:9050
Feb 19 18:56:51.381 [notice] connection_create_listener(): Opening Control listener on 127.0.0.1:9051
Feb 19 18:56:52.462 [notice] We now have enough directory information to build circuits.
Feb 19 18:56:53.988 [notice] Tor has successfully opened a circuit. Looks like it's working.
Feb 19 18:57:06.348 [warn] Couldn't open "/usr/local/etc/tor/torrc.tmp" for writing: Permission denied

comment:3 Changed 13 years ago by arma

Ok, try now. :)

comment:4 Changed 13 years ago by edmanm

Yep, all fixed. Except the error message returned doesn't follow the v1 control spec. :)

Here's a patch:

[edmanm@adrastea:~/tor-cvs/tor/src/or]$ cvs diff -u
cvs diff: Diffing .
Index: control.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/control.c,v
retrieving revision 1.169
diff -u -r1.169 control.c
--- control.c 13 Feb 2006 09:02:35 -0000 1.169
+++ control.c 20 Feb 2006 01:17:56 -0000
@@ -1076,8 +1076,8 @@

send_control0_error(conn, ERR_INTERNAL,

"Unable to write configuration to disk.");

else

  • connection_write_str_to_buf("551 Unable to write configuration to disk.",
  • conn);

+ connection_write_str_to_buf(
+ "551 Unable to write configuration to disk.\r\n", conn);

} else {

send_control_done(conn);

}

comment:5 Changed 13 years ago by arma

Last patched applied, and closing flyspray entry. Thanks!

comment:6 Changed 13 years ago by arma

flyspray2trac: bug closed.

comment:7 Changed 7 years ago by nickm

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