Merge remote-tracking branch 'origin/maint-0.2.2'

This commit is contained in:
Nick Mathewson 2011-05-11 22:55:29 -04:00
commit 7649adbce6
2 changed files with 7 additions and 1 deletions

6
changes/bug3135 Normal file
View File

@ -0,0 +1,6 @@
o Minor bugfixes
- Do not crash when our configuration file becomes unreadable
(usually due to a permissions change) between when we start
up and when a controller calls SAVECONF. Fixes bug 3135;
bugfix on 0.0.9pre6.

View File

@ -4764,7 +4764,7 @@ write_configuration_file(const char *fname, or_options_t *options)
switch (file_status(fname)) { switch (file_status(fname)) {
case FN_FILE: case FN_FILE:
old_val = read_file_to_str(fname, 0, NULL); old_val = read_file_to_str(fname, 0, NULL);
if (strcmpstart(old_val, GENERATED_FILE_PREFIX)) { if (!old_val || strcmpstart(old_val, GENERATED_FILE_PREFIX)) {
rename_old = 1; rename_old = 1;
} }
tor_free(old_val); tor_free(old_val);