summaryrefslogtreecommitdiffstats
path: root/source/libsmb/libsmbclient.c
Commit message (Collapse)AuthorAgeFilesLines
* Initial revamp of the libsmbclient interface.Derrell Lipman2008-03-041-7233/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 (cherry picked from commit d4b4bae8ded824d06ad5ab0e219f71187ee5c771)
* add smbc_ftruncate() to emulate POSIX ftruncate()Derrell Lipman2008-02-261-0/+75
|
* Fix some typos.Karolin Seeger2008-02-081-1/+1
| | | | Karolin
* Allow clearing all settable DOS mode bits. A mode value of zero is ignored byDerrell Lipman2008-01-231-1/+9
| | | | | | | | | Windows. If the requested mode is zero, we instead send the appropriate one of 0x80 (NORMAL) or 0x10 (DIRECTORY). Thanks Jeremy! Derrell
* Fix typo that disabled setting group id. Thanks, Henrik.Derrell Lipman2008-01-181-1/+1
|
* Fix bug 5185: repeated calls to smbc_getxattr() lose sid-name mappingDerrell Lipman2008-01-171-46/+37
| | | | | | | If we're going to cache connections to IPC$, we'd better also cache the policy handle and not use a stack-based handle that's invalid on subsequent calls. Derrell
* Fix stat results to be consistent between smbc_stat and smbc_fstat.Derrell Lipman2008-01-171-1/+4
| | | | | | | | | | We create a kludged inode based on the checksum of the path. We therefore need to use the same (full) path when calculating it in both smbc_stat() and smbc_fstat(). If struct stat has an rdev field, set it to zero. Derrell
* Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-testDerrell Lipman2008-01-161-272/+310
|\
| * Fix the API exported for auth_functions. Ensure we callJeremy Allison2008-01-151-272/+310
| | | | | | | | | | | | | | passing 3 fstrings/sizeof(fstrings) as 3.0.x did. Found by Derrell. Derrell please test ! Thanks, Jeremy.
* | Fix smbc_listxattr() and friends (bug #5189)Derrell Lipman2008-01-131-4/+7
|/ | | | | | | | | | 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
* Add the options smb_encrypt_level to set the requestedJeremy Allison2008-01-051-0/+98
| | | | | encrypt level and smb_encrypt_on to query it. Jeremy.
* s/sid_to_string/sid_to_fstring/Volker Lendecke2007-12-151-1/+1
| | | | least surprise for callers
* Remove the char[1024] strings from dynconfig. ReplaceJeremy Allison2007-12-101-3/+3
| | | | | | them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy.
* Remove next_token - all uses must now be next_token_talloc.Jeremy Allison2007-12-071-19/+36
| | | | | No more temptations to use static length strings. Jeremy.
* Don't build rpctorture anymore - not maintained. Just remove.Jeremy Allison2007-12-071-7/+12
| | | | | | Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy
* Fix an uninitialized variableVolker Lendecke2007-12-011-1/+1
|
* Fix missing error cleanup noticed by Derrell.Jeremy Allison2007-11-301-3/+6
| | | | Jeremy.
* Removed all pstrings from libsmbclient. Derryl pleaseJeremy Allison2007-11-301-46/+65
| | | | | check. Passes valgrind tests I've run in examples/libsmbclient. Jeremy.
* Add talloc versions of all the next_token() functions.Jeremy Allison2007-11-301-605/+728
| | | | | Now I can really start removing fixed length strings... Jeremy.
* Remove PSTRING_LEN from smbd/ nmbd/.Jeremy Allison2007-11-291-98/+71
| | | | | | | Remove pstring from libsmb/clidfs.c except for a nasty hack (that will be removed when pstrings are gone from client/). Jeremy.
* Remove the explicit TALLOC_CTX * from cli_struct.Jeremy Allison2007-11-291-7/+21
| | | | | | Make us very explicit about how long a talloc ctx should last. Jeremy.
* Add stackframes to public libsmbclient functionsVolker Lendecke2007-11-191-64/+245
| | | | | | | | | | | | | As we use talloc_tos() in inner libsmbclient/ functions more and more, we need to make sure not to create memleaks by not free'ing talloc stackframes. This patch wraps all calls in libsmbclient.c that are publically exported into a talloc_stackframe()/talloc_free() pair. Jeremy, Derrell, can you check this? Thanks, Volker
* Fix some warningsVolker Lendecke2007-11-091-1/+2
|
* Fix for bug 5021Volker Lendecke2007-11-011-1/+5
| | | | | | | This is a different fix than the bug reporter (Evgeniy Dushistov <dushistov at mail.ru>, thanks!) created, but it lives without the boolean status variable. Untested so far, but I can not add attachments to bugs right now. But to me this looks really obvious.
* Change all occurrences of zero_addr(&ss,AF_INET) toJeremy Allison2007-10-271-3/+3
| | | | | | | | zero_addr(&ss). All current uses were always of the AF_INET form, so simplify the call. If in the future we need to zero an addr to AF_INET6 this can be done separately. Jeremy.
* This is a large patch (sorry). Migrate from struct in_addrJeremy Allison2007-10-241-52/+54
| | | | | | | | | | | | | to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy.
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-41/+41
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* Add start of IPv6 implementation. Currently most of this is avoidingJeremy Allison2007-10-101-5/+5
| | | | | | | | | | IPv6 in winbindd, but moves most of the socket functions that were wrongly in lib/util.c into lib/util_sock.c and provides generic IPv4/6 independent versions of most things. Still lots of work to do, but now I can see how I'll fix the access check code. Nasty part that remains is the name resolution code which is used to returning arrays of in_addr structs. Jeremy.
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.samba-misc-tags/initial-v3-2-testGerald (Jerry) Carter2007-10-101-33/+43
|
* r24981: - Use the formal syntax for calling functions through pointers. ↵Derrell Lipman2007-10-101-52/+56
| | | | | | | | | I've wanted to make this change for ages, but now with the issue of "open" requiring it, this is the time to just do all of them. Derrell
* r24969: Fwd port "open" patchSimo Sorce2007-10-101-2/+2
|
* r24864: - Correct failure of libsmbclient against a version of Windows found ↵Derrell Lipman2007-10-101-24/+2
| | | | | | | | | | | | | | | | | | | | on a NAS device. The device resets a NBT connection on port 139 when it receives a NetBIOS keepalive request. That request should be supported when NetBIOS is in use; Windows is behaving badly. libsmbclient needs a way to determine if a connection is still alive, and was using a NetBIOS keepalive request if port 139 was in use (on the assumption that it was probably NBT), and getpeername() when port 139 was not being used (assuming naked transport). This patch simplifies the code by exclusively using getpeername() to check whether a connection is still alive. The NetBIOS keepalive request is optional anyway (with preference being given to using TCP mechanisms for the same purpose), so this should be both simpler and more reliable. Derrell
* r24750: Fix one more caller of name_resolve_bcast().Michael Adam2007-10-101-1/+3
| | | | Michael
* r24543: Apply missing portion of correction for bug 4750Derrell Lipman2007-10-101-0/+5
|
* r24466: - Sort ACEs according to http://support.microsoft.com/kb/269175 so thatDerrell Lipman2007-10-101-10/+72
| | | | | | | Windows Explorer doesn't complain about the order (and so that they get interpreted properly). Derrell
* r24462: - Removing all ACEs was causing removal of the DACL entirely. ↵Derrell Lipman2007-10-101-4/+0
| | | | | | | | | | | | | | | Win2000 ignored the request, presumably due to the PROTECTED flag not being set. Setting that flag (in make_sec_desc()) has much wider implications than just to libsmbclient, so instead of modifying that, we'll remove security descriptors by setting the number of ACEs to zero. At some point, we might want to look into whether we should actually be setting the PROTECTED flag in the DACL. Reference http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/distrib/dsce_ctl_qxju.mspx?mfr=true Derrell
* r24410: - I got tricked by function naming. Contrary to what seemed obvious ↵Derrell Lipman2007-10-101-4/+0
| | | | | | | | | | | | | to me, prs_mem_free() is not the function to be called to free memory allocated by prs_alloc_mem(). I've added a comment so others may not get bitten too. - Remove incorrect memory free calls added yesterday to replace SAFE_FREE. The memory is actually now on a talloc context, so gets freed by the caller when that context is freed. We don't need to free it iternally. Derrell
* r24388: - ACL retrieval provided incomplete information because the buffer ↵Derrell Lipman2007-10-101-9/+22
| | | | | | | | | | | | | | | | | | | | | | | 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
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().Günther Deschner2007-10-101-1/+1
| | | | Guenther
* r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.Jeremy Allison2007-10-101-8/+11
| | | | | Long overdue fix.... Jeremy.
* r23001: - Fix but #4634. Type of the size parameter to getpeername was wrong.Derrell Lipman2007-10-101-1/+1
|
* r22914: - Fixes bug 4599. A missing <code>if</code> statement forced ↵Derrell Lipman2007-10-101-4/+8
| | | | | | | | | | | | 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.
* r22850: - Fixes bug 4601. smbc_getxattr() would not, in one case, properly ↵Derrell Lipman2007-10-101-1/+1
| | | | | | return the required size of a buffer needed to contain the extended attributes.
* r21932: fix compiler warning.Stefan Metzmacher2007-10-101-1/+1
| | | | | | maybe also for 3.0.25 metze
* r21768: Fix the client dfs code such that smbclient canJeremy Allison2007-10-101-15/+0
| | | | | | | | | process deep dfs links (ie. links that go to non root parts of a share). Make the directory handling conanonical in POSIX and Windows pathname processing. dfs should not be fully working in client tools. Please bug me if not. Jeremy.
* r21239: if the workgroup name is longer than 16 chars we get garbage in the ↵Simo Sorce2007-10-101-6/+7
| | | | | | | | string server_len is usually 256 (fstring). Correctly terminate saving the lenght
* r21132: - Fixes bug 4366. Documentation for smbc_utimes() was incorrect.Derrell Lipman2007-10-101-3/+31
| | | | | | | | | | | | | - 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().
* r20832: Remove extra pointers previously added to unique [out] pointers. ↵Jelmer Vernooij2007-10-101-2/+1
| | | | | | | | | Instead, add [ref] pointers where necessary (top-level [ref] pointers, by spec, don't appear on the wire). This brings us closer to the DCE/RPC standard again.