Mercurial Hosting > luan
comparison src/luan/modules/IoLuan.java @ 1128:34dfed3b5cb0
fix security
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 26 Nov 2017 21:16:39 -0700 |
parents | 5c99a3c0f882 |
children | ba4daf107e07 |
comparison
equal
deleted
inserted
replaced
1127:5c99a3c0f882 | 1128:34dfed3b5cb0 |
---|---|
842 } | 842 } |
843 | 843 |
844 public static final class LuanOs extends BaseOs { | 844 public static final class LuanOs extends BaseOs { |
845 private LuanOs(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { | 845 private LuanOs(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { |
846 super(luan,cmd,options); | 846 super(luan,cmd,options); |
847 check(luan,"os:"+cmd); | |
847 this.proc = Runtime.getRuntime().exec(cmd,null,dir); | 848 this.proc = Runtime.getRuntime().exec(cmd,null,dir); |
848 } | 849 } |
849 } | 850 } |
850 | 851 |
851 public static LuanTable os(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { | 852 public static LuanTable os(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { |
853 } | 854 } |
854 | 855 |
855 public static final class LuanBash extends BaseOs { | 856 public static final class LuanBash extends BaseOs { |
856 private LuanBash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { | 857 private LuanBash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { |
857 super(luan,cmd,options); | 858 super(luan,cmd,options); |
859 check(luan,"bash:"+cmd); | |
858 this.proc = Runtime.getRuntime().exec(new String[]{"bash","-c",cmd},null,dir); | 860 this.proc = Runtime.getRuntime().exec(new String[]{"bash","-c",cmd},null,dir); |
859 } | 861 } |
860 } | 862 } |
861 | 863 |
862 public static LuanTable bash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { | 864 public static LuanTable bash(LuanState luan,String cmd,LuanTable options) throws IOException, LuanException { |