Skip to content

Commit 9f6984b

Browse files
committed
manually merged PR155
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6171 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent 6c8bb11 commit 9f6984b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ local OpenID login and added Jupyter+cloud integration for data analysis:
776776
--apache_run=/var/run/httpd \
777777
--apache_lock=/var/lock/subsys/httpd \
778778
--apache_log=/var/log/httpd \
779-
--openssh_version=7.4 \
779+
--openssh_version=7.3 \
780780
--mig_code=/home/mig/mig \
781781
--mig_state=/home/mig/state \
782782
--mig_certs=/etc/httpd/MiG-certificates \

mig/server/verifyarchives.py

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# --- BEGIN_HEADER ---
55
#
66
# verifyarchives - Search for missing files in user Archives
7-
# Copyright (C) 2021-2022 The MiG Project lead by Brian Vinter
7+
# Copyright (C) 2021-2024 The MiG Project lead by Brian Vinter
88
#
99
# This file is part of MiG.
1010
#
@@ -42,6 +42,7 @@
4242
from mig.shared.defaults import freeze_meta_filename, freeze_lock_filename, \
4343
public_archive_index, public_archive_files, public_archive_doi, \
4444
keyword_pending, keyword_final
45+
from mig.shared.freezefunctions import sorted_hash_algos, checksum_file
4546

4647

4748
def fuzzy_match(i, j, offset=2.0):
@@ -110,12 +111,29 @@ def check_archive_integrity(configuration, user_id, freeze_path, verbose=False):
110111
archive_path)
111112
# NOTE: we allow a minor time offset to accept various fs hiccups
112113
elif not fuzzy_match(entry['timestamp'], archived_created) and \
113-
not fuzzy_match(entry['timestamp'], archived_modified):
114+
not fuzzy_match(entry['timestamp'], archived_modified) and \
115+
not fuzzy_match(entry.get('file_mtime', -1), archived_modified):
114116
if meta_state == keyword_final:
115117
print("Archive entry %s has wrong timestamp %f / %f (expected %f, %s)" %
116118
(archive_path, archived_created, archived_modified,
117119
entry['timestamp'], archived_stat))
118-
return False
120+
chksum_verified = False
121+
for algo in sorted_hash_algos:
122+
chksum = entry.get(algo, '')
123+
if not chksum or ' ' in chksum:
124+
continue
125+
print("Checking that %s of %r matches %r" %
126+
(algo, archive_path, chksum))
127+
verify_chksum = checksum_file(archive_path, algo,
128+
max_chunks=-1)
129+
if verify_chksum == chksum:
130+
chksum_verified = True
131+
break
132+
if chksum_verified:
133+
print("Verified that %s of %r matches %r" %
134+
(algo, archive_path, chksum))
135+
else:
136+
return False
119137
elif verbose:
120138
print("ignore ctime mismatch on non-final %s" %
121139
archive_path)

0 commit comments

Comments
 (0)