r10554: * BUG 3057: assume x64 drivers are v3 drivers
authorGerald Carter <jerry@samba.org>
Tue, 27 Sep 2005 19:18:20 +0000 (19:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:04:47 +0000 (11:04 -0500)
* BUG 3087: allow smbspool to establisha geust connection
  using a username with no password
(This used to be commit 39369c8041e0633e88c30e0c62530c2393ef80f6)

source3/client/smbspool.c
source3/printing/nt_printing.c

index 5d27fbe4c2b464ba0d4221c176d5b58ba10df798..1a3ac06c7809068748ec9dbde207de80c1c0b66b 100644 (file)
@@ -457,15 +457,15 @@ smb_connect(const char *workgroup,    /* I - Workgroup */
 
   get_myname(myname);  
 
-  if ( (username) && ( *username ) && (password) && (*password) ) 
+  /* See if we have a username first.  This is for backwards compatible 
+     behavior with 3.0.14a */
+
+  if ( username &&  *username )
   {
-      /* 
-       * User/password specified in the DEVICE_URI, use those credentials 
-       * to connect to the server 
-       */
       cli = smb_complete_connection(myname, server, port, username, 
                                     password, workgroup, share, 0 );
-      if (cli ) { return cli; }
+      if (cli) 
+        return cli;
   }
   
   /* 
index f8d9220c05dfb696dff57b3f3d898aaffee10556..8061842ad9ff4b1acb839b0f54519e4000a4dbb4 100644 (file)
@@ -1386,12 +1386,19 @@ static uint32 get_correct_cversion(const char *architecture, fstring driverpath_
        *perr = WERR_INVALID_PARAM;
 
        /* If architecture is Windows 95/98/ME, the version is always 0. */
-       if (strcmp(architecture, "WIN40") == 0) {
+       if (strcmp(architecture, SPL_ARCH_WIN40) == 0) {
                DEBUG(10,("get_correct_cversion: Driver is Win9x, cversion = 0\n"));
                *perr = WERR_OK;
                return 0;
        }
 
+       /* If architecture is Windows x64, the version is always 3. */
+       if (strcmp(architecture, SPL_ARCH_X64) == 0) {
+               DEBUG(10,("get_correct_cversion: Driver is x64, cversion = 3\n"));
+               *perr = WERR_OK;
+               return 3;
+       }
+
        /*
         * Connect to the print$ share under the same account as the user connected
         * to the rpc pipe. Note we must still be root to do this.