adjtimex: make it NOFORK

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2017-08-06 20:00:21 +02:00
parent c8e29317e9
commit ed7d118dd0
2 changed files with 7 additions and 2 deletions

View File

@ -39,7 +39,7 @@ acpid - daemon
add-shell add-shell
addgroup addgroup
adduser adduser
adjtimex adjtimex - NOFORK
ar - runner ar - runner
arch - NOFORK arch - NOFORK
arp - complex, rare arp - complex, rare

View File

@ -18,7 +18,7 @@
//config: Adjtimex reads and optionally sets adjustment parameters for //config: Adjtimex reads and optionally sets adjustment parameters for
//config: the Linux clock adjustment algorithm. //config: the Linux clock adjustment algorithm.
//applet:IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) //applet:IF_ADJTIMEX(APPLET_NOFORK(adjtimex, adjtimex, BB_DIR_SBIN, BB_SUID_DROP, adjtimex))
//kbuild:lib-$(CONFIG_ADJTIMEX) += adjtimex.o //kbuild:lib-$(CONFIG_ADJTIMEX) += adjtimex.o
@ -116,6 +116,11 @@ int adjtimex_main(int argc UNUSED_PARAM, char **argv)
txc.modes |= ADJ_TICK; txc.modes |= ADJ_TICK;
} }
/* It's NOFORK applet because the code is very simple:
* just some printf. No opens, no allocs.
* If you need to make it more complex, feel free to downgrade to NOEXEC
*/
ret = adjtimex(&txc); ret = adjtimex(&txc);
if (ret < 0) if (ret < 0)
bb_perror_nomsg_and_die(); bb_perror_nomsg_and_die();