copy: symlink sh and tar to busybox

Signed-off-by: Gao feng <omarapazanadi@gmail.com>
This commit is contained in:
Gao feng
2016-04-04 23:22:42 +08:00
parent 01a09c9b8f
commit e737392fc4
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -1272,6 +1272,9 @@ int main(int argc, char *argv[])
return -1;
}
symlink("/busybox", "/sh");
symlink("/busybox", "/tar");
cmdline = read_cmdline();
setsid();
+1 -1
View File
@@ -89,7 +89,7 @@ int hyper_copy_dir(char *src, char *dest) {
return -1;
} else {
char cmd[512];
snprintf(cmd, sizeof(cmd), "tar zcf - -C %s . | tar zfx - -C %s", src, dest);
snprintf(cmd, sizeof(cmd), "/tar cf - -C %s . | /tar fx - -C %s", src, dest);
fprintf(stdout, "command for copy is %s\n", cmd);
execlp("/busybox", "sh", "-c", cmd, NULL);