File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -203,6 +203,18 @@ repos:
203
203
always_run : true
204
204
pass_filenames : false
205
205
206
+ # Checks that tests/malware_analyzer/pypi/resources/sourcecode_samples files do not have executable permissions
207
+ # This is another measure to make sure the files can't be accidentally executed
208
+ - repo : local
209
+ hooks :
210
+ - id : sourcecode-sample-permissions
211
+ name : Sourcecode sample executable permissions checker
212
+ entry : scripts/dev_scripts/samples_permissions_checker.sh
213
+ language : system
214
+ always_run : true
215
+ pass_filenames : false
216
+
217
+
206
218
# A linter for Golang
207
219
- repo : https://github.com/golangci/golangci-lint
208
220
rev : v1.61.0
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ # Copyright (c) 2022 - 2025, Oracle and/or its affiliates. All rights reserved.
4
+ # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/.
5
+
6
+ #
7
+ # Checks if the files in tests/malware_analyzer/pypi/resources/sourcecode_samples have executable permissions,
8
+ # failing if any do.
9
+ #
10
+
11
+ MACARON_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && cd ../.. && pwd) "
12
+ SAMPLES_PATH=" ${MACARON_DIR} /tests/malware_analyzer/pypi/resources/sourcecode_samples"
13
+
14
+ # any files have any of the executable bits set
15
+ executables=$( find " $SAMPLES_PATH " -type f -perm -u+x -o -type f -perm -g+x -o -type f -perm -o+x)
16
+ if [ -n " $executables " ]; then
17
+ echo " The following files should not have any executable permissions:"
18
+ echo " $executables "
19
+ exit 1
20
+ fi
You can’t perform that action at this time.
0 commit comments