svn commit: samba r13036 - in trunk/source: libsmb nsswitch

jra at samba.org jra at samba.org
Thu Jan 19 15:52:43 GMT 2006


Author: jra
Date: 2006-01-19 15:52:42 +0000 (Thu, 19 Jan 2006)
New Revision: 13036

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=13036

Log:
Prevent us from having to logon twice when we go offline.
Fall back to using cache if we go from online to offline
in the course of a login.
Jeremy.

Modified:
   trunk/source/libsmb/clientgen.c
   trunk/source/nsswitch/winbindd_pam.c


Changeset:
Modified: trunk/source/libsmb/clientgen.c
===================================================================
--- trunk/source/libsmb/clientgen.c	2006-01-19 13:01:12 UTC (rev 13035)
+++ trunk/source/libsmb/clientgen.c	2006-01-19 15:52:42 UTC (rev 13036)
@@ -353,11 +353,14 @@
 /****************************************************************************
  External interface.
  Close an open named pipe over SMB. Free any authentication data.
+ Returns False if the cli_close call failed.
  ****************************************************************************/
 
-void cli_rpc_pipe_close(struct rpc_pipe_client *cli)
+BOOL cli_rpc_pipe_close(struct rpc_pipe_client *cli)
 {
-	if (!cli_close(cli->cli, cli->fnum)) {
+	BOOL ret = cli_close(cli->cli, cli->fnum);
+
+	if (!ret) {
 		DEBUG(0,("cli_rpc_pipe_close: cli_close failed on pipe %s, "
                          "fnum 0x%x "
                          "to machine %s.  Error was %s\n",
@@ -376,6 +379,7 @@
 
 	DLIST_REMOVE(cli->cli->pipe_list, cli);
 	talloc_destroy(cli->mem_ctx);
+	return ret;
 }
 
 /****************************************************************************

Modified: trunk/source/nsswitch/winbindd_pam.c
===================================================================
--- trunk/source/nsswitch/winbindd_pam.c	2006-01-19 13:01:12 UTC (rev 13035)
+++ trunk/source/nsswitch/winbindd_pam.c	2006-01-19 15:52:42 UTC (rev 13036)
@@ -1099,7 +1099,11 @@
 			goto process_result;
 		} else {
 			DEBUG(10,("winbindd_dual_pam_auth_samlogon failed: %s\n", nt_errstr(result)));
-			goto done;
+			if (domain->online) {
+				/* We're still online - fail. */
+				goto done;
+			}
+			/* Else drop through and see if we can check offline.... */
 		}
 	}
 



More information about the samba-cvs mailing list