Page 1 of 1

uuencode: fstat-ing a.txt: Bad file descriptor

Posted: 2020/01/14 17:56:56
by alxdrl
Hi,

Just came across the following problem running uuencode command with stdin closed (CentOS 7.4 / 3.10.0-693.11.6.el7.x86_64) :
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
This did not fail in older versions of CentOS :
uuencode --version
uuencode - GNU sharutils 4.2.1
> a.txt ; uuencode a.txt a.txt <&- ; echo $?
begin 666 a.txt
`
end
0
Yet under CentOS 7.4 strace-ing the command removes the problem, ie :

Code: Select all

#!/bin/bash
> a.txt
exec <&-
uuencode a.txt a.txt
echo $?
yields
uuencode: fstat-ing a.txt: Bad file descriptor
1
whereas

Code: Select all

#!/bin/bash
> a.txt
exec <&-
strace uuencode a.txt a.txt
echo $?
yields
begin 644 a.txt
`
end
0
Any hint about this discrepancies and what might cause this error (beside uuencode version) ?

Cheers,

Re: uuencode: fstat-ing a.txt: Bad file descriptor

Posted: 2020/01/14 20:15:07
by TrevorH
You are more than 3 years out of date. Run yum update to get current on the only supported version which is 7.7.

Re: uuencode: fstat-ing a.txt: Bad file descriptor

Posted: 2020/01/14 22:24:58
by alxdrl
Hi,

I’m OK with the advice, but I’m not looking for a fix.

I’m looking for input here as to the diagnosis of this error :-)

Thanks.