aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Ionite <[email protected]>2022-11-16 17:40:27 -0500
committerGravatar Ionite <[email protected]>2022-11-16 17:40:27 -0500
commit3664dfe7e1cc3a9ba70192caa8e0d7dc09b604f1 (patch)
tree6ae1ba44b1d95f5063f447fb0060bde296f6ed17
parentAdd max file limit enforcing (diff)
Sort attachments by name
-rw-r--r--snekbox/nsjail.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py
index 30e6ecd..128172d 100644
--- a/snekbox/nsjail.py
+++ b/snekbox/nsjail.py
@@ -212,7 +212,8 @@ class NsJail:
# Parse attachments
try:
- attachments = list(temp_dir.attachments())
+ # Sort attachments by name lexically
+ attachments = sorted(temp_dir.attachments(), key=lambda a: a.name)
log.info(f"Found {len(attachments)} attachments.")
except AttachmentError as err:
log.error(f"Failed to parse attachments: {err}")