PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Jul 30 16:12:58 PDT 2007


 polkit-grant/polkit-grant-helper-pam.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

New commits:
diff-tree 6e2d74cb86e529ab8ec964d6a0f632535fc78a9c (from 1ac3268b7a787d2a9ae641355b80b7f3131bea71)
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Jul 30 19:11:42 2007 -0400

    put back isatty() checks when calling user is not uid 0

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)


More information about the hal-commit mailing list