aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
committerRon Yorston <rmy@pobox.com>2012-03-22 13:15:08 +0000
commitc0d4367d6b581eb5989c02815880cf0fa2851ae8 (patch)
tree868c266e627e2d7f65ba5a4d5f98a1c421453181 /docs
parentf6bad5ef766b0447158e3de2f55c35f1f6cecb58 (diff)
parentda4441c44f6efccb6f7b7588404d9c6bfb7b6af8 (diff)
downloadbusybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.gz
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.tar.bz2
busybox-w32-c0d4367d6b581eb5989c02815880cf0fa2851ae8.zip
Merge commit 'da4441c44f6efccb6f7b7588404d9c6bfb7b6af8' into merge
Conflicts: libbb/vfork_daemon_rexec.c networking/wget.c procps/ps.c
Diffstat (limited to 'docs')
-rw-r--r--docs/nofork_noexec.txt27
1 files changed, 23 insertions, 4 deletions
diff --git a/docs/nofork_noexec.txt b/docs/nofork_noexec.txt
index 06c789aff..c58f5a83f 100644
--- a/docs/nofork_noexec.txt
+++ b/docs/nofork_noexec.txt
@@ -44,9 +44,11 @@ NOEXEC trick is disabled for NOMMU build.
44 NOFORK 44 NOFORK
45 45
46NOFORK applet should work correctly if another applet simply runs 46NOFORK applet should work correctly if another applet simply runs
47<applet>_main(argc,argv) and then continues with its business (xargs, 47<applet>_main(argc,argv) and then continues with its business.
48find, shells can do it). This poses much more serious limitations 48xargs, find, shells do it (grep for "spawn_and_wait" and
49on what applet can/cannot do: 49"run_nofork_applet" to find more users).
50
51This poses much more serious limitations on what applet can do:
50 52
51* all NOEXEC limitations apply. 53* all NOEXEC limitations apply.
52* do not ever exit() or exec(). 54* do not ever exit() or exec().
@@ -56,7 +58,7 @@ on what applet can/cannot do:
56 is taken from xfunc_error_retval. 58 is taken from xfunc_error_retval.
57 - fflush_stdout_and_exit(n) is ok to use. 59 - fflush_stdout_and_exit(n) is ok to use.
58* do not use shared global data, or save/restore shared global data 60* do not use shared global data, or save/restore shared global data
59 prior to returning. (e.g. bb_common_bufsiz1 is off-limits). 61 (e.g. bb_common_bufsiz1) prior to returning.
60 - getopt32() is ok to use. You do not need to save/restore option_mask32, 62 - getopt32() is ok to use. You do not need to save/restore option_mask32,
61 it is already done by core code. 63 it is already done by core code.
62* if you allocate memory, you can use xmalloc() only on the very first 64* if you allocate memory, you can use xmalloc() only on the very first
@@ -77,3 +79,20 @@ script loops. Applets which mess with signal handlers, termios etc
77are probably not worth the effort. 79are probably not worth the effort.
78 80
79Any NOFORK applet is also a NOEXEC applet. 81Any NOFORK applet is also a NOEXEC applet.
82
83
84 Relevant CONFIG options
85
86FEATURE_PREFER_APPLETS
87 BB_EXECVP(cmd, argv) will try to exec /proc/self/exe
88 if command's name matches some applet name
89 applet tables will contain NOFORK/NOEXEC bits
90 spawn_and_wait(argv) will do NOFORK/NOEXEC tricks
91
92FEATURE_SH_STANDALONE (needs FEATURE_PREFER_APPLETS=y)
93 shells will try to exec /proc/self/exe if command's name matches
94 some applet name
95 shells will do NOEXEC trick on NOEXEC applets
96
97FEATURE_SH_NOFORK (needs FEATURE_PREFER_APPLETS=y)
98 shells will do NOFORK trick on NOFORK applets