1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

59 Commits

Author SHA1 Message Date
Derrell Lipman
f5f46de404 Add a program to test repeated calls to smbc_getxattr(). 2008-01-17 11:46:41 -05:00
Derrell Lipman
5a4a7aec76 Add some additional libsmbclient test programs.
testwrite: create or truncate a file and write to it.
teststat3: compare the results from smbc_stat() and smbc_fstat()

Derrell
2008-01-17 09:26:36 -05:00
Derrell Lipman
9d75ea577b Modify testread example to loop using same context.
There's been a problem seen where open/read/close a number of times causes
open failures eventually.  This program has been modified to create the
context once and then loop requesting file names to open/read/close.

This program also demonstrates the current error in cli_read() where it
returns an error instead of length 0 upon end of file.

Derrell
2008-01-16 14:41:11 +00:00
Derrell Lipman
296a6783fb Replace GetTimeOfDay() with gettimeofday() in example program.
GetTimeOfDay() seems to no longer be exported.  For the smbsh example, just
use the native gettimeofday() for now.
2008-01-16 14:37:40 +00:00
Derrell Lipman
01f6a4cca7 Add a (very!) trivial cache to the example authentication callback. 2008-01-16 14:35:44 +00:00
Derrell Lipman
913c335d21 Fix smbc_listxattr() and friends (bug #5189)
When the capability of using full names for DOS attributes was added, a bug
was introduced which caused the wrong number of bytes to be returned.  This
patch to smbc_listxattr_ctx() fixes the problem.

Thanks to Jack Schmidt for this patch.

Derrell
2008-01-13 17:10:06 -05:00
Derrell Lipman
2f43284244 Fix compile and linking errors since last this code was tested 2008-01-13 12:07:18 -05:00
Günther Deschner
88d6683872 Remove unused string.
Guenther
2008-01-10 13:02:10 +01:00
Günther Deschner
8f411753b2 Fix build warning for libsmbclient example.
Guenther
2008-01-09 10:20:44 +01:00
Derrell Lipman
2ac502e29b r24388: - ACL retrieval provided incomplete information because the buffer pointer was
incremented too far in some circumstances.  In these cases, only the first
 of multiple concatenated strings would be seen.

- Working on bug 4649 pertaining to delete an ACL, this fixes the reported
 crash.  It appears to have been an incomplete switchover from malloc to
 talloc, as the memory was still being freed with SAFE_FREE.

 Deleting ACLs still doesn't work.  Although a valid request is sent to the
 server and a SUCCESS response is returned, the method that's used in
 libsmbclient for deleting ACLs seems to be incorrect.  In looking at the
 samba4 torture tests, it appears that we should be turning on the INHERIT
 flag if we want to delete the ACL.  (I could use some assistance on the
 proper flags to send, from anyone familiar with this stuff.)

- Apply patch from SATOH Fumiyasu to fix bug 4750.  smbc_telldir_ctx() was not
  returning a value useful to smbc_lseekdir_ctx().

Derrell
2007-10-10 12:29:39 -05:00
Andrew Tridgell
d0e89d246d r23785: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:23 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Derrell Lipman
7213b5ebec r22914: - Fixes bug 4599. A missing <code>if</code> statement forced subseqeuent
attempts to set attributes to fail.

- I also noticed that missing attributes were setting an invalid return string
  by getxattr(), e.g. if there was not group, the return string had "GROUP:;"
  instead of excluding the GROUP attribute entirely as it should.  The big
  problem with the way it was, is that the string could not then be passed to
  setxattr() and parsed.
2007-10-10 12:22:07 -05:00
Derrell Lipman
c65621e0b7 r22130: - Ensure that the libsmbclient example programs link with the libsmbclient
library that's part of the current tree, not with whatever happens to have
  been previously installed.
2007-10-10 12:19:15 -05:00
Derrell Lipman
fc5b6e4bd8 r18012: 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.
2007-10-10 11:39:48 -05:00
Derrell Lipman
fa664b24b8 r18011: Should fix bug 3835.
Jeremy: requires your eyes...

If the remote connection timed out while cli_list() was retrieving its list of
files, the error was not returned to the user, e.g. via smbc_opendir(), so the
user didn't have a way to know to set the timeout longer and try again.  This
problem would occur when a very large directory is being read with a too-small
timeout on the cli.

Jeremy, although there were a couple of areas that needed to be handled, I
needed to make one change that you should bless, in libsmb/clientgen.c.  It
was setting

  cli->smb_rw_error = smb_read_error;

but smb_read_error is zero, so this had no effect.  I'm now doing

  cli->smb_rw_error = READ_TIMEOUT;

instead, and according to the OP, these (cumulative) changes (in a slightly
different form) solve the problem.

Please confirm this smb_rw_error change will have no other adverse effects
that you can see.

Derrell
2007-10-10 11:39:48 -05:00
Derrell Lipman
8e119b64f1 r18009: Fixes bug 4026.
This completes the work Jeremy began last week, disambiguating the meaning of
c_time.  (In POSIX terminology, c_time means "status Change time", not "create
time".)  All uses of c_time, a_time and m_time have now been replaced with
change_time, access_time, and write_time, and when creation time is intended,
create_time is used.

Additionally, the capability of setting and retrieving the create time have
been added to the smbc_setxattr() and smbc_getxattr() functions.  An example
of setting all four times can be seen with the program

  examples/libsmbclient/testacl

with the following command line similar to:

  testacl -f -S "system.*:CREATE_TIME:1000000000,ACCESS_TIME:1000000060,WRITE_TIME:1000000120,CHANGE_TIME:1000000180" 'smb://server/share/testfile.txt'

The -f option turns on the new mode which uses full time names in the
attribute specification (e.g. ACCESS_TIME vs A_TIME).
2007-10-10 11:39:47 -05:00
Derrell Lipman
c1b4c51053 r16550: Fix bug 3866. Thanks for the report!
Although I've never met a computer or compiler that produced pointers to
functions which are a different size than pointers to data, I suppose they
probably exist.  Assigning a pointer to a function is technically illegal in C
anyway.

Change casts of the option_value based on the option_name to use of variable
argument lists.

For binary compatibility, I've maintained but deprecated the old behavior of
debug_stderr (which expected to be passed a NULL or non-NULL pointer) and
added a new option debug_to_stderr which properly expects a boolean (int)
parameter.

Derrell
2007-10-10 11:18:59 -05:00
Derrell Lipman
203b4911c1 r14664: r13868@cabra: derrell | 2006-03-22 17:04:30 -0500
Implement enhancement request 3505.  Two additional features are added here.
 There is now a method of saving an opaque user data handle in the smbc_
 context, and there is now a way to request that the context be passed to the
 authentication function.  See examples/libsmbclient/testbrowse.c for an example
 of using these features.
2007-10-10 11:15:42 -05:00
Derrell Lipman
2b48665006 r12852: r12150@cabra: derrell | 2006-01-11 13:21:14 -0500
Although RTLD_NEXT was not working properly a number of years ago, it seems to be now.  Replace dlopen(/lib/libc...) with direct use of RTLD_NEXT
2007-10-10 11:06:04 -05:00
Derrell Lipman
0ae65b9af5 r12759: r12128@cabra: derrell | 2006-01-07 15:34:01 -0500
Incorporate a number of changes suggested by David Collier-Brown  Thanks, David!
2007-10-10 11:06:03 -05:00
Derrell Lipman
8396c4b26c r12757: r12126@cabra: derrell | 2006-01-03 15:21:36 -0500
added flag to not request authentication information
2007-10-10 11:06:02 -05:00
Derrell Lipman
64c8e32b63 r12579: r12122@cabra: derrell | 2005-12-29 12:03:00 -0500
allow for arbitrary option value types
2007-10-10 11:06:00 -05:00
Derrell Lipman
4182eb99af r12576: r12115@cabra: derrell | 2005-12-29 11:16:03 -0500
bug (enhancement) #2651: add option to log debug messages to stderr instead of stdout
2007-10-10 11:05:59 -05:00
Derrell Lipman
e3bab0cc43 r12468: r12033@cabra: derrell | 2005-12-24 21:03:45 -0500
actually add the new test program
2007-10-10 11:05:56 -05:00
Derrell Lipman
133cd3952b r12467: r12029@cabra: derrell | 2005-12-24 20:25:59 -0500
add another libsmbclient test program
2007-10-10 11:05:56 -05:00
Derrell Lipman
62a02b8f2a r12225: r11729@cabra: derrell | 2005-12-13 22:59:45 -0500
1. Fix a crash bug which should have reared its ugly head ages ago, but for
    some reason, remained dormant until recently.  The bug pertained to
    libsmbclient doing a structure assignment of a cli after having opened a
    pipe.  The pipe open code makes a copy of the cli pointer that was passed
    to it.  If the cli is later copied (and that cli pointer that was saved
    is no longer valid), the pipe code will cause a crash during shutdown or
    when the copied cli is closed.

 2. The 'type' field in enumerated shares was not being set correctly with
    the new RPC-based mechanism for enumerating shares.
2007-10-10 11:05:50 -05:00
Derrell Lipman
8a86d7bddc r12098: r10797@cabra: derrell | 2005-12-06 12:09:00 -0500
fixed another memory leak and reverted an (incorrect) fix from yesterday
2007-10-10 11:05:44 -05:00
Derrell Lipman
c5781c9cf5 r12080: r10673@cabra: derrell | 2005-12-05 13:22:34 -0500
Correct some memory and file descriptor leaks.

 This should fix bugs 3257, 3267 and 3273.
2007-10-10 11:05:44 -05:00
Derrell Lipman
b58237f98d r11130: r10092@cabra: derrell | 2005-10-17 15:29:03 -0400
let's now actually add the new test file
2007-10-10 11:05:01 -05:00
Derrell Lipman
4fad0c49b5 r11129: r10090@cabra: derrell | 2005-10-17 15:26:27 -0400
added example to read a file and test download time
2007-10-10 11:05:01 -05:00
Derrell Lipman
bab0bf7f4f r7168: Updating file times from libsmbclient was not working for win98. Although
the function that was being used to set attributes is a core protocol
function (SMBsetatr = 0x09), it does not appear to work on win98.  As a
temporary measure, when file times are to be set, this version opens the
file and uses SMBsetattrE = 0x22 instead.  (The other advantage of this
function over the original one is that it supports setting access time as
well as modification time.)

The next step, the proper solution if it can be made to work, is to write
functions that use TRANS2_SET_PATH_INFO instead.
2007-10-10 10:57:04 -05:00
Derrell Lipman
fce48fa1b4 r7156: file was missing; svn isn't smart enough to even notify me. sigh. 2007-10-10 10:57:03 -05:00
Derrell Lipman
d763c739a6 r7153: add better test facilities to testutime 2007-10-10 10:57:03 -05:00
Derrell Lipman
6d22c3c343 r6501: correct deprecated lvalue casts in testsuite/libsmbclient 2007-10-10 10:56:43 -05:00
Derrell Lipman
fa0294ddbf r6157: 'editorial changes' to example code 2007-10-10 10:56:25 -05:00
Derrell Lipman
a3bd496c92 r6151: additional examples/tests for libsmbclient 2007-10-10 10:56:25 -05:00
Derrell Lipman
994694f7f2 r6149: Fixes bugs #2498 and 2484.
1. using smbc_getxattr() et al, one may now request all access control
   entities in the ACL without getting all other NT attributes.
2. added the ability to exclude specified attributes from the result set
   provided by smbc_getxattr() et al, when requesting all attributes,
   all NT attributes, or all DOS attributes.
3. eliminated all compiler warnings, including when --enable-developer
   compiler flags are in use.  removed -Wcast-qual flag from list, as that
   is specifically to force warnings in the case of casting away qualifiers.

Note: In the process of eliminating compiler warnings, a few nasties were
      discovered.  In the file libads/sasl.c, PRIVATE kerberos interfaces
      are being used; and in libsmb/clikrb5.c, both PRIAVE and DEPRECATED
      kerberos interfaces are being used.  Someone who knows kerberos
      should look at these and determine if there is an alternate method
      of accomplishing the task.
2007-10-10 10:56:24 -05:00
Derrell Lipman
e1df648ea1 r6126: added utility for testing smbc_stat() 2007-10-10 10:56:23 -05:00
Derrell Lipman
15736b97c8 r6108: Added smbsh/smbwrapper for Linux to example/libsmbclient tree; provided more complete libsmbclient testbrowse utility 2007-10-10 10:56:22 -05:00
Gerald Carter
3aac1e549e missed some of Derrel's changes 0001-01-01 00:00:00 +00:00
cvs2svn Import User
73ffc394b5 This commit was manufactured by cvs2svn to create branch 'SAMBA_3_0'. 0001-01-01 00:00:00 +00:00
Richard Sharpe
a6457e1c81 Apply some more of Derrell Lipman's changes. 0001-01-01 00:00:00 +00:00
Gerald Carter
309a9a4caf merge from 3.0 0001-01-01 00:00:00 +00:00
Richard Sharpe
b92fd87b24 Update Makefile ... 0001-01-01 00:00:00 +00:00
Richard Sharpe
d761175f13 Add this to samba-head. 0001-01-01 00:00:00 +00:00
Richard Sharpe
af42af75a4 Add testacl.c ... from Derrell Lipman. 0001-01-01 00:00:00 +00:00
Richard Sharpe
600e056a33 Apply the changes that Derrell Lipman supplied ... 0001-01-01 00:00:00 +00:00
Richard Sharpe
1f115c95d6 Apply these patches as well ... not sure if they all build. They don't on
FreeBSD 4.3. They might on Linux.
0001-01-01 00:00:00 +00:00
Gerald Carter
adb98e7b7c trying to get HEAD building again. If you want the code
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE
0001-01-01 00:00:00 +00:00