[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [ooni-probe/master] Update updater script
commit 1d5d892181bf06f21b7c8df8566eb0906212382b
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date: Tue Sep 13 12:32:55 2016 +0200
Update updater script
---
data/updater.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/data/updater.py b/data/updater.py
index 65983aa..f7225dd 100755
--- a/data/updater.py
+++ b/data/updater.py
@@ -198,9 +198,12 @@ def perform_update(version, skip_verification=False):
try:
logging.info("Running install script")
+ if updater.__version__ != str(version):
+ logging.error("There is a version mismatch in the updater file. This could be a sign of a replay attack.")
+ raise UpdateFailed
updater.run()
except Exception:
- logging.error("Failed to run the version update script for version {0}".format(version))
+ logging.exception("Failed to run the version update script for version {0}".format(version))
raise UpdateFailed
current_version_dir = os.path.dirname(CURRENT_VERSION_PATH)
@@ -214,6 +217,8 @@ def perform_update(version, skip_verification=False):
with open(CURRENT_VERSION_PATH, "w+") as out_file:
out_file.write(str(version))
+ logging.info("Updated to version {0}".format(version))
+
def update_to_version(from_version, to_version, skip_verification=False):
versions = range(from_version + 1, to_version + 1)
for version in versions:
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits