Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162916174
D34622.id104290.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
951 B
Referenced Files
None
Subscribers
None
D34622.id104290.diff
View Options
Index: sbin/init/init.c
===================================================================
--- sbin/init/init.c
+++ sbin/init/init.c
@@ -1047,7 +1047,7 @@
struct sigaction sa;
char* sh_argv[3 + SCRIPT_ARGV_SIZE];
const char *shell, *script;
- int error, sh_argv_id;
+ int error, sh_argv_len, i;
bzero(&sa, sizeof(sa));
sigemptyset(&sa.sa_mask);
@@ -1079,16 +1079,16 @@
shell = get_shell();
sh_argv[0] = __DECONST(char*, shell);
- sh_argv_id = 1;
+ sh_argv_len = 1;
#ifdef SECURE
- if (strcmp(shell, _PATH_BSHELL) == 0)
- {
+ if (strcmp(shell, _PATH_BSHELL) == 0) {
sh_argv[1] = __DECONST(char*, "-o");
sh_argv[2] = __DECONST(char*, "verify");
- sh_argv_id = 3;
+ sh_argv_len = 3;
}
#endif
- memcpy(sh_argv + sh_argv_id, argv, sizeof(char*)*SCRIPT_ARGV_SIZE);
+ for (i = 0; i != SCRIPT_ARGV_SIZE; ++i)
+ sh_argv[i + sh_argv_len] = argv[i];
execv(shell, sh_argv);
stall("can't exec %s for %s: %m", shell, script);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 6:53 AM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35224966
Default Alt Text
D34622.id104290.diff (951 B)
Attached To
Mode
D34622: init: allow to start script executions with sh -o verify
Attached
Detach File
Event Timeline
Log In to Comment