From fd7e9e9030cee9d8e863cea3f3f90226ae66fdfe Mon Sep 17 00:00:00 2001 From: teor Date: Sun, 19 Oct 2014 17:48:07 +1100 Subject: Stop failing when key files are zero-length Instead, generate new keys, and overwrite the empty key files. Adds FN_EMPTY to file_status_t and file_status. Fixes bug 13111. Related changes due to review of FN_FILE usage: Stop generating a fresh .old RSA key file when the .old file is missing. Avoid overwriting .old key files with empty key files. Skip loading zero-length extra info store, router store, stats, state, and key files. --- src/or/statefile.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/or/statefile.c') diff --git a/src/or/statefile.c b/src/or/statefile.c index 2ce53fdfca..6640aed7d0 100644 --- a/src/or/statefile.c +++ b/src/or/statefile.c @@ -323,7 +323,10 @@ or_state_load(void) goto done; } break; + /* treat empty state files as if the file doesn't exist, and generate + * a new state file, overwriting the empty file in or_state_save() */ case FN_NOENT: + case FN_EMPTY: break; case FN_ERROR: case FN_DIR: -- cgit v1.2.3-54-g00ecf