aboutsummaryrefslogtreecommitdiff
path: root/coreutils/shred.c
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2018-03-15 09:01:45 +0000
committerRon Yorston <rmy@pobox.com>2018-03-15 09:01:45 +0000
commit94cf1f830d25409ba80b0933075e026e41fe0e3c (patch)
treef3a386872c52bb7c18283a4bca01dade3811d503 /coreutils/shred.c
parent6fe4ad9a6c96624c2b75c0d51b035bc1a71d9eba (diff)
downloadbusybox-w32-94cf1f830d25409ba80b0933075e026e41fe0e3c.tar.gz
busybox-w32-94cf1f830d25409ba80b0933075e026e41fe0e3c.tar.bz2
busybox-w32-94cf1f830d25409ba80b0933075e026e41fe0e3c.zip
win32: restrict visibility of special devices
Handling of the special devices /dev/zero and /dev/urandom was inconsistent: - they could be used as arguments to 'cat' but not 'od'; - they could not be used in shell redirection. Restrict the use of these devices to two places: - as input files to 'dd' with the 'if=' argument; - internally within 'shred'. See GitHub issue #98.
Diffstat (limited to 'coreutils/shred.c')
-rw-r--r--coreutils/shred.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/coreutils/shred.c b/coreutils/shred.c
index 1b65a359e..0ebbc39ca 100644
--- a/coreutils/shred.c
+++ b/coreutils/shred.c
@@ -38,6 +38,10 @@
38 38
39#include "libbb.h" 39#include "libbb.h"
40 40
41#if ENABLE_PLATFORM_MINGW32
42#define xopen mingw_xopen
43#endif
44
41int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; 45int shred_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
42int shred_main(int argc UNUSED_PARAM, char **argv) 46int shred_main(int argc UNUSED_PARAM, char **argv)
43{ 47{