Bug 231841 - Multiple encrypted partitions: password prompt needs additional info
Summary: Multiple encrypted partitions: password prompt needs additional info
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gnome-mount
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: David Zeuthen
QA Contact:
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-12 14:51 UTC by Tom London
Modified: 2013-03-06 03:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-04-16 22:28:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
dialog box with added device file name (22.71 KB, image/png)
2008-04-13 18:18 UTC, Tom London
no flags Details

Description Tom London 2007-03-12 14:51:19 UTC
Description of problem:
gnome-mount prompts for LUKS passphrases, YEA!!!!

However, if I insert a USB drive with multiple encrypted partitions, I get
multiple passphrase dialog boxes, none of which indicate which partition they
refer to.

Something in this dialog prompt should indicate what partition... no?

Version-Release number of selected component (if applicable):
gnome-mount-0.5-3.fc7

How reproducible:
Every time

Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Bug Zapper 2008-04-03 23:39:57 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 2 Tom London 2008-04-03 23:47:46 UTC
This continues in current Rawhide.

Multiple encrypted partitions provide the identical prompt for passwords: they
do not include partition information, only drive information.

Comment 3 Tom London 2008-04-03 23:48:34 UTC
Thought I clicked "I am providing requested..."

Comment 4 Tom London 2008-04-13 18:17:37 UTC
How about this patch for starters?

--- gnome-mount.c	2008-04-13 11:10:02.000000000 -0700
+++ gnome-mount.c.new	2008-04-13 11:10:56.000000000 -0700
@@ -2230,7 +2230,7 @@
 	notify_parent (TRUE);
 
 	prompt = g_strdup_printf (
-		_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
+		_("The storage device %s contains encrypted data. Enter a password to unlock
%s."), drive_name, get_dev_file (volume, drive));
 	
 	dialog = gnome_password_dialog_new (_("Unlock Encrypted Data"), prompt, NULL,
NULL, FALSE);
 	g_free (prompt);

Apologize if I have the diff backwards.

I've tested this on my system and this appears to add the dev-name for the Luks
partition being mounted.  This is a start.

I'll attach below a screenshot of the new dialog box.

Comment 5 Tom London 2008-04-13 18:18:36 UTC
Created attachment 302279 [details]
dialog box with added device file name

This is better......

Comment 6 Tom London 2008-04-13 22:24:32 UTC
This patch also includes the device file name in the title bar:

--- gnome-mount.c-old	2008-04-13 11:14:25.000000000 -0700
+++ gnome-mount.c	2008-04-13 15:21:12.000000000 -0700
@@ -2152,6 +2152,7 @@
 	char            *drive_name;
 	char            *result;
 	char            *prompt;
+	char            *title;
 	GtkWidget	*dialog;
 	GnomePasswordDialogRemember remember;
 	char            *keyring_password;
@@ -2230,9 +2231,12 @@
 	notify_parent (TRUE);
 
 	prompt = g_strdup_printf (
-		_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
+		_("The storage device %s contains encrypted data. Enter a password to unlock
%s."), drive_name, get_dev_file (volume, drive));
 	
-	dialog = gnome_password_dialog_new (_("Unlock Encrypted Data"), prompt, NULL,
NULL, FALSE);
+	title = g_strdup_printf (
+		_("Unlock Encrypted Data for %s"), get_dev_file (volume, drive));
+	dialog = gnome_password_dialog_new (title, prompt, NULL, NULL, FALSE);
+	g_free (title);
 	g_free (prompt);
 
 	gnome_password_dialog_set_show_username (GNOME_PASSWORD_DIALOG (dialog), FALSE);


Comment 7 David Zeuthen 2008-04-13 22:46:38 UTC
I don't think displaying some random device name is very user friendly. Rather,
I think displaying the partition number is a lot better. This is in
volume.partition.number. And remember to check for volume.is_partition==FALSE as
well.

Comment 8 Tom London 2008-04-14 00:05:03 UTC
Thanks for the improvements.

Not sure this is completely good, but....:

--- gnome-mount.c-old	2008-04-13 11:14:25.000000000 -0700
+++ gnome-mount.c	2008-04-13 16:58:54.000000000 -0700
@@ -2152,6 +2152,7 @@
 	char            *drive_name;
 	char            *result;
 	char            *prompt;
+	char            *title;
 	GtkWidget	*dialog;
 	GnomePasswordDialogRemember remember;
 	char            *keyring_password;
@@ -2229,10 +2230,22 @@
 	 */
 	notify_parent (TRUE);
 
-	prompt = g_strdup_printf (
-		_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
+	if (libhal_volume_is_partition(volume)==FALSE) {
+		prompt = g_strdup_printf (
+			_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
 	
-	dialog = gnome_password_dialog_new (_("Unlock Encrypted Data"), prompt, NULL,
NULL, FALSE);
+		title = g_strdup (
+			_("Unlock Encrypted Data"));
+	} else {
+		prompt = g_strdup_printf (
+			_("The storage device %s contains encrypted data. Enter a password to unlock
partition %u."), drive_name, libhal_volume_get_partition_number(volume));
+	
+		title = g_strdup_printf (
+			_("Unlock Encrypted Data for partition %d"),
libhal_volume_get_partition_number(volume));
+	}
+
+	dialog = gnome_password_dialog_new (title, prompt, NULL, NULL, FALSE);
+	g_free (title);
 	g_free (prompt);
 
 	gnome_password_dialog_set_show_username (GNOME_PASSWORD_DIALOG (dialog), FALSE);

I'm sure this could be improved by someone more facile with the g_ and libhal_
functions.

The 'if ()' could be replaced by more complicated expressions in the calls to
g_strdup_printf();  not sure of the coding style here.

[The libhal_ functions are pretty neat.....]

Comment 9 Tom London 2008-04-14 00:08:49 UTC
Uhhh... botched the format in one of the g_strdup_printf calls.  %u->%d.

Corrected patch:

--- gnome-mount.c-old	2008-04-13 11:14:25.000000000 -0700
+++ gnome-mount.c	2008-04-13 17:07:01.000000000 -0700
@@ -2152,6 +2152,7 @@
 	char            *drive_name;
 	char            *result;
 	char            *prompt;
+	char            *title;
 	GtkWidget	*dialog;
 	GnomePasswordDialogRemember remember;
 	char            *keyring_password;
@@ -2229,10 +2230,22 @@
 	 */
 	notify_parent (TRUE);
 
-	prompt = g_strdup_printf (
-		_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
+	if (libhal_volume_is_partition(volume)==FALSE) {
+		prompt = g_strdup_printf (
+			_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
 	
-	dialog = gnome_password_dialog_new (_("Unlock Encrypted Data"), prompt, NULL,
NULL, FALSE);
+		title = g_strdup (
+			_("Unlock Encrypted Data"));
+	} else {
+		prompt = g_strdup_printf (
+			_("The storage device %s contains encrypted data. Enter a password to unlock
partition %d."), drive_name, libhal_volume_get_partition_number(volume));
+	
+		title = g_strdup_printf (
+			_("Unlock Encrypted Data for partition %d"),
libhal_volume_get_partition_number(volume));
+	}
+
+	dialog = gnome_password_dialog_new (title, prompt, NULL, NULL, FALSE);
+	g_free (title);
 	g_free (prompt);
 
 	gnome_password_dialog_set_show_username (GNOME_PASSWORD_DIALOG (dialog), FALSE);


Comment 10 Tom London 2008-04-14 14:46:35 UTC
I think this cleans up the code flow a bit:

--- gnome-mount.c-old	2008-04-13 11:14:25.000000000 -0700
+++ gnome-mount.c	2008-04-14 07:42:26.000000000 -0700
@@ -2152,6 +2152,8 @@
 	char            *drive_name;
 	char            *result;
 	char            *prompt;
+	char            *partition_string;
+	char            *title;
 	GtkWidget	*dialog;
 	GnomePasswordDialogRemember remember;
 	char            *keyring_password;
@@ -2229,10 +2231,22 @@
 	 */
 	notify_parent (TRUE);
 
+	if (libhal_volume_is_partition(volume)==FALSE) {
+		partition_string = g_strdup ("");
+	} else {
+		partition_string = g_strdup_printf (
+			_(" (partition %d)"), libhal_volume_get_partition_number(volume));
+	}
+
 	prompt = g_strdup_printf (
-		_("The storage device %s contains encrypted data. Enter a password to
unlock."), drive_name);
+		_("The storage device %s%s contains encrypted data. Enter a password to
unlock."), drive_name, partition_string);
 	
-	dialog = gnome_password_dialog_new (_("Unlock Encrypted Data"), prompt, NULL,
NULL, FALSE);
+	title = g_strdup_printf (
+		_("Unlock Encrypted Data%s"), partition_string);
+
+	dialog = gnome_password_dialog_new (title, prompt, NULL, NULL, FALSE);
+	g_free (partition_string);
+	g_free (title);
 	g_free (prompt);
 
 	gnome_password_dialog_set_show_username (GNOME_PASSWORD_DIALOG (dialog), FALSE);


Comment 11 David Zeuthen 2008-04-16 22:28:57 UTC
I committed a slightly more translator friendly patch, see

http://svn.gnome.org/viewvc/gnome-mount/trunk/src/gnome-mount.c?view=log

It seems the diff viewer on svn.g.o is down right now.

Closing as UPSTREAM; I'll make sure this will be in before F9. Thanks.


Note You need to log in before you can comment on or make changes to this bug.