sudo/sudo-1.8.6-pipelist.patch
Daniel Kopecek 41b07d49de Update to 1.8.6
- dropped SSSD patches as they are now part of the upstream source code
 - use the upstream version of -pipelist patch
2012-09-06 14:41:27 +02:00

32 lines
1.1 KiB
Diff

diff -up sudo-1.8.6/plugins/sudoers/sudo_nss.c.pipelist sudo-1.8.6/plugins/sudoers/sudo_nss.c
--- sudo-1.8.6/plugins/sudoers/sudo_nss.c.pipelist 2012-09-06 14:27:34.467290727 +0200
+++ sudo-1.8.6/plugins/sudoers/sudo_nss.c 2012-09-06 14:27:39.877315395 +0200
@@ -18,6 +18,8 @@
#include <sys/types.h>
#include <sys/param.h>
+#include <sys/stat.h>
+
#include <stdio.h>
#ifdef STDC_HEADERS
# include <stdlib.h>
@@ -257,11 +259,15 @@ display_privs(struct sudo_nss_list *snl,
{
struct sudo_nss *nss;
struct lbuf defs, privs;
- int count, olen;
+ struct stat sb;
+ int cols, count, olen;
debug_decl(display_privs, SUDO_DEBUG_NSS)
- lbuf_init(&defs, output, 4, NULL, sudo_user.cols);
- lbuf_init(&privs, output, 4, NULL, sudo_user.cols);
+ cols = sudo_user.cols;
+ if (fstat(STDOUT_FILENO, &sb) == 0 && S_ISFIFO(sb.st_mode))
+ cols = 0;
+ lbuf_init(&defs, output, 4, NULL, cols);
+ lbuf_init(&privs, output, 4, NULL, cols);
/* Display defaults from all sources. */
lbuf_append(&defs, _("Matching Defaults entries for %s on this host:\n"),