diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-04-10 15:43:37 +0000 |
commit | 99912ca733dd960f5589227fd999c86e73c8e894 (patch) | |
tree | 9df947fc08884d498cf76a02204d74b121064134 /libbb/copyfd.c | |
parent | ff131b980d524a33d8a43cefe65e14f64a43f2da (diff) | |
download | busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.gz busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.tar.bz2 busybox-w32-99912ca733dd960f5589227fd999c86e73c8e894.zip |
audit small applets and mark some of them as NOFORK.
Put big scary warnings in relevant places.
Diffstat (limited to 'libbb/copyfd.c')
-rw-r--r-- | libbb/copyfd.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c index 805b80187..e0596d5f6 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c | |||
@@ -7,19 +7,15 @@ | |||
7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. | 7 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include <errno.h> | ||
11 | #include <stdlib.h> | ||
12 | #include <string.h> | ||
13 | #include <unistd.h> | ||
14 | |||
15 | #include "libbb.h" | 10 | #include "libbb.h" |
16 | 11 | ||
17 | |||
18 | #if BUFSIZ < 4096 | 12 | #if BUFSIZ < 4096 |
19 | #undef BUFSIZ | 13 | #undef BUFSIZ |
20 | #define BUFSIZ 4096 | 14 | #define BUFSIZ 4096 |
21 | #endif | 15 | #endif |
22 | 16 | ||
17 | /* Used by NOFORK applets (e.g. cat) - must be very careful | ||
18 | * when calling xfuncs, allocating memory, with signals, termios, etc... */ | ||
23 | 19 | ||
24 | static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) | 20 | static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) |
25 | { | 21 | { |
@@ -27,7 +23,8 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) | |||
27 | off_t total = 0; | 23 | off_t total = 0; |
28 | RESERVE_CONFIG_BUFFER(buffer, BUFSIZ); | 24 | RESERVE_CONFIG_BUFFER(buffer, BUFSIZ); |
29 | 25 | ||
30 | if (src_fd < 0) goto out; | 26 | if (src_fd < 0) |
27 | goto out; | ||
31 | 28 | ||
32 | if (!size) { | 29 | if (!size) { |
33 | size = BUFSIZ; | 30 | size = BUFSIZ; |