bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

echo internal command does not check for return status.


From: Pavel Machek
Subject: echo internal command does not check for return status.
Date: Thu, 5 Apr 2001 23:46:37 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu'
-DCO\NF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H  -D_FILE_OFFSET_BITS=64
-I.  -I/home/swt/doko/export/packages/bash/bash-2.03
-I/home/sw\t/doko/export/packages/bash/bash-2.03/lib -I/usr/include -g
-O2
uname output: Linux bug 2.4.3 #515 Thu Apr 5 23:32:22 CEST 2001 i686
unknown
Machine Type: i386-pc-linux-gnu

Bash Version: 2.03
Patch Level: 0
Release Status: release

Description:
        device_PNP0C01 is device that returns failure on each
        write. However, it seems that internal echo from bash
        does not check return values...

Repeat-By:
        root@bug:~# cat /etc/passwd > /proc/power/device_PNP0C01
        cat: write error: Level 3 reset
        root@bug:~# echo `cat /etc/passwd` >
/proc/power/device_PNP0C01
        root@bug:~#

        As you can see on strace bash -c 'echo ahoj >
/proc/power/device_PNP0C01'

fstat(1, {st_mode=0, st_size=0, ...})   = 0
mmap(0, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x40014000
write(1, "ahoj\n", 5)                   = -1 EL3RST (Level 3 reset)
dup2(10, 1)                             = 1
fcntl(10, F_GETFD)                      = 0x1 (flags FD_CLOEXEC)
close(10)                               = 0
munmap(0x40014000, 4096)                = 0
_exit(1)                                = ?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]