Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-05 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 I've never written a torture test before, and I don't know how to run the
 torture tests.  (Maybe that's something for me to learn while at the
 conference.)  Does this (untested) patch do something close to what it's
 supposed to?

 +
 + /*
 + * Ensure that opening the file without the leading slash works.
 + * NetApp filers are known to fail on this.
 + */
 + io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN;
 + io.openx.in.fname = fname + 1;
 + status = smb_raw_open(cli-tree, mem_ctx, io);
 + CHECK_STATUS(status, NT_STATUS_OK);
 + fnum = io.openx.out.file.fnum;
 + smbcli_close(cli-tree, fnum);
 +
 +/* Reset io.openx.in.fname back to its proper value */
 +io.openx.in.fname = fname;
 +
   smbcli_unlink(cli-tree, fname);
Hi Derrell,

that looks good, you have just whitespaces instead of tabs in front of
some lines:-)

Maybe it would be a good idea to isolate this test and create a new
function (just copy and modify test_chained())

as the RAW-OPEN test is tested with 'make test' or 'make quicktest' you
can easily test it.

to run it against a windows box use this:

bin/smbtorture //servername/sharename -U user%pass RAW-OPEN

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE/SLCm70gjA5TCD8RAm5xAKCIXAUMcTJz2q/WH1K/Wflc3/DDxwCeNQK7
S5jmutIq24EZc8GWfZtx4pw=
=3Ox6
-END PGP SIGNATURE-


Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-05 Thread derrell
Stefan (metze) Metzmacher [EMAIL PROTECTED] writes:

 Maybe it would be a good idea to isolate this test and create a new
 function (just copy and modify test_chained())

 as the RAW-OPEN test is tested with 'make test' or 'make quicktest' you
 can easily test it.

 to run it against a windows box use this:

 bin/smbtorture //servername/sharename -U user%pass RAW-OPEN

Done and checked-in.

Cheers,

Derrell


Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-05 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 Stefan (metze) Metzmacher [EMAIL PROTECTED] writes:
 
 Maybe it would be a good idea to isolate this test and create a new
 function (just copy and modify test_chained())

 as the RAW-OPEN test is tested with 'make test' or 'make quicktest' you
 can easily test it.

 to run it against a windows box use this:

 bin/smbtorture //servername/sharename -U user%pass RAW-OPEN
 
 Done and checked-in.

thanks, the tests looks good!

metze
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE/lamm70gjA5TCD8RAs6oAKCVlHjv4FEU5swQryf/sucVoR59vgCg0jk+
uSQxZnLa8qmSW+k+gm29lX8=
=GrXy
-END PGP SIGNATURE-


Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-04 Thread Stefan (metze) Metzmacher
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] schrieb:
 Author: derrell
 Date: 2006-09-03 01:37:26 + (Sun, 03 Sep 2006)
 New Revision: 18012
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=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.

Hi Derrell,

a torture test for this would be nice:-)

metze

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFE++ekm70gjA5TCD8RAiD2AJwPcEWMVJEPFkkmuTuKQGSgHOwl7wCeLtT9
szqSLRWwI5Xo457ww6VuNO4=
=2pD0
-END PGP SIGNATURE-


Re: svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-04 Thread derrell
Stefan (metze) Metzmacher [EMAIL PROTECTED] writes:

 [EMAIL PROTECTED] schrieb:
 Author: derrell
 Date: 2006-09-03 01:37:26 + (Sun, 03 Sep 2006)
 New Revision: 18012
 
 WebSVN: 
 http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=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.

 Hi Derrell,

 a torture test for this would be nice:-)

I've never written a torture test before, and I don't know how to run the
torture tests.  (Maybe that's something for me to learn while at the
conference.)  Does this (untested) patch do something close to what it's
supposed to?

Index: torture/raw/open.c
===
--- torture/raw/open.c  (revision 17937)
+++ torture/raw/open.c  (working copy)
@@ -351,6 +351,21 @@
CHECK_VAL(io.openx.out.size, 1024*1024);
CHECK_ALL_INFO(io.openx.in.size, size);
smbcli_close(cli-tree, fnum);
+
+   /*
+ * Ensure that opening the file without the leading slash works.
+ * NetApp filers are known to fail on this.
+ */
+   io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN;
+   io.openx.in.fname = fname + 1;
+   status = smb_raw_open(cli-tree, mem_ctx, io);
+   CHECK_STATUS(status, NT_STATUS_OK);
+   fnum = io.openx.out.file.fnum;
+   smbcli_close(cli-tree, fnum);
+
+/* Reset io.openx.in.fname back to its proper value */
+io.openx.in.fname = fname;
+
smbcli_unlink(cli-tree, fname);
 
/* check the fields when the file already existed */


svn commit: samba r18012 - in branches/SAMBA_3_0: examples/libsmbclient source/libsmb

2006-09-02 Thread derrell
Author: derrell
Date: 2006-09-03 01:37:26 + (Sun, 03 Sep 2006)
New Revision: 18012

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=revroot=sambarev=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);