From 23a736a4f06cabf9c1f1b57fd6bd7b4fabc8ca08 Mon Sep 17 00:00:00 2001 From: "R. David Murray" Date: Tue, 7 Jul 2009 01:06:13 +0000 Subject: 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. --- Python/import.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Python/import.c') diff --git a/Python/import.c b/Python/import.c index 88aced06d1..46a1acc6a2 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) { -- cgit v1.2.1