diff --git a/std-script/compile b/std-script/compile --- a/std-script/compile +++ b/std-script/compile @@ -147,20 +147,22 @@ end when "python" - command = "#{PYTHON_CHECKER} #{params[:source_file]}" - if system(command, out: params[:message_file]) + #command = "#{PYTHON_CHECKER} #{params[:source_file]}" + #if system(command, out: params[:message_file]) #compile to python bytecode command = "#{PYTHON_INTERPRETER} -c \"import py_compile; py_compile.compile('#{params[:source_file]}','#{params[:source_file]}c');\"" puts "compile: #{command}" - system(command) - puts "pwd: " + Dir.pwd - Dir.new('.').each {|file| puts file} - File.open(params[:output_file],"w") do |out_file| - out_file.puts "#!#{PYTHON_INTERPRETER} #{params[:source_file]}c" + system(command, err: params[:message_file]) + if FileTest.exists?("#{params[:source_file]}c") + puts "pwd: " + Dir.pwd + Dir.new('.').each {|file| puts file} + File.open(params[:output_file],"w") do |out_file| + out_file.puts "#!#{PYTHON_INTERPRETER} #{params[:source_file]}c" + end + File.chmod(0755, params[:output_file]) + FileUtils.cp("#{params[:source_file]}c",params[:output_file]) end - File.chmod(0755, params[:output_file]) - FileUtils.cp("#{params[:source_file]}c",params[:output_file]) - end + #end when "php" command = "#{PHP_INTERPRETER} #{PHP_OPTIONS} #{params[:source_file]}" diff --git a/std-script/run b/std-script/run --- a/std-script/run +++ b/std-script/run @@ -92,7 +92,7 @@ JAVA_OPTION = "-s set_robust_list -s futex -s clone -s getppid -s clone -s wait4 -p /usr/bin/ -p ./" RUBY_OPTION = "-p /usr/lib64/ -p /usr/local/lib64/ -p /usr/local/lib/ -p /lib64/ -p /dev/urandom -p #{sandbox_dir}/#{program_name} -p #{sandbox_dir}/ -s set_robust_list -s sched_getaffinity -s clock_gettime -s sigaltstack -s pipe2 -s clone -s futex -s openat -s pipe" -PYTHON_OPTION = "-p /usr/lib64/ -p /usr/local/lib64/ -p /usr/local/lib/ -p /usr/bin/ -p /lib64/ -p /dev/urandom -p /usr/ -p #{sandbox_dir}/#{program_name} -p ./#{program_name} -p #{sandbox_dir}/#{source_name} -p /proc/sys/crypto/fips_enabled -p /proc/mounts -p /var/lib/dpkg/status -s statfs -s set_robust_list -s openat -s sysinfo -s recvmsg -s connect -s socket -s sendto -s futex -s sigaltstack -E PYTHONNOUSERSITE=yes" +PYTHON_OPTION = "-p /usr/lib64/ -p /usr/local/lib64/ -p /usr/local/lib/ -p /usr/bin/ -p /lib64/ -p /dev/urandom -p /usr/ -p #{sandbox_dir}/#{program_name} -p ./#{program_name} -p #{sandbox_dir}/#{source_name} -p /proc/sys/crypto/fips_enabled -p /proc/self/status -p /proc/mounts -p /var/lib/dpkg/status -s statfs -s set_robust_list -s openat -s sysinfo -s recvmsg -s connect -s socket -s sendto -s futex -s sigaltstack -E PYTHONNOUSERSITE=yes" PHP_OPTION = "-p /usr/lib64/ -p/lib64/ -p /usr/bin/ -p #{sandbox_dir}/#{program_name} -p ./#{program_name} -p /usr/share/ -s setfsuid -s setfsgid -s openat -s set_robust_list -s futex -s clone -s socket -s connect" HASKELL_OPTION = "-s set_robust_list -s clock_gettime -s sysinfo -s timer_create -s timer_settime -s futex -s timer_delete"