svn commit: samba r19517 - in branches: SAMBA_3_0_23/examples/libsmbclient SAMBA_3_0_23/source/libsmb SAMBA_3_0_24/examples/libsmbclient SAMBA_3_0_24/source/libsmb

jra at samba.org jra at samba.org
Tue Oct 31 15:03:40 GMT 2006


Author: jra
Date: 2006-10-31 15:03:39 +0000 (Tue, 31 Oct 2006)
New Revision: 19517

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

Log:
Fix libsmbclient bug with Konqueror and NetApp filers
that need a leading / in OpenAndX calls. Should be in
3.0.23d (got missed).
Jeremy.

Modified:
   branches/SAMBA_3_0_23/examples/libsmbclient/testread.c
   branches/SAMBA_3_0_23/source/libsmb/libsmbclient.c
   branches/SAMBA_3_0_24/examples/libsmbclient/testread.c
   branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c


Changeset:
Modified: branches/SAMBA_3_0_23/examples/libsmbclient/testread.c
===================================================================
--- branches/SAMBA_3_0_23/examples/libsmbclient/testread.c	2006-10-31 12:57:56 UTC (rev 19516)
+++ branches/SAMBA_3_0_23/examples/libsmbclient/testread.c	2006-10-31 15:03:39 UTC (rev 19517)
@@ -55,6 +55,7 @@
     {
         ret = smbc_read(fd, buffer, sizeof(buffer));
         savedErrno = errno;
+        if (ret > 0) fwrite(buffer, 1, ret, stdout);
     } while (ret > 0);
 
     smbc_close(fd);

Modified: branches/SAMBA_3_0_23/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0_23/source/libsmb/libsmbclient.c	2006-10-31 12:57:56 UTC (rev 19516)
+++ branches/SAMBA_3_0_23/source/libsmb/libsmbclient.c	2006-10-31 15:03:39 UTC (rev 19517)
@@ -413,7 +413,15 @@
 
 	}
 
-        safe_strcpy(path, p, path_len - 1);
+        /*
+         * Prepend a leading slash if there's a file path, as required by
+         * NetApp filers.
+         */
+        *path = '\0';
+        if (*p != '\0') {
+                *path = '/';
+                safe_strcpy(path + 1, p, path_len - 2);
+        }
 
 	all_string_sub(path, "/", "\\", 0);
 

Modified: branches/SAMBA_3_0_24/examples/libsmbclient/testread.c
===================================================================
--- branches/SAMBA_3_0_24/examples/libsmbclient/testread.c	2006-10-31 12:57:56 UTC (rev 19516)
+++ branches/SAMBA_3_0_24/examples/libsmbclient/testread.c	2006-10-31 15:03:39 UTC (rev 19517)
@@ -55,6 +55,7 @@
     {
         ret = smbc_read(fd, buffer, sizeof(buffer));
         savedErrno = errno;
+        if (ret > 0) fwrite(buffer, 1, ret, stdout);
     } while (ret > 0);
 
     smbc_close(fd);

Modified: branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c
===================================================================
--- branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c	2006-10-31 12:57:56 UTC (rev 19516)
+++ branches/SAMBA_3_0_24/source/libsmb/libsmbclient.c	2006-10-31 15:03:39 UTC (rev 19517)
@@ -413,7 +413,15 @@
 
 	}
 
-        safe_strcpy(path, p, path_len - 1);
+        /*
+         * Prepend a leading slash if there's a file path, as required by
+         * NetApp filers.
+         */
+        *path = '\0';
+        if (*p != '\0') {
+                *path = '/';
+                safe_strcpy(path + 1, p, path_len - 2);
+        }
 
 	all_string_sub(path, "/", "\\", 0);
 



More information about the samba-cvs mailing list