Bug 658098 - no way to specify optional domain field in gvfs password dialog



Hello,

The fix to this issue is quite trivial but requires patching all three
of glib, gvfs, gtk.

Also it is not quite obvious that replacing the old NEED_DOMAIN with
HAS_DOMAIN is the best thing.

Any opinions?

Thanks

Michal
Description: Upstream changes introduced in version 2.28.6-2dom1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 glib2.0 (2.28.6-2dom1) experimental; urgency=low
 .
   * Add a separate option that specifies a domain is required.
 .
 The person named in the Author field signed this changelog entry.
Author: Michal Suchanek <hramrach centrum cz> <hramrach IPX7A-ION ruk cuni cz>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- glib2.0-2.28.6.orig/gio/gioenums.h
+++ glib2.0-2.28.6/gio/gioenums.h
@@ -500,6 +500,7 @@ typedef enum {
  * GAskPasswordFlags:
  * @G_ASK_PASSWORD_NEED_PASSWORD: operation requires a password.
  * @G_ASK_PASSWORD_NEED_USERNAME: operation requires a username.
+ * @G_ASK_PASSWORD_HAS_DOMAIN: operation may require a domain.
  * @G_ASK_PASSWORD_NEED_DOMAIN: operation requires a domain.
  * @G_ASK_PASSWORD_SAVING_SUPPORTED: operation supports saving settings.
  * @G_ASK_PASSWORD_ANONYMOUS_SUPPORTED: operation supports anonymous users.
@@ -511,9 +512,10 @@ typedef enum {
 typedef enum {
   G_ASK_PASSWORD_NEED_PASSWORD       = (1 << 0),
   G_ASK_PASSWORD_NEED_USERNAME       = (1 << 1),
-  G_ASK_PASSWORD_NEED_DOMAIN         = (1 << 2),
+  G_ASK_PASSWORD_HAS_DOMAIN          = (1 << 2),
   G_ASK_PASSWORD_SAVING_SUPPORTED    = (1 << 3),
-  G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 << 4)
+  G_ASK_PASSWORD_ANONYMOUS_SUPPORTED = (1 << 4),
+  G_ASK_PASSWORD_NEED_DOMAIN         = (1 << 5)
 } GAskPasswordFlags;
 
 
--- glib2.0-2.28.6.orig/gio/gioenumtypes.c
+++ glib2.0-2.28.6/gio/gioenumtypes.c
@@ -495,6 +495,7 @@ g_ask_password_flags_get_type (void)
         { G_ASK_PASSWORD_NEED_PASSWORD, "G_ASK_PASSWORD_NEED_PASSWORD", "need-password" },
         { G_ASK_PASSWORD_NEED_USERNAME, "G_ASK_PASSWORD_NEED_USERNAME", "need-username" },
         { G_ASK_PASSWORD_NEED_DOMAIN, "G_ASK_PASSWORD_NEED_DOMAIN", "need-domain" },
+        { G_ASK_PASSWORD_HAS_DOMAIN, "G_ASK_PASSWORD_HAS_DOMAIN", "has-domain" },
         { G_ASK_PASSWORD_SAVING_SUPPORTED, "G_ASK_PASSWORD_SAVING_SUPPORTED", "saving-supported" },
         { G_ASK_PASSWORD_ANONYMOUS_SUPPORTED, "G_ASK_PASSWORD_ANONYMOUS_SUPPORTED", "anonymous-supported" },
         { 0, NULL, NULL }
Description: Upstream changes introduced in version 1.8.2-1smbdom1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 gvfs (1.8.2-1smbdom1) experimental; urgency=low
 .
   * Don't require domain when logging in to samba shares.
 .
 The person named in the Author field signed this changelog entry.
Author: Michal Suchanek <hramrach centrum cz> <hramrach IPX7A-ION ruk cuni cz>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

Index: gvfs-1.8.2/daemon/gvfsbackendsmb.c
===================================================================
--- gvfs-1.8.2.orig/daemon/gvfsbackendsmb.c	2011-09-06 13:32:54.000000000 +0200
+++ gvfs-1.8.2/daemon/gvfsbackendsmb.c	2011-09-06 13:34:59.000000000 +0200
@@ -230,7 +230,7 @@
 	  if (g_vfs_keyring_is_available ())
 	    flags |= G_ASK_PASSWORD_SAVING_SUPPORTED;
 	  if (backend->domain == NULL)
-	    flags |= G_ASK_PASSWORD_NEED_DOMAIN;
+	    flags |= G_ASK_PASSWORD_HAS_DOMAIN;
 	  if (backend->user == NULL)
 	    flags |= G_ASK_PASSWORD_NEED_USERNAME;
 
Index: gvfs-1.8.2/daemon/gvfsbackendsmbbrowse.c
===================================================================
--- gvfs-1.8.2.orig/daemon/gvfsbackendsmbbrowse.c	2011-09-06 13:32:54.000000000 +0200
+++ gvfs-1.8.2/daemon/gvfsbackendsmbbrowse.c	2011-09-06 13:34:59.000000000 +0200
@@ -365,7 +365,7 @@
 	  if (g_vfs_keyring_is_available ())
 	    flags |= G_ASK_PASSWORD_SAVING_SUPPORTED;
 	  if (backend->domain == NULL)
-	    flags |= G_ASK_PASSWORD_NEED_DOMAIN;
+	    flags |= G_ASK_PASSWORD_HAS_DOMAIN;
 	  if (backend->user == NULL)
 	    flags |= G_ASK_PASSWORD_NEED_USERNAME;
 
Description: Upstream changes introduced in version 2.24.6-1fc1dom1
 This patch has been created by dpkg-source during the package build.
 Here's the last changelog entry, hopefully it gives details on why
 those changes were made:
 .
 gtk+2.0 (2.24.6-1fc1dom1) unstable; urgency=low
 .
   * Import two upstream patches to fix filechooser.
   * Don't require the user to enter domain.
 .
 The person named in the Author field signed this changelog entry.
Author: Michal Suchanek <hramrach centrum cz>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: http://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- gtk+2.0-2.24.6.orig/gtk/gtkmountoperation.c
+++ gtk+2.0-2.24.6/gtk/gtkmountoperation.c
@@ -344,7 +344,8 @@ pw_dialog_input_is_valid (GtkMountOperat
    * definitively needs a password.
    */
   is_valid = entry_has_input (priv->username_entry) &&
-             entry_has_input (priv->domain_entry);
+             ( !(priv->ask_flags & G_ASK_PASSWORD_NEED_DOMAIN) ||
+               entry_has_input (priv->domain_entry));
 
   return is_valid;
 }
@@ -578,7 +579,7 @@ gtk_mount_operation_ask_password (GMount
   if (flags & G_ASK_PASSWORD_NEED_USERNAME)
     rows++;
 
-  if (flags &G_ASK_PASSWORD_NEED_DOMAIN)
+  if ((flags &G_ASK_PASSWORD_NEED_DOMAIN) || (flags &G_ASK_PASSWORD_HAS_DOMAIN))
     rows++;
 
   /* The table that holds the entries */
@@ -604,7 +605,7 @@ gtk_mount_operation_ask_password (GMount
                                             default_user, operation);
 
   priv->domain_entry = NULL;
-  if (flags & G_ASK_PASSWORD_NEED_DOMAIN)
+  if ((flags &G_ASK_PASSWORD_NEED_DOMAIN) || (flags &G_ASK_PASSWORD_HAS_DOMAIN))
     priv->domain_entry = table_add_entry (table, rows++, _("_Domain:"),
                                           default_domain, operation);
 


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