[gvfs/wip/oholy/smb-ccache: 2/3] smb: Do not show password prompt when using winbind ccache



commit aff56d76136e296f6708e95f4f7df2c57c87e6d1
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Feb 14 15:06:06 2019 +0100

    smb: Do not show password prompt when using winbind ccache
    
    Recent samba releases seems invoke auth_callback even when using
    cached winbind credentials. It shows password prompt to user, which
    is unexepected. Add one more iteration in the mount procedure just
    for ccache. This will unfortunatelly make one fail attempt if the
    winbind ccache is not configured, but I don't see better way to
    fix this.
    
    Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/369

 daemon/gvfsbackendsmb.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/daemon/gvfsbackendsmb.c b/daemon/gvfsbackendsmb.c
index bb105c30..0292768c 100644
--- a/daemon/gvfsbackendsmb.c
+++ b/daemon/gvfsbackendsmb.c
@@ -206,6 +206,14 @@ auth_callback (SMBCCTX *context,
       backend->mount_try_again = TRUE;
       g_debug ("auth_callback - kerberos pass\n");
     }
+  else if (backend->mount_try == 1 &&
+           backend->user == NULL &&
+           backend->domain == NULL)
+    {
+      /* Try again if ccache login fails */
+      backend->mount_try_again = TRUE;
+      g_debug ("auth_callback - ccache pass\n");
+    }
   else if (backend->use_anonymous)
     {
       /* Try again if anonymous login fails */


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