Just came across the following problem running uuencode command with stdin closed (CentOS 7.4 / 3.10.0-693.11.6.el7.x86_64) :
This did not fail in older versions of CentOS :uuencode --version
uuencode (GNU sharutils) 4.13.3
> a.txt ; uuencode a.txt a.txt <&- ; echo $?
uuencode: fstat-ing a.txt: Bad file descriptor
1
Yet under CentOS 7.4 strace-ing the command removes the problem, ie :uuencode --version
uuencode - GNU sharutils 4.2.1
> a.txt ; uuencode a.txt a.txt <&- ; echo $?
begin 666 a.txt
`
end
0
Code: Select all
#!/bin/bash
> a.txt
exec <&-
uuencode a.txt a.txt
echo $?
whereasuuencode: fstat-ing a.txt: Bad file descriptor
1
Code: Select all
#!/bin/bash
> a.txt
exec <&-
strace uuencode a.txt a.txt
echo $?
Any hint about this discrepancies and what might cause this error (beside uuencode version) ?begin 644 a.txt
`
end
0
Cheers,