summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-24 09:28:15 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-07-24 09:28:15 +0000
commit227e7ba29cf0a029845136cadee989b6a1bb85ed (patch)
tree5a343eda29f4890682caa3e91b8bab4865a7ca09 /process.c
parentd8778faa2c9e6fcc4d7bce4aaf0016496efa81df (diff)
* process.c (rb_f_system): add security check. [ruby-talk:202947]
* process.c (rb_f_system): move signal right before fork to avoid signal handler intervention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/process.c b/process.c
index 4271c2f..7672097 100644
--- a/process.c
+++ b/process.c
@@ -1494,7 +1494,6 @@ rb_f_system(argc, argv)
int i;
RETSIGTYPE (*chfunc)(int);
- chfunc = signal(SIGCHLD, SIG_DFL);
fflush(stdout);
fflush(stderr);
if (argc == 0) {
@@ -1516,6 +1515,8 @@ rb_f_system(argc, argv)
for (i = 0; i < argc; i++) {
SafeStringValue(argv[i]);
}
+ security(RSTRING(prog ? prog : argv[0])->ptr);
+ chfunc = signal(SIGCHLD, SIG_DFL);
retry:
pid = fork();
if (pid == 0) {