gnome-mount r164 - in trunk: . src



Author: davidz
Date: Mon Apr  7 18:01:13 2008
New Revision: 164
URL: http://svn.gnome.org/viewvc/gnome-mount?rev=164&view=rev

Log:
2008-04-07  David Zeuthen  <davidz redhat com>

        * src/gnome-mount.c (main): Don't bring up a passphrase dialog
        if the underlying HAL interface is locked.



Modified:
   trunk/ChangeLog
   trunk/src/gnome-mount.c

Modified: trunk/src/gnome-mount.c
==============================================================================
--- trunk/src/gnome-mount.c	(original)
+++ trunk/src/gnome-mount.c	Mon Apr  7 18:01:13 2008
@@ -2258,7 +2258,7 @@
 		gnome_password_dialog_set_password (GNOME_PASSWORD_DIALOG (dialog), keyring_password);
 	}
 
-	gtk_widget_show (dialog);
+	gtk_window_present (GTK_WINDOW (dialog));
 
 	if (gnome_password_dialog_run_and_block (GNOME_PASSWORD_DIALOG (dialog)))
 	{
@@ -3051,15 +3051,28 @@
                                 if (opt_verbose)
                                         g_message (_("Crypto volume '%s' is already setup with clear volume '%s'"), 
                                                    udi, clear_udi);
-				
+
 				free (clear_udi);
 				goto out;
 			}
-			
+
+                        /* don't prompt for password if the device is locked
+                         * (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=437309 )
+                         */
+                        if (libhal_device_is_locked_by_others (hal_ctx,
+                                                               libhal_volume_get_udi (volume),
+                                                               "org.freedesktop.Hal.Device.Storage",
+                                                               NULL)) {
+                                if (opt_verbose)
+                                        g_message (_("Crypto device %s is locked"),
+                                                   libhal_volume_get_udi (volume));
+                                goto out;
+                        }
+
 			g_debug ("Crypto volume - UDI '%s'", udi);
-			
+
 			setup_success = FALSE;
-			
+
 			/* we need this to catch when the cleartext device is added */
 			crypto_setup_backing_udi = udi;
 			libhal_ctx_set_device_added (hal_ctx, crypto_setup_device_added);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]