diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 20:00:21 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-06 20:00:21 +0200 |
commit | ed7d118dd0cfda7be21dafae5eb34b0d419f62ec (patch) | |
tree | 6a4fd35b659132b16f4c2823eb660b1b9d3954de | |
parent | c8e29317e97ee595a66314275c163a5ce55fcca9 (diff) | |
download | busybox-w32-ed7d118dd0cfda7be21dafae5eb34b0d419f62ec.tar.gz busybox-w32-ed7d118dd0cfda7be21dafae5eb34b0d419f62ec.tar.bz2 busybox-w32-ed7d118dd0cfda7be21dafae5eb34b0d419f62ec.zip |
adjtimex: make it NOFORK
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | NOFORK_NOEXEC.lst | 2 | ||||
-rw-r--r-- | miscutils/adjtimex.c | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst index 99af24357..97b7d8b20 100644 --- a/NOFORK_NOEXEC.lst +++ b/NOFORK_NOEXEC.lst | |||
@@ -39,7 +39,7 @@ acpid - daemon | |||
39 | add-shell | 39 | add-shell |
40 | addgroup | 40 | addgroup |
41 | adduser | 41 | adduser |
42 | adjtimex | 42 | adjtimex - NOFORK |
43 | ar - runner | 43 | ar - runner |
44 | arch - NOFORK | 44 | arch - NOFORK |
45 | arp - complex, rare | 45 | arp - complex, rare |
diff --git a/miscutils/adjtimex.c b/miscutils/adjtimex.c index a39c4f5cf..ce6f8ccd8 100644 --- a/miscutils/adjtimex.c +++ b/miscutils/adjtimex.c | |||
@@ -18,7 +18,7 @@ | |||
18 | //config: Adjtimex reads and optionally sets adjustment parameters for | 18 | //config: Adjtimex reads and optionally sets adjustment parameters for |
19 | //config: the Linux clock adjustment algorithm. | 19 | //config: the Linux clock adjustment algorithm. |
20 | 20 | ||
21 | //applet:IF_ADJTIMEX(APPLET(adjtimex, BB_DIR_SBIN, BB_SUID_DROP)) | 21 | //applet:IF_ADJTIMEX(APPLET_NOFORK(adjtimex, adjtimex, BB_DIR_SBIN, BB_SUID_DROP, adjtimex)) |
22 | 22 | ||
23 | //kbuild:lib-$(CONFIG_ADJTIMEX) += adjtimex.o | 23 | //kbuild:lib-$(CONFIG_ADJTIMEX) += adjtimex.o |
24 | 24 | ||
@@ -116,6 +116,11 @@ int adjtimex_main(int argc UNUSED_PARAM, char **argv) | |||
116 | txc.modes |= ADJ_TICK; | 116 | txc.modes |= ADJ_TICK; |
117 | } | 117 | } |
118 | 118 | ||
119 | /* It's NOFORK applet because the code is very simple: | ||
120 | * just some printf. No opens, no allocs. | ||
121 | * If you need to make it more complex, feel free to downgrade to NOEXEC | ||
122 | */ | ||
123 | |||
119 | ret = adjtimex(&txc); | 124 | ret = adjtimex(&txc); |
120 | if (ret < 0) | 125 | if (ret < 0) |
121 | bb_perror_nomsg_and_die(); | 126 | bb_perror_nomsg_and_die(); |