[Whonix-devel] [Help-bash] How to create a real copy of file descriptors stdout / stderr?

Patrick Schleizer patrick-mailinglists at whonix.org
Tue Feb 28 15:28:00 CET 2017


The following worked for me.

echo "int isatty(int fd) { return 1; }" | gcc -O2 -fpic -shared -ldl -o
"$isatty_so_file" -xc -

LD_PRELOAD+=" $isatty_so_file

LD_PRELOAD="$LD_PRELOAD" apt-get "$@" 2>&1 | tee -a "$logfile"

gcc compilation on the fly seems crazy but was a worthwhile test.

Is there some pre-build command line tool isatty or shared object isatty.so?

For now, ending up using the following.

python -c 'import pty, sys; pty.spawn(sys.argv[1:])' \
   | apt-get "$@" 2>&1 \
   | tee -a "$logfile"



More information about the Whonix-devel mailing list