diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-12-12 00:34:15 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-12-12 00:34:15 +0100 |
commit | c7b90dc4d10ccc4f95940f42676ff907cee73272 (patch) | |
tree | 7f307fce713ba066afb78a256efe1c6b62962a72 /coreutils | |
parent | 27df6aeef2d0d4b726a8b3b1ce1b1cafbbce3431 (diff) | |
download | busybox-w32-c7b90dc4d10ccc4f95940f42676ff907cee73272.tar.gz busybox-w32-c7b90dc4d10ccc4f95940f42676ff907cee73272.tar.bz2 busybox-w32-c7b90dc4d10ccc4f95940f42676ff907cee73272.zip |
uudecode: special-case "/dev/stdout", closes 14241
function old new delta
uudecode_main 295 322 +27
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/uudecode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index a607977e9..e90902f52 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c | |||
@@ -155,7 +155,16 @@ int uudecode_main(int argc UNUSED_PARAM, char **argv) | |||
155 | break; | 155 | break; |
156 | } | 156 | } |
157 | dst_stream = stdout; | 157 | dst_stream = stdout; |
158 | if (NOT_LONE_DASH(outname)) { | 158 | if (NOT_LONE_DASH(outname) |
159 | /* https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uudecode.html | ||
160 | * https://pubs.opengroup.org/onlinepubs/9699919799/utilities/uuencode.html | ||
161 | * The above says that output file name specified in input file | ||
162 | * or overridden by -o OUTFILE can be special "/dev/stdout" string. | ||
163 | * This usually works "implicitly": many systems have /dev/stdout. | ||
164 | * If ENABLE_DESKTOP, support that explicitly: | ||
165 | */ | ||
166 | && (!ENABLE_DESKTOP || strcmp(outname, "/dev/stdout") != 0) | ||
167 | ) { | ||
159 | dst_stream = xfopen_for_write(outname); | 168 | dst_stream = xfopen_for_write(outname); |
160 | fchmod(fileno(dst_stream), mode & (S_IRWXU | S_IRWXG | S_IRWXO)); | 169 | fchmod(fileno(dst_stream), mode & (S_IRWXU | S_IRWXG | S_IRWXO)); |
161 | } | 170 | } |