1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00
Commit Graph

75 Commits

Author SHA1 Message Date
Andreas Schneider
9f3151a4e2 libsmbclient: Use const for the user
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13101

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-10-27 20:33:24 +02:00
Volker Lendecke
8a58a48f86 libsmb: Implement smbc_notify
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 10 09:35:13 CEST 2015 on sn-devel-104
2015-07-10 09:35:13 +02:00
Ross Lagerwall
f73bcf4934 s3: libsmbclient: Add server-side copy support
Introduce a new operation, splice, which copies data from one SMBCFILE
to another. Implement this operation using FSCTL_SRV_COPYCHUNK_WRITE for
SMB2+ protocols and using read+write for older protocols. Since the
operation may be long running, it takes a callback which gets called
periodically to indicate progress to the application and given an
opportunity to stop it.

Signed-off-by: Ross Lagerwall <rosslagerwall@gmail.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-05-29 02:37:18 +02:00
Volker Lendecke
b96cea4aa5 Fix some blank line endings
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jun 21 19:57:06 CEST 2013 on sn-devel-104
2013-06-21 19:57:06 +02:00
Volker Lendecke
20bede7baa libsmbclient: Fix typos
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-06-14 20:30:33 +02:00
Jeremy Allison
2252d78123 Add smbc_getPort(), smbc_setPort(). Bump the .so minor number.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-06-11 10:50:41 -07:00
Volker Lendecke
6c13a46732 s3-libsmbclient: Add OptionUseNTHash
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-12 10:48:15 +02:00
Volker Lendecke
dec9d03e25 libsmbclient: Fix a typo
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Mar  9 11:19:36 CET 2011 on sn-devel-104
2011-03-09 11:19:35 +01:00
Derrell Lipman
0ee1985b05 [Bug 7345] Incomplete description of function return values in libsmbclient.h
- Fixed documentation on smbc_fstat(), smbc_statvfs(), and smbc_fstatvfs():
  All were missing return value upon success

- Fixed documentation on smbc_read:
  Documented return value upon EOF

Derrell
2010-04-11 11:37:00 -04:00
Volker Lendecke
4eb1523d87 s3-libsmbclient: Add smbc_setOptionUseCCache()
Can we enable this by default? This would be a change in behaviour, but this
feature is just too cool for everyone to catch up in the apps.

The patch would be
2010-01-24 20:32:17 +01:00
Derrell Lipman
bd9d4e5212 Correct typos; semicolons instead of commas 2009-05-11 14:16:52 -04:00
Derrell Lipman
db69ebcbce Provide a libsmbclient interface for programs requiring threads
- This adds two functions: smbc_thread_posix() which provides access to the
  internal threading implementation using pthread; and smbc_thread_impl()
  where the user provides each of the functions required by Samba, to give
  access to the thread implementation's native capabilities.

Derrell
2009-05-10 22:45:12 -04:00
Derrell Lipman
cf7539abfb Make char* parameters const
- Use const in function signatures whenever appropriate, to help prevent
  errant scribbling on users' buffers. smbc_set_credentials() always acted as
  if its formal parameters were const char *, and changing the formal
  declaration to specify that should not cause any change to the ABI. It is
  still allowable to pass a writable buffer to a function which specifies that
  it will not write to the buffer.

  I'm making this change only in master.

Derrell
2009-02-23 13:50:25 -05:00
Jeremy Allison
87a4c09b9b Change smbc_set_credentials_with_fallback() (unreleased) to use
const approptiately.
Jeremy.
2009-02-20 16:41:41 -08:00
Bo Yang
e256d72f0c Make libsmbclient work with DFS
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
2009-02-20 09:46:46 -05:00
Derrell Lipman
a796832683 enums are traditionally signed. Avoid use of high bit in bit flags. 2009-02-14 22:29:11 -05:00
Derrell Lipman
352c97561e [Bug 6069] Add a fstatvfs function for libsmbclient
- Revert Tim's changes for the moment. I need to see what the issue is and
  arrange to use "struct statvfs" if at all possible.

Derrell
2009-02-14 09:44:36 -05:00
Tim Prouty
5e5d2b2cfa s3 libsmbclient: Fix fstatvfs to be more portable
The statvfs struct isn't guaranteed to be portable across operating
systems.  Since libsmbclient isn't actually calling statvfs and just
using the statvfs struct to store similar information, this patch adds
a new portable smbc_statvfs struct.  This fixes a few of the failures
in the build farm introduced by:
ae259575c4

Derrell, please check.
2009-02-13 12:59:30 -08:00
Derrell Lipman
ae259575c4 [Bug 6069] Add a fstatvfs function for libsmbclient
- port functionality from v3_3_test to master

Derrell
2009-02-12 10:39:48 -05:00
Derrell Lipman
6d300399b5 Determine case sensitivity based on file system attributes.
- Most of the time, we can determine from the file system we're connecting to
  whether it supports case sensitivity. In those cases, we now set the
  internal case sensitivity flag automatically. For those cases where the
  request to retrieve file system attributes fails, we'll use the
  user-specified option value.

Derrell
2009-01-17 13:33:39 -05:00
Derrell Lipman
1c77c7f3d5 Treat file names in POSIX-like case-sensitive fashion by default
*** THIS COMMIT CAUSES A CHANGE OF DEFAULT BEHAVIOR IN libsmbclient!!! ***

- libsmbclient now calls cli_set_case_sensitive() for a new CLI. By default,
  it requests case-sensitive, but the old behavior of case-insensitive can be
  requested with smbc_setOptionCaseSensitive(context, False);

  The change of behavior is considered a bug fix, as it was previously
  possible to accidentally overwrite a file that had the same case-insensitive
  name but a different case-sensitive name as a previously-existing file,
  while creating a new file.

Derrell
2009-01-16 16:41:36 -05:00
Andreas Schneider
43892abff6 The buf in the smbclient write function should be const.
As we try to provide POSIX function, we should use const like all other
POSIX function.

Signed-off-by: Andreas Schneider <anschneider@suse.de>
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
(This used to be commit 36e5df5954)
2008-07-16 10:41:43 -04:00
Derrell Lipman
a49f6f17c6 Fix typos.
libsmbclient doesn't have bool defined; rather it uses smbc_bool

Derrell
(This used to be commit e1ade80f46)
2008-07-16 09:45:02 -04:00
Derrell Lipman
31262a59bc [BUG 5580] Allow access to DFS shares via libsmbclient
Brian Sheehan provided a nice patch intended for the 3.0 code base.  This
commit applies a similar patch for the 3.3 code base.  It adds a new public
function to libsmbclient -- smbc_set_credentials() -- that may be called from
the authentication callback when DFS referrals are in use.

Derrell
(This used to be commit 888f922bd0)
2008-07-08 20:44:39 -04:00
Andreas Schneider
e5ac03b0ae Add documentation for kerberos support in libsmbclient.
Signed-off-by: Andreas Schneider <anschneider@suse.de>
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
(This used to be commit fa803ce183)
2008-06-23 15:36:38 -04:00
Derrell Lipman
6398f945e8 Remove prototype of unimplemented smbc_chown() function.
(This used to be commit 0e84e3bb80)
2008-06-18 11:00:46 -04:00
Derrell Lipman
8a22800028 use constant name less likely to cause conflict
(This used to be commit fd18b01016)
2008-03-03 22:56:32 -05:00
Derrell Lipman
ee45d0d663 Missed a few 'deprecated' markers
(This used to be commit 76ba37ac46)
2008-03-03 18:25:49 -05:00
Derrell Lipman
1363ee9d65 Continued revamping of libsmbclient.
- James suggested using gcc's "deprecated" attribute to mark the context
  structure fields to generate warnings.  This creates a scenario with the
  best of all worlds.  I'm able to move to an organization that more easily
  allows future enhancements, while avoiding any mandatory changes by
  applications.  Thanks, James!

- Updated WHATSNEW.txt so that it accurately reflects the current state of
  affairs.

Derrell
(This used to be commit a67f96fbe9)
2008-03-03 18:13:33 -05:00
Derrell Lipman
bf950ea758 fixed missing white space
(This used to be commit 71e86f13b0)
2008-03-02 16:13:25 -05:00
Derrell Lipman
4a3410b766 change variable name from f to fn for function pointers
(This used to be commit 1fd65359f6)
2008-03-01 21:19:15 -05:00
Derrell Lipman
b3c16a241d Comment was in wrong place
(This used to be commit dec70fa3c0)
2008-03-01 20:56:54 -05:00
Derrell Lipman
0bd3df33ed Mark smbc_option_{get,set} as deprecated
(This used to be commit a8b4b773d4)
2008-03-01 20:55:21 -05:00
Derrell Lipman
223940d9a8 Additional revamped libsmbclient documentation
- Ensured that all public functions have documentation in libsmbclient.h
- Reformatted for "proper" indentation
- Re-added temporarily-disabled alternate authentication function capability

Derrell
(This used to be commit 64b7150d92)
2008-03-01 20:47:22 -05:00
Derrell Lipman
4ba42cbe0f Modified revamp of the libsmbclient interface.
Given the tacit (if that) approval by some people, and clear disapproval by
others for my proposed clean-up and reorganization of libsmbclient, I've come
up with a slightly different approach.  This commit changes back to the
original libsmbclient.h SMBCCTX structure which will maintain ABI
compatibility.  I retain, here, the setter and getter functions which all new
code should use.  Older programs already compiled should continue to work
fine.  Older programs being recompiled will encounter compile-time errors
(intentionally!) so that the code can be corrected to use the setter/getter
interfaces.

Although this doesn't clean up the interface in the way I had wanted, the code
reorganization and requirement for new programs to use the setters and getters
allows future progress to be made on libsmbclient without further muddying up
the interface, while retaining the ABI compatibility that was the big issue
causing disapproval.  I hope that this compromise is adequate.

Derrell
(This used to be commit 56429a3d60)
2008-03-01 20:47:22 -05:00
Derrell Lipman
257b7b0929 Initial revamp of the libsmbclient interface.
The libsmbclient interface has suffered from difficulty of improvement and
feature enrichment without causing ABI breakage.  Although there were a number
of issues, the primary ones were:

(a) the user of the library would manually manipulate the context structure
    members, meaning that nothing in the context structure could change other
    than adding stuff at the end;

(b) there were three methods of setting options: setting bits in a flags field
    within the context structure, setting explicit options variables within an
    options structure in the context structure, and by calling the
    smbc_option_set() function;

(c) the authentication callback did not traditionally provide enough
    information to the callee which required adding an option for a callback
    with a different signature, and now there are requests for even more
    information at the callback, requiring yet a third signature and option to
    set it (if we implement that feature).

This commit provides a reorganization of the code which fixes (a) and (b).
The context structure is now entirely opaque, and there are setter and getter
functions for manipulating it.  This makes maintaining ABI consistency much,
much easier.

Additionally, the options setting/getting has been unified into a single
mechanism using smbc_option_set() and smbc_option_get().

Yet to be completed is a refactoring of the authentication callback (c).

The test programs in examples/libsmbclient have been modified (if necessary;
some applications require no changes at all) for the new API and a few have
been minimally tested.

Derrell
(This used to be commit d4b4bae8de)
2008-03-01 20:47:22 -05:00
Derrell Lipman
fa341d5262 add smbc_ftruncate() to emulate POSIX ftruncate()
(This used to be commit 6f5051b9c1)
2008-02-26 21:44:51 -05:00
Derrell Lipman
011e89c858 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
(This used to be commit 913c335d21)
2008-01-13 17:10:06 -05:00
Andrew Tridgell
153cfb9c83 r23801: The FSF has moved around a lot. This fixes their Mass Ave address.
(This used to be commit 87c91e4362)
2007-10-10 12:28:27 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Derrell Lipman
7bcf281c9c r21132: - Fixes bug 4366. Documentation for smbc_utimes() was incorrect.
- Should fix bug 4115 (but needs confirmation from OP).  If the kerberos use
  flag is set in the context, then also pass it to smbc_attr_server for use by
  cli_full_connection()

- Should fix bug 4309 (but needs confirmation from OP).  We no longer send a
  keepalive packet unconditionally.  Instead, we assume (yes, possibly
  incorrectly, but it's the best guess we can make) that if the connection is
  on port 139, it's netbios and otherwise, it isn't.  If netbios is in use, we
  send a keepalive packet.  Otherwise, we check that the connection is alive
  using getpeername().
(This used to be commit 2f9be59c10)
2007-10-10 12:17:42 -05:00
Derrell Lipman
315f416211 r18013: Fix for "bug" (enhancement) 3684.
Provide a new option to specify the share mode to be used when opening a
file.
(This used to be commit 9b6fee5f6f)
2007-10-10 11:39:48 -05:00
Derrell Lipman
9718506d35 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
(This used to be commit c1b4c51053)
2007-10-10 11:18:59 -05:00
Derrell Lipman
e836508704 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.
(This used to be commit 203b4911c1)
2007-10-10 11:15:42 -05:00
Jeremy Allison
5cc61b3825 r11719: Remove silly #define of close -> close_fn as this borks
any code that includes libsmbclient.h that also calls the
system close() fn. Doh ! Thanks to John Terpstra for
reporting this.
Jeremy.
(This used to be commit 6e1cb7047a)
2007-10-10 11:05:25 -05:00
Jeremy Allison
fcceedd67c r11573: Adding Andrew Bartlett's patch to make machine account
logons work if the client gives the MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
or MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT flags. This changes
the auth module interface to 2 (from 1). The effect of this is
that clients can access resources as a machine account if they
set these flags. This is the same as Windows (think of a VPN
where the vpn client authenticates itself to a VPN server
using machine account credentials - the vpn server checks
that the machine password was valid by performing a machine
account check with the PDC in the same was as it would a
user account check. I may add in a restriction (parameter)
to allow this behaviour to be turned off (as it was previously).
That may be on by default.
Andrew Bartlett please review this change carefully.
Jeremy.
(This used to be commit d1caef8663)
2007-10-10 11:05:20 -05:00
Derrell Lipman
7dd03e891e r9540: correct comments in struct smbc_dirent (fixes bug 3030)
(This used to be commit 1f8aff85a6)
2007-10-10 11:01:12 -05:00
Volker Lendecke
3a8af94424 r8093: Next round. Now it compiles with --enable-socket-wrapper.
Volker
(This used to be commit 25cbcfba30)
2007-10-10 10:58:11 -05:00
Tim Potter
100b7adcd7 r5916: Only one C++ guard is necessary, not one around each smbc function.
(This used to be commit e446f16a40)
2007-10-10 10:56:08 -05:00
Gerald Carter
51310680ce r5752: implement derrell's solution for binary compatibilty in the _SMBCCTX structure; note that we break compat with 3.0.11 but are ok with earlier versions
(This used to be commit 6e8d171551)
2007-10-10 10:55:59 -05:00