We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ec362cf commit 490dbf7Copy full SHA for 490dbf7
1 file changed
cms/grading/Sandbox.py
@@ -902,11 +902,13 @@ def detect_box_executable(self):
902
'..', '..', 'isolate', self.exec_name))]
903
paths += [self.exec_name]
904
for path in paths:
905
- # Consider only non-directory, executable files.
+ # Consider only non-directory, executable files with SUID flag on.
906
if os.path.exists(path) \
907
and not os.path.isdir(path) \
908
and os.access(path, os.X_OK):
909
- return path
+ st = os.stat(path)
910
+ if st.st_mode & stat.S_ISUID != 0:
911
+ return path
912
913
# As default, return self.exec_name alone, that means that
914
# system path is used.
0 commit comments