kov changed libgksu/branches/libgksu2/libgksu/ChangeLog,
libgksu/branches/libgksu2/libgksu/libgksu.c
Gustavo Noronha
kov at costa.debian.org
Sun Apr 23 16:06:28 UTC 2006
Mensagem de log:
enhance behavior of pass_not_needed
-----
Modified: libgksu/branches/libgksu2/libgksu/ChangeLog
===================================================================
--- libgksu/branches/libgksu2/libgksu/ChangeLog 2006-04-23 15:54:54 UTC (rev 555)
+++ libgksu/branches/libgksu2/libgksu/ChangeLog 2006-04-23 16:06:26 UTC (rev 556)
@@ -9,6 +9,9 @@
- use non-blocking read when looking for the sudo prompt,
so that we won't get blocked if there is none; also,
make sure the window is displayed
+ - (su) track that gnome keyring was used to enhance the pass_not_needed
+ display logic; display it parallel to running the command, to match
+ gksu_sudo_full behavior
* libgksu.c:
- only print the password when on debug mode
Modified: libgksu/branches/libgksu2/libgksu/libgksu.c
===================================================================
--- libgksu/branches/libgksu2/libgksu/libgksu.c 2006-04-23 15:54:54 UTC (rev 555)
+++ libgksu/branches/libgksu2/libgksu/libgksu.c 2006-04-23 16:06:26 UTC (rev 556)
@@ -1563,6 +1563,7 @@
gchar *password = NULL;
gchar *cmdline = NULL;
gboolean password_needed = FALSE;
+ gboolean used_gnome_keyring = FALSE;
my_uid = getuid();
pwd = getpwnam (context->user);
@@ -1609,7 +1610,8 @@
fprintf (stderr, "tmp: %s\n", tmp);
if (tmp == NULL)
tmp = ask_pass (context, buf, ask_pass_data, error);
-
+ else
+ used_gnome_keyring = TRUE;
g_return_val_if_fail (tmp != NULL, -1);
usleep (100);
@@ -1618,30 +1620,10 @@
nullify_password (tmp);
write (fdpty, password, strlen(password));
-
password_needed = TRUE;
}
}
- if (!password_needed)
- {
- gboolean should_display;
-
- should_display = gconf_client_get_bool (context->gconf_client,
- BASE_PATH "display-no-pass-info", NULL);
-
- /* configuration tells us to show this message */
- if (should_display)
- {
- if (context->debug)
- fprintf (stderr, "Calling pass_not_needed window...\n");
- pass_not_needed (context, pass_not_needed_data);
- /* make sure it is displayed */
- while (gtk_events_pending ())
- gtk_main_iteration ();
- }
- }
-
if (context->debug)
fprintf (stderr, "DEBUG (run:after-pass) buf: -%s-\n", buf);
if (strncmp (buf, "gksu", 4) && strncmp (buf, "su", 2))
@@ -1717,6 +1699,25 @@
return TRUE;
}
+ if (!password_needed || used_gnome_keyring)
+ {
+ gboolean should_display;
+
+ should_display = gconf_client_get_bool (context->gconf_client,
+ BASE_PATH "display-no-pass-info", NULL);
+
+ /* configuration tells us to show this message */
+ if (should_display)
+ {
+ if (context->debug)
+ fprintf (stderr, "Calling pass_not_needed window...\n");
+ pass_not_needed (context, pass_not_needed_data);
+ /* make sure it is displayed */
+ while (gtk_events_pending ())
+ gtk_main_iteration ();
+ }
+ }
+
FD_ZERO(&rfds);
FD_SET(fdpty, &rfds);
More information about the gksu-commits
mailing list