Skip to content

Commit 227e7ba

Browse files
author
matz
committed
* 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
1 parent d8778fa commit 227e7ba

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

ChangeLog

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Mon Jul 24 17:55:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
2+
3+
* process.c (rb_f_system): add security check. [ruby-talk:202947]
4+
5+
* process.c (rb_f_system): move signal right before fork to avoid
6+
signal handler intervention.
7+
18
Mon Jul 24 15:51:52 2006 Tanaka Akira <akr@fsij.org>
29

310
* ext/readline/readline.c (readline_readline): rl_deprep_term_function

process.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,6 @@ rb_f_system(argc, argv)
14941494
int i;
14951495
RETSIGTYPE (*chfunc)(int);
14961496

1497-
chfunc = signal(SIGCHLD, SIG_DFL);
14981497
fflush(stdout);
14991498
fflush(stderr);
15001499
if (argc == 0) {
@@ -1516,6 +1515,8 @@ rb_f_system(argc, argv)
15161515
for (i = 0; i < argc; i++) {
15171516
SafeStringValue(argv[i]);
15181517
}
1518+
security(RSTRING(prog ? prog : argv[0])->ptr);
1519+
chfunc = signal(SIGCHLD, SIG_DFL);
15191520
retry:
15201521
pid = fork();
15211522
if (pid == 0) {

0 commit comments

Comments
 (0)