From 6e2d74cb86e529ab8ec964d6a0f632535fc78a9c Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Mon, 30 Jul 2007 19:11:42 -0400 Subject: [PATCH] put back isatty() checks when calling user is not uid 0 --- polkit-grant/polkit-grant-helper-pam.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/polkit-grant/polkit-grant-helper-pam.c b/polkit-grant/polkit-grant-helper-pam.c index 16d53cb..6295434 100644 --- a/polkit-grant/polkit-grant-helper-pam.c +++ b/polkit-grant/polkit-grant-helper-pam.c @@ -71,14 +71,14 @@ main (int argc, char *argv[]) goto error; } -#if 0 - /* check we're running with a non-tty stdin */ - if (isatty (STDIN_FILENO) != 0) { - syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ()); - fprintf (stderr, "polkit-grant-helper-pam: inappropriate use of helper, stdin is a tty. This incident has been logged.\n"); - goto error; + if (getuid () != 0) { + /* check we're running with a non-tty stdin */ + if (isatty (STDIN_FILENO) != 0) { + syslog (LOG_NOTICE, "inappropriate use of helper, stdin is a tty [uid=%d]", getuid ()); + fprintf (stderr, "polkit-grant-helper-pam: inappropriate use of helper, stdin is a tty. This incident has been logged.\n"); + goto error; + } } -#endif /* get user to auth */ if (fgets (user_to_auth, sizeof user_to_auth, stdin) == NULL) -- 2.7.4