Author: derrell Date: 2006-09-03 01:37:26 +0000 (Sun, 03 Sep 2006) New Revision: 18012
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18012 Log: Should fix bug 4018. NetApp filers expect paths in Open AndX Request to have a leading slash. Windows clients send the leading slash, so we should too. Modified: branches/SAMBA_3_0/examples/libsmbclient/testread.c branches/SAMBA_3_0/source/libsmb/libsmbclient.c Changeset: Modified: branches/SAMBA_3_0/examples/libsmbclient/testread.c =================================================================== --- branches/SAMBA_3_0/examples/libsmbclient/testread.c 2006-09-03 00:50:34 UTC (rev 18011) +++ branches/SAMBA_3_0/examples/libsmbclient/testread.c 2006-09-03 01:37:26 UTC (rev 18012) @@ -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/source/libsmb/libsmbclient.c =================================================================== --- branches/SAMBA_3_0/source/libsmb/libsmbclient.c 2006-09-03 00:50:34 UTC (rev 18011) +++ branches/SAMBA_3_0/source/libsmb/libsmbclient.c 2006-09-03 01:37:26 UTC (rev 18012) @@ -414,7 +414,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);