diff options
author | teor <teor2345@gmail.com> | 2014-10-19 17:48:07 +1100 |
---|---|---|
committer | teor <teor2345@gmail.com> | 2014-11-08 20:31:20 +1100 |
commit | fd7e9e9030cee9d8e863cea3f3f90226ae66fdfe (patch) | |
tree | a9ca33e658ff76b7a4bf4a7d5f9dd3a4936da575 /src/common/util.h | |
parent | ce7fd6e160e2e3acb824b29e29afe15cd5e7bf4f (diff) | |
download | tor-fd7e9e9030cee9d8e863cea3f3f90226ae66fdfe.tar.gz tor-fd7e9e9030cee9d8e863cea3f3f90226ae66fdfe.zip |
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.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/util.h b/src/common/util.h index d7feb6e925..c5471ff9f2 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -334,7 +334,7 @@ enum stream_status get_string_from_pipe(FILE *stream, char *buf, size_t count); /** Return values from file_status(); see that function's documentation * for details. */ -typedef enum { FN_ERROR, FN_NOENT, FN_FILE, FN_DIR } file_status_t; +typedef enum { FN_ERROR, FN_NOENT, FN_FILE, FN_DIR, FN_EMPTY } file_status_t; file_status_t file_status(const char *filename); /** Possible behaviors for check_private_dir() on encountering a nonexistent |