summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
authorR. David Murray <rdmurray@bitdance.com>2009-07-07 01:06:13 (GMT)
committerR. David Murray <rdmurray@bitdance.com>2009-07-07 01:06:13 (GMT)
commit23a736a4f06cabf9c1f1b57fd6bd7b4fabc8ca08 (patch)
tree8240215ab40961077fa9e95925677cbb2381c315 /Python/import.c
parente670e5ad5b7ef6b464fb264b688d96b9b9f71b53 (diff)
downloadcpython-23a736a4f06cabf9c1f1b57fd6bd7b4fabc8ca08.zip
cpython-23a736a4f06cabf9c1f1b57fd6bd7b4fabc8ca08.tar.gz
cpython-23a736a4f06cabf9c1f1b57fd6bd7b4fabc8ca08.tar.bz2
Issue 6070: when creating a compiled file, after copying the mode bits, on
posix zap the execute bit in case it was set on the .py file, since the compiled files are not directly executable on posix. Patch by Marco N.
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index 88aced0..46a1acc6 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -881,7 +881,9 @@ write_compiled_module(PyCodeObject *co, char *cpathname, struct stat *srcstat)
{
FILE *fp;
time_t mtime = srcstat->st_mtime;
- mode_t mode = srcstat->st_mode;
+#ifndef MS_WINDOWS
+ mode_t mode = srcstat->st_mode & ~S_IXUSR & ~S_IXGRP & ~S_IXOTH;
+#endif
fp = open_exclusive(cpathname, mode);
if (fp == NULL) {