summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmb_context.c
AgeCommit message (Collapse)AuthorFilesLines
2013-06-11Add smbc_getPort(), smbc_setPort(). Bump the .so minor number.Jeremy Allison1-0/+1
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2012-07-29s3-libsmbclient: Add missing talloc_stackframe() callsAndrew Bartlett1-0/+16
These caused a panic with the new assertion on the talloc stackframe being in place. Andrew Bartlett Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sun Jul 29 05:21:24 CEST 2012 on sn-devel-104
2012-05-28s3:libsmb: get rid of cli_state_encryption_onLuk Claes1-2/+2
Signed-off-by: Luk Claes <luk@debian.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-03-24lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij1-1/+1
The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2011-11-03s3:libsmb: make use of SMB_SIGNING_* constantsStefan Metzmacher1-4/+4
metze
2011-07-28s3:libsmb: use lp_load_client() and lp_load_client_no_reinit() in libsmb_contextMichael Adam1-5/+3
2011-07-28s3:libsmb: fix a call to lp_load to reinit the globals in any caseMichael Adam1-1/+1
The potential previous lp_load of $HOME/.smb/smb.conf might have failed halfway through and might have left globals initialized in an unwanted state. So we should make sure to clean up before loading the dyn_CONFIGFILE()
2011-07-21s3:libsmb: add cli_state_encryption_on()Stefan Metzmacher1-1/+1
metze
2011-07-11s3:libsmbclient: don't log the lowlevel fd in smbc_free_context()Stefan Metzmacher1-2/+2
metze
2011-06-09s3-param Remove special case for global_myname(), rename to lp_netbios_name()Andrew Bartlett1-2/+2
There is no reason this can't be a normal constant string in the loadparm system, now that we have lp_set_cmdline() to handle overrides correctly. Andrew Bartlett
2011-06-09s3-libsmbclient Use workgroup from libsmbclient caller for domain in credentialsAndrew Bartlett1-1/+1
This previously set the workgroup, which is a different thing, but would have been the default if no domain was specified). This more clearly sets the information from the credentials file into the matching field in the credentials structure. Andrew Bartlett
2011-05-06s3-libsmb: move protos to libsmb/proto.hGünther Deschner1-0/+1
Guenther
2011-05-05Fix many const compiler warnings.Jeremy Allison1-3/+3
2011-02-18lib/util/charset Add back setlocale(), but only when called from binariesAndrew Bartlett1-1/+1
When called from a library, we don't want to call this, as we may overwrite some of our calling program's context. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Feb 18 09:29:35 CET 2011 on sn-devel-104
2010-12-31s3: Fix some nonempty blank linesVolker Lendecke1-72/+72
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 31 10:58:31 CET 2010 on sn-devel-104
2010-11-02s3-libsmbclient Don't store 'debug_stderr' on the libsmbclient contextAndrew Bartlett1-11/+0
Following the review of this patch series by Derrell Lipman, remove the seperate storage of the debug_stderr variable from the libsmbclient SMBC_internal_data context. Andrew Bartlett
2010-11-02s3-libsmbclient Add comments to describe the behaviour of DEBUG()Andrew Bartlett1-3/+5
This isn't quite what you would expect from this interface, but actually avoids some really nasty situations if you ever have more than one libsmbclient context in a process. In the real world, if you have asked for DEBUG() to stderr in one part of the code, you will want it globally, even in a different thread (which in the past would have rest everything to stdout again, at least while starting up). Andrew Bartlett
2010-11-02s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett1-3/+2
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
2010-08-05s3-secrets: only include secrets.h when needed.Günther Deschner1-0/+1
Guenther
2010-01-26s3: Enable use of ccache by default for libsmbclientVolker Lendecke1-0/+3
Disable this by setting the environment variable LIBSMBCLIENT_NO_CCACHE, which has the advantage over an smb.conf option to be easily settable per application.
2010-01-24s3-libsmbclient: Add smbc_setOptionUseCCache()Volker Lendecke1-0/+14
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-15Fix bug 7045 - Bad (non memory copying) interfaces in smbc_setXXXX calls.Jeremy Allison1-7/+19
In smbc_free_context libsmbclient just called free() on the string options so it assumes the callers have malloced them before setting them via smbc_set calls. Change to corretly malloc/free string options to the library. Jeremy
2009-08-07Unable to browse DFS when using kerberosBo Yang1-8/+14
Signed-off-by: Bo Yang <boyang@samba.org>
2009-07-15Remove gencache_init/shutdownVolker Lendecke1-1/+0
gencache_get/set/del/iterate call gencache_init() internally anyway. And we've been very lazy calling gencache_shutdown, so this seems not really required.
2009-05-29libsmbclient: make SMBC_module_terminate() static.Michael Adam1-1/+1
Michael
2009-05-13What to do about debugging in a multi-threaded application?Derrell Lipman1-7/+10
- For now, punt. Any thread that requests debug to stderr will establish that for all threads. Derrell
2009-05-13Thread-safe protection: libsmbclient initializationDerrell Lipman1-94/+133
- Begin converting init functions to use SMB_THREAD_ONCE. libsmbclient module-wide initialization is now moved into a separate function and called via SMB_THREAD_ONCE. - libsmbclient counts users (contexts) so that it can release global resources when the last context is closed. That count of contexts is now protected by a mutex. Derrell
2009-03-17Remove the global "struct cm_cred_struct" and associated calls, makeJeremy Allison1-26/+33
callers pass in a struct user_auth_info * instead. This commit causes smbc_set_credentials() to print out a message telling callers to use smbc_set_credentials_with_fallback() instead, as smbc_set_credentials() has a broken API (no SMBCCTX * pointer). No more global variables used in the connection manager API for client dfs calls. Jeremy.
2009-02-23Make char* parameters constDerrell Lipman1-16/+6
- 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-20Change smbc_set_credentials_with_fallback() (unreleased) to useJeremy Allison1-7/+14
const approptiately. Jeremy.
2009-02-20variable grouping: just my OCD desire to keep similar things togetherDerrell Lipman1-5/+7
2009-02-20Make libsmbclient work with DFSBo Yang1-0/+37
Signed-off-by: Derrell Lipman <derrell.lipman@unwireduniverse.com>
2009-02-12[Bug 6069] Add a fstatvfs function for libsmbclientDerrell Lipman1-0/+2
- port functionality from v3_3_test to master Derrell
2009-01-17Determine case sensitivity based on file system attributes.Derrell Lipman1-1/+1
- 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-16Treat file names in POSIX-like case-sensitive fashion by defaultDerrell Lipman1-0/+1
*** 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-15s3: make better use of ccache by not including version.h in every C-file.Michael Adam1-1/+1
version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael
2008-12-14Remove the global "cmdline_auth_info" from source3/lib/util.cVolker Lendecke1-6/+12
This involves changing all our clients, that's why it's so large.
2008-08-12Fix bug 5686 - libsmbclient segfaults with more than one SMBCCTX.Jeremy Allison1-22/+16
Here is a patch to allow many subsystems to be re-initialized. The only functional change I made was to remove the null context tracking, as the memory allocated here is designed to be left for the complete lifetime of the program. Freeing this early (when all smb contexts are destroyed) could crash other users of talloc. Jeremy. (This used to be commit 8c630efd25cf17aff59448ca05c1b44a41964b16)
2008-07-17Use the macro to call samba_version_string().Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <anschneider@suse.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> (This used to be commit d2682295f55a18d526434062834c033aa18e794b)
2008-07-16Merge branch 'v3-3-test' of ssh://git.samba.org/data/git/samba into v3-3-testDerrell Lipman1-0/+19
(This used to be commit 11d74fc51c637b8129304b5de85bbe02a86a69ce)
2008-07-16Fix typos.Derrell Lipman1-1/+1
libsmbclient doesn't have bool defined; rather it uses smbc_bool Derrell (This used to be commit e1ade80f468e8ed827f9d4fd035d79546fa0ee0a)
2008-07-15Release still reachable memory if the smbclient context is freed.Andreas Schneider1-0/+19
Signed-off-by: Andreas Schneider <anschneider@suse.de> (This used to be commit 7a65053bc8579b4f56045fb2c658a91a4af0dfea)
2008-07-08[BUG 5580] Allow access to DFS shares via libsmbclientDerrell Lipman1-0/+20
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 888f922bd0d1c84a687d404e95ae314a9dd0aee1)
2008-03-17Fix use of AuthDataWithContext capabilityDerrell Lipman1-1/+2
During my initial plans for, and the subsequent discussion of a more significant change to the API for libsmbclient, I had removed the AuthDataWithContext usage, in favor of a more generalized planned interface. When the API returned to its original state, I neglected to reinsert this code. Use of an authentication function with the context can be tested using examples/libsmbclient/testbrowse -C Derrell (This used to be commit 38eab68dfb2d8abe8ad00f5a86fc54c778d0d303)
2008-03-06Eliminate global variable in_client and a plethora of extern declarations.Derrell Lipman1-3/+1
Derrell (This used to be commit b7f34e7ef2907b498a0645ce68f2773ed7d60cdc)
2008-03-06Fix a "nested extern declaration" warningVolker Lendecke1-1/+2
(This used to be commit e473e6d50c56f52ef5e4853e4ca3b3548af06f51)
2008-03-03Continued revamping of libsmbclient.Derrell Lipman1-968/+110
- 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 a67f96fbe9683b46c2149f7cb439d13f7f0e6ecd)
2008-03-01Return NULL, not 0, from a function which returns a pointer.Derrell Lipman1-2/+2
(This used to be commit 23cb9c49e3724cecaa66655ef64c3111bf14c552)
2008-03-01Additional revamped libsmbclient documentationDerrell Lipman1-682/+826
- 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 64b7150d92849a1e1e2416b9dcc12fae8d6bea99)
2008-03-01Modified revamp of the libsmbclient interface.Derrell Lipman1-131/+174
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 56429a3d60b2a48963342f6340b3c01469a892c6)