summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmbclient.c
AgeCommit message (Collapse)AuthorFilesLines
2008-02-26add smbc_ftruncate() to emulate POSIX ftruncate()Derrell Lipman1-0/+75
(This used to be commit 6f5051b9c1405ab1dc3e697419ceedb3acac46d8)
2008-02-08Fix some typos.Karolin Seeger1-1/+1
Karolin (This used to be commit 2bec0a1fb7857e6fb8ec15e5f597b2d4125f105b)
2008-01-23Allow clearing all settable DOS mode bits. A mode value of zero is ignored byDerrell Lipman1-1/+9
Windows. If the requested mode is zero, we instead send the appropriate one of 0x80 (NORMAL) or 0x10 (DIRECTORY). Thanks Jeremy! Derrell (This used to be commit 54abf7d0e595e9cbeea115a40d4f7b995252a150)
2008-01-18Fix typo that disabled setting group id. Thanks, Henrik.Derrell Lipman1-1/+1
(This used to be commit 843e1694cfe4a999ed14a9c215b8e77723d0fe79)
2008-01-17Fix bug 5185: repeated calls to smbc_getxattr() lose sid-name mappingDerrell Lipman1-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 (This used to be commit 67c415661f6466c21cd0eaafabe58cba049d2af3)
2008-01-17Fix stat results to be consistent between smbc_stat and smbc_fstat.Derrell Lipman1-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 (This used to be commit b4282fbd6d27d868b2d5c04bb72d2d7421822da1)
2008-01-16Merge branch 'v3-2-test' of git://git.samba.org/samba into v3-2-testDerrell Lipman1-272/+310
(This used to be commit f963d57096184dd9381fcc5f175150d27460ea7a)
2008-01-15Fix the API exported for auth_functions. Ensure we callJeremy Allison1-272/+310
passing 3 fstrings/sizeof(fstrings) as 3.0.x did. Found by Derrell. Derrell please test ! Thanks, Jeremy. (This used to be commit 5467db388355a4769e48fed7eb80920d1820f727)
2008-01-13Fix smbc_listxattr() and friends (bug #5189)Derrell Lipman1-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 (This used to be commit 913c335d21c503d32b35bf65da7b2bddf0473875)
2008-01-05Add the options smb_encrypt_level to set the requestedJeremy Allison1-0/+98
encrypt level and smb_encrypt_on to query it. Jeremy. (This used to be commit 07d47996f9535731ccdc1792c405c8bee1a082ae)
2007-12-15s/sid_to_string/sid_to_fstring/Volker Lendecke1-1/+1
least surprise for callers (This used to be commit eb523ba77697346a365589101aac379febecd546)
2007-12-10Remove the char[1024] strings from dynconfig. ReplaceJeremy Allison1-3/+3
them with malloc'ing accessor functions. Should save a lot of static space :-). Jeremy. (This used to be commit 52dc5eaef2106015b3a8b659e818bdb15ad94b05)
2007-12-07Remove next_token - all uses must now be next_token_talloc.Jeremy Allison1-19/+36
No more temptations to use static length strings. Jeremy. (This used to be commit ec003f39369910dee852b7cafb883ddaa321c2de)
2007-12-07Don't build rpctorture anymore - not maintained. Just remove.Jeremy Allison1-7/+12
Remove all vestiges of pstring (except for smbctool as noted in previous commit). Jeremy (This used to be commit 4c32a22ac50ada3275d2ffba3c1aa08bee7d1549)
2007-12-01Fix an uninitialized variableVolker Lendecke1-1/+1
(This used to be commit edce7bd7a9dd1064ba8aec34b334c7395228f40b)
2007-11-30Fix missing error cleanup noticed by Derrell.Jeremy Allison1-3/+6
Jeremy. (This used to be commit 37f00926c29c22f27e7192c1fff0a08ce136cb86)
2007-11-30Removed all pstrings from libsmbclient. Derryl pleaseJeremy Allison1-46/+65
check. Passes valgrind tests I've run in examples/libsmbclient. Jeremy. (This used to be commit 9d0034faed939a4534637696f1631ac2da60e4a3)
2007-11-30Add talloc versions of all the next_token() functions.Jeremy Allison1-605/+728
Now I can really start removing fixed length strings... Jeremy. (This used to be commit 0ae61e26547e594e94037d4474a008221e5df8cf)
2007-11-29Remove PSTRING_LEN from smbd/ nmbd/.Jeremy Allison1-98/+71
Remove pstring from libsmb/clidfs.c except for a nasty hack (that will be removed when pstrings are gone from client/). Jeremy. (This used to be commit cc257b71d13daa47e6f2315d0f07a60eb4aaeca6)
2007-11-29Remove the explicit TALLOC_CTX * from cli_struct.Jeremy Allison1-7/+21
Make us very explicit about how long a talloc ctx should last. Jeremy. (This used to be commit ba9e2be2b5a59684e854609f9d82ea1633448c62)
2007-11-19Add stackframes to public libsmbclient functionsVolker Lendecke1-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 (This used to be commit db9fa472a89eb78a7b1f7cabcf195331c3b448d9)
2007-11-09Fix some warningsVolker Lendecke1-1/+2
(This used to be commit 0a1f524e8cce9bbe4fd10467c1f64f7a8862d298)
2007-11-01Fix for bug 5021Volker Lendecke1-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. (This used to be commit b481abf5914dcafe5642c4d9394d02603e905bbb)
2007-10-27Change all occurrences of zero_addr(&ss,AF_INET) toJeremy Allison1-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 used to be commit 2e92418a138bf2738b77b7e0fcb2fa37ad84fc0c)
2007-10-24This is a large patch (sorry). Migrate from struct in_addrJeremy Allison1-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. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
2007-10-18RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison1-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. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
2007-10-10Add start of IPv6 implementation. Currently most of this is avoidingJeremy Allison1-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. (This used to be commit 3f6bd0e1ec5cc6670f3d08f76fc2cd94c9cd1a08)
2007-10-10[GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter1-33/+43
(This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
2007-10-10r24981: - Use the formal syntax for calling functions through pointers. ↵Derrell Lipman1-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 (This used to be commit e746aaaf4db7099252ef048da7857bd488cb681f)
2007-10-10r24969: Fwd port "open" patchSimo Sorce1-2/+2
(This used to be commit 113d62682ae8b045ff0132a743a32f3bc4856d54)
2007-10-10r24864: - Correct failure of libsmbclient against a version of Windows found ↵Derrell Lipman1-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 (This used to be commit 1f122352b02e3f4be9ac2d638b18807dafd05429)
2007-10-10r24750: Fix one more caller of name_resolve_bcast().Michael Adam1-1/+3
Michael (This used to be commit 757b5c1bd7ff3d6bbf99753c1b617338ee837531)
2007-10-10r24543: Apply missing portion of correction for bug 4750Derrell Lipman1-0/+5
(This used to be commit 5a83c306bb80b492a3c3d5e86b0767dc45e5c262)
2007-10-10r24466: - Sort ACEs according to http://support.microsoft.com/kb/269175 so thatDerrell Lipman1-10/+72
Windows Explorer doesn't complain about the order (and so that they get interpreted properly). Derrell (This used to be commit 8f371e2ea97a3b58d1c7c3aa1368a0904295f681)
2007-10-10r24462: - Removing all ACEs was causing removal of the DACL entirely. ↵Derrell Lipman1-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 (This used to be commit 319df380e579fd860348a8f08a584e13161dde9d)
2007-10-10r24410: - I got tricked by function naming. Contrary to what seemed obvious ↵Derrell Lipman1-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 (This used to be commit 2fde343150c17959fc970b18e1eb4efde800b4db)
2007-10-10r24388: - ACL retrieval provided incomplete information because the buffer ↵Derrell Lipman1-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 (This used to be commit 2ac502e29bd8390252fe4ae8344faab49ca01ff5)
2007-10-10r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell1-2/+1
(This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
2007-10-10r23779: Change from v2 or later to v3 or later.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
2007-10-10r23627: Allow to pass down the lookup-level to rpccli_lsa_lookup_names().Günther Deschner1-1/+1
Guenther (This used to be commit e9a7512a9f630340004913f1379452eea8a9b6ae)
2007-10-10r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.Jeremy Allison1-8/+11
Long overdue fix.... Jeremy. (This used to be commit 073fdc5a58139796dbaa7ea9833dca5308f11282)
2007-10-10r23001: - Fix but #4634. Type of the size parameter to getpeername was wrong.Derrell Lipman1-1/+1
(This used to be commit 6675c8acf1d83b7131d38f09f381062b6a604c7e)
2007-10-10r22914: - Fixes bug 4599. A missing <code>if</code> statement forced ↵Derrell Lipman1-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. (This used to be commit 7213b5ebec8cd7f1955f5aa8ee4050c39cd11ed1)
2007-10-10r22850: - Fixes bug 4601. smbc_getxattr() would not, in one case, properly ↵Derrell Lipman1-1/+1
return the required size of a buffer needed to contain the extended attributes. (This used to be commit 34f77af02e2073ccaabe1583011abeeabbbb24e1)
2007-10-10r21932: fix compiler warning.Stefan Metzmacher1-1/+1
maybe also for 3.0.25 metze (This used to be commit 844dac912cb549b0524571df80fbaa7f2d9c36c2)
2007-10-10r21768: Fix the client dfs code such that smbclient canJeremy Allison1-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. (This used to be commit 1c9e10569cd97ee41de39f9f012bea4e4c932b5d)
2007-10-10r21239: if the workgroup name is longer than 16 chars we get garbage in the ↵Simo Sorce1-6/+7
string server_len is usually 256 (fstring). Correctly terminate saving the lenght (This used to be commit e7e44554bf7c61020e2c5c652e3f8f37a296d3aa)
2007-10-10r21132: - Fixes bug 4366. Documentation for smbc_utimes() was incorrect.Derrell Lipman1-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(). (This used to be commit 2f9be59c10ef991a51cc858ab594187b5ca61382)
2007-10-10r20832: Remove extra pointers previously added to unique [out] pointers. ↵Jelmer Vernooij1-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. (This used to be commit 580f2a7197b1bc9db14a643fdd112b40ef37aaef)
2007-10-10r20333: Fix a couple of Coverity errors in one run, this was a potential ↵Volker Lendecke1-5/+8
NULL dereference (This used to be commit f9edfffeb5aa1fe0700c17cd1c8141c906080188)