r26409: Pass smb ports along.
[jelmer/samba4-debian.git] / source / client / smbspool.c
index 57050acab8c1630fc1805211bedf4b9fb828cc32..614e50bb0bf118f3ef2eb297f2f0273e90cd65b5 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 static void            list_devices(void);
-static struct smbcli_state     *smb_connect(const char *, const char *, const char *, const char *, const char *);
+static struct smbcli_state     *smb_connect(const char *, const char *, const char **, const char *, const char *, const char *);
 static int             smb_print(struct smbcli_state *, char *, FILE *);
 
 
@@ -189,7 +189,7 @@ static int          smb_print(struct smbcli_state *, char *, FILE *);
 
   do
   {
-    if ((cli = smb_connect(workgroup, server, printer, username, password)) == NULL)
+    if ((cli = smb_connect(workgroup, server, lp_smb_ports(lp_ctx), printer, username, password)) == NULL)
     {
       if (getenv("CLASS") == NULL)
       {
@@ -255,6 +255,7 @@ list_devices(void)
 static struct smbcli_state *           /* O - SMB connection */
 smb_connect(const char *workgroup,             /* I - Workgroup */
             const char *server,                /* I - Server */
+           const char **ports,           /* I - Ports */
             const char *share,         /* I - Printer */
             const char *username,              /* I - Username */
             const char *password)              /* I - Password */
@@ -269,7 +270,7 @@ smb_connect(const char *workgroup,          /* I - Workgroup */
 
   myname = get_myname();  
        
-  nt_status = smbcli_full_connection(NULL, &c, myname, server, 0, share, NULL,
+  nt_status = smbcli_full_connection(NULL, &c, myname, server, ports, share, NULL,
                                     username, workgroup, password, NULL);
   
   free(myname);