diff options
author | Denys Vlasenko | 2017-01-26 01:13:58 +0100 |
---|---|---|
committer | Denys Vlasenko | 2017-01-26 01:13:58 +0100 |
commit | 9967c9949e0436879354e76c2847d697c309984c (patch) | |
tree | dcd6b3707305ef43f496a6058da45c89460fda4e /include/libbb.h | |
parent | 06f20bf675cdd415c2f796ebea9fc55030ef49cc (diff) | |
download | busybox-9967c9949e0436879354e76c2847d697c309984c.zip busybox-9967c9949e0436879354e76c2847d697c309984c.tar.gz |
libbb: spawn_and_wait() fflushes before forking NOEXEC; child reinits logmode
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'include/libbb.h')
-rw-r--r-- | include/libbb.h | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/libbb.h b/include/libbb.h index 8c652e2..07fe20d 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -1093,10 +1093,19 @@ pid_t wait_any_nohang(int *wstat) FAST_FUNC; */ int wait4pid(pid_t pid) FAST_FUNC; int wait_for_exitstatus(pid_t pid) FAST_FUNC; +/************************************************************************/ +/* spawn_and_wait/run_nofork_applet/run_applet_no_and_exit need to work */ +/* carefully together to reinit some global state while not disturbing */ +/* other. Be careful if you change them. Consult docs/nofork_noexec.txt */ +/************************************************************************/ /* Same as wait4pid(spawn(argv)), but with NOFORK/NOEXEC if configured: */ int spawn_and_wait(char **argv) FAST_FUNC; /* Does NOT check that applet is NOFORK, just blindly runs it */ int run_nofork_applet(int applet_no, char **argv) FAST_FUNC; +#ifndef BUILD_INDIVIDUAL +extern int find_applet_by_name(const char *name) FAST_FUNC; +extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC; +#endif /* Helpers for daemonization. * @@ -1303,11 +1312,6 @@ const struct hwtype *get_hwtype(const char *name) FAST_FUNC; const struct hwtype *get_hwntype(int type) FAST_FUNC; -#ifndef BUILD_INDIVIDUAL -extern int find_applet_by_name(const char *name) FAST_FUNC; -extern void run_applet_no_and_exit(int a, char **argv) NORETURN FAST_FUNC; -#endif - #ifdef HAVE_MNTENT_H extern int match_fstype(const struct mntent *mt, const char *fstypes) FAST_FUNC; extern struct mntent *find_mount_point(const char *name, int subdir_too) FAST_FUNC; |