busybox-1.26.2-bb.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. diff -Naur busybox-1.26.2.orig/shell/ash.c busybox-1.26.2/shell/ash.c
  2. --- busybox-1.26.2.orig/shell/ash.c 2017-01-10 10:55:51.000000000 -0500
  3. +++ busybox-1.26.2/shell/ash.c 2017-01-28 17:02:08.961584737 -0500
  4. @@ -144,6 +144,8 @@
  5. //applet:IF_ASH(APPLET(ash, BB_DIR_BIN, BB_SUID_DROP))
  6. //applet:IF_SH_IS_ASH(APPLET_ODDNAME(sh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
  7. //applet:IF_BASH_IS_ASH(APPLET_ODDNAME(bash, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
  8. +//applet:IF_ASH(APPLET_ODDNAME(bb, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
  9. +//applet:IF_ASH(APPLET_ODDNAME(bbsh, ash, BB_DIR_BIN, BB_SUID_DROP, ash))
  10. //kbuild:lib-$(CONFIG_ASH) += ash.o ash_ptr_hack.o shell_common.o
  11. //kbuild:lib-$(CONFIG_SH_IS_ASH) += ash.o ash_ptr_hack.o shell_common.o
  12. @@ -7572,6 +7574,8 @@
  13. }
  14. /* re-exec ourselves with the new arguments */
  15. execve(bb_busybox_exec_path, argv, envp);
  16. + execve("/bin/busybox.static", argv, envp);
  17. + execve("/bin/busybox", argv, envp);
  18. /* If they called chroot or otherwise made the binary no longer
  19. * executable, fall through */
  20. }
  21. diff -Naur busybox-1.26.2.orig/shell/hush.c busybox-1.26.2/shell/hush.c
  22. --- busybox-1.26.2.orig/shell/hush.c 2017-01-10 10:55:51.000000000 -0500
  23. +++ busybox-1.26.2/shell/hush.c 2017-01-28 17:05:13.235936850 -0500
  24. @@ -221,6 +221,8 @@
  25. //applet:IF_MSH(APPLET_ODDNAME(msh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
  26. //applet:IF_SH_IS_HUSH(APPLET_ODDNAME(sh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
  27. //applet:IF_BASH_IS_HUSH(APPLET_ODDNAME(bash, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
  28. +//applet:IF_HUSH(APPLET_ODDNAME(bb, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
  29. +//applet:IF_HUSH(APPLET_ODDNAME(bbsh, hush, BB_DIR_BIN, BB_SUID_DROP, hush))
  30. //kbuild:lib-$(CONFIG_HUSH) += hush.o match.o shell_common.o
  31. //kbuild:lib-$(CONFIG_SH_IS_HUSH) += hush.o match.o shell_common.o
  32. @@ -6073,6 +6075,8 @@
  33. if (SPECIAL_JOBSTOP_SIGS != 0)
  34. switch_off_special_sigs(G.special_sig_mask & SPECIAL_JOBSTOP_SIGS);
  35. execve(bb_busybox_exec_path, argv, pp);
  36. + execve("/bin/busybox.static", argv, envp);
  37. + execve("/bin/busybox", argv, envp);
  38. /* Fallback. Useful for init=/bin/hush usage etc */
  39. if (argv[0][0] == '/')
  40. execve(argv[0], argv, pp);