diff -up sudo-1.8.5rc5/common/ttysize.c.pipelist sudo-1.8.5rc5/common/ttysize.c --- sudo-1.8.5rc5/common/ttysize.c.pipelist 2012-04-06 21:43:19.000000000 +0200 +++ sudo-1.8.5rc5/common/ttysize.c 2012-05-16 13:03:17.184034854 +0200 @@ -20,6 +20,7 @@ #include #include +#include #include #ifdef STDC_HEADERS # include @@ -71,8 +72,17 @@ get_ttysize_ioctl(int *rowp, int *colp) void get_ttysize(int *rowp, int *colp) { + struct stat st; debug_decl(fork_cmnd, SUDO_DEBUG_EXEC) + if (fstat(STDOUT_FILENO, &st) == 0) { + if (S_ISFIFO(st.st_mode)) { + *rowp = 0; + *colp = 0; + return; + } + } + if (get_ttysize_ioctl(rowp, colp) == -1) { char *p;