dont printf arguments given by user for security sanity

This commit is contained in:
Mike Frysinger 2006-03-23 02:07:20 +00:00
parent 64bef2ab9c
commit 948a09d6f2
4 changed files with 4 additions and 4 deletions

View File

@ -100,7 +100,7 @@ int watch_main(int argc, char **argv)
//child //child
dup2(old_stdout, STDOUT_FILENO); dup2(old_stdout, STDOUT_FILENO);
execvp(*watched_argv, watched_argv); execvp(*watched_argv, watched_argv);
bb_perror_msg_and_die(*watched_argv); bb_perror_msg_and_die("%s", *watched_argv);
} else { } else {
bb_perror_msg_and_die("vfork"); bb_perror_msg_and_die("vfork");
} }

View File

@ -64,7 +64,7 @@ int mountpoint_main(int argc, char **argv)
} }
} }
if (!(opt & OPT_q)) if (!(opt & OPT_q))
bb_perror_msg(arg); bb_perror_msg("%s", arg);
return EXIT_FAILURE; return EXIT_FAILURE;
} }
} }

View File

@ -41,6 +41,6 @@ setsid_main(int argc, char *argv[]) {
execvp(argv[1], argv + 1); execvp(argv[1], argv + 1);
bb_perror_msg_and_die(argv[1]); bb_perror_msg_and_die("%s", argv[1]);
} }

View File

@ -85,7 +85,7 @@ int fdformat_main(int argc,char **argv)
/* R_OK is needed for verifying */ /* R_OK is needed for verifying */
if (stat(*argv,&st) < 0 || access(*argv,W_OK | R_OK ) < 0) { if (stat(*argv,&st) < 0 || access(*argv,W_OK | R_OK ) < 0) {
bb_perror_msg_and_die(*argv); bb_perror_msg_and_die("%s",*argv);
} }
if (!S_ISBLK(st.st_mode)) { if (!S_ISBLK(st.st_mode)) {
bb_error_msg_and_die("%s: not a block device",*argv); bb_error_msg_and_die("%s: not a block device",*argv);