sudo/sudo-1.8.3-pipelist.patch

29 lines
641 B
Diff
Raw Normal View History

diff -up sudo-1.8.3/src/ttysize.c.pipelist sudo-1.8.3/src/ttysize.c
--- sudo-1.8.3/src/ttysize.c.pipelist 2011-10-21 15:01:26.000000000 +0200
+++ sudo-1.8.3/src/ttysize.c 2011-10-26 02:09:39.582790562 +0200
@@ -20,6 +20,7 @@
#include <sys/types.h>
#include <sys/ioctl.h>
+#include <sys/stat.h>
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
@@ -48,6 +49,16 @@ void
get_ttysize(int *rowp, int *colp)
{
char *p;
+ struct stat st;
+
+ if (fstat(STDOUT_FILENO, &st) == 0) {
+ if (S_ISFIFO(st.st_mode)) {
+ *rowp = 0;
+ *colp = 0;
+ return;
+ }
+ }
+
#ifdef TIOCGWINSZ
struct winsize wsize;