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



commit 8017e1216dcef603bff13ca523476a6a60530104
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 unexpected. Add one more iteration in the mount procedure just
    for ccache. This will unfortunately 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]