summaryrefslogtreecommitdiff
path: root/source3/libsmb/libsmbclient.c
AgeCommit message (Collapse)AuthorFilesLines
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)
2007-10-10r20269: merge -r20264:20267 from SAMBA_3_0_24Herb Lewis1-0/+3
more no previous prototype warnings (This used to be commit 41be182f78762372ae13759ede5d2bd40a71d7f5)
2007-10-10r19797: Convert the remaining pipes to the "new" unique out ptr handlingVolker Lendecke1-8/+4
(This used to be commit bc4e0a388a2859d2ddcfb8f07920f3b121a37894)
2007-10-10r19469: Another user of NetShareEnumVolker Lendecke1-0/+4
(This used to be commit 3a1be1626c1e285da70a8fd688a494eb633eee2f)
2007-10-10r18865: fixed some of the most obvious NTSTATUS/WERROR mixups in Samba3. ItAndrew Tridgell1-3/+3
still doesn't compile with immediate structures and the NTSTATUS/WERROR separation, as there are still several places where the two error types are mixed up. I haven't fixed those as they require decisions about the rpcclient code that I really don't want to get into (the error handling there is a mess) So samba3 compiles now, but only becaise HAVE_IMMEDIATE_STRUCTURES is not used (look for HAVE_IMMEDIATE_STRUCTURES_XX_DISABLED) (This used to be commit 8438a6a7d4506d395c8b4bd0e99f9c100e5e3c4e)
2007-10-10r18802: Use the pidl-generated code for the srvsvc interface, both client ↵Jelmer Vernooij1-22/+13
and server code. This has had some basic testing. I'll do more during the next couple of days and hopefully also make RPC-SRVSVC from Samba4 pass against it. (This used to be commit ef10672399c4b82700dc431b4d93431ffdd42d98)
2007-10-10r18745: Use the Samba4 data structures for security descriptors and security ↵Jelmer Vernooij1-30/+30
descriptor buffers. Make security access masks simply a uint32 rather than a structure with a uint32 in it. (This used to be commit b41c52b9db5fc4a553b20a7a5a051a4afced9366)
2007-10-10r18271: Big change:Gerald Carter1-2/+2
* autogenerate lsa ndr code * rename 'enum SID_NAME_USE' to 'enum lsa_SidType' * merge a log more security descriptor functions from gen_ndr/ndr_security.c in SAMBA_4_0 The most embarassing thing is the "#define strlen_m strlen" We need a real implementation in SAMBA_3_0 which I'll work on after this code is in. (This used to be commit 3da9f80c28b1e75ef6d46d38fbb81ade6b9fa951)
2007-10-10r18013: Fix for "bug" (enhancement) 3684.Derrell Lipman1-1/+14
Provide a new option to specify the share mode to be used when opening a file. (This used to be commit 9b6fee5f6f60638ed80fdedcce4b3d29b091f7aa)
2007-10-10r18012: Should fix bug 4018.Derrell Lipman1-1/+9
NetApp filers expect paths in Open AndX Request to have a leading slash. Windows clients send the leading slash, so we should too. (This used to be commit fc5b6e4bd8a67994b0c56d1223c74d064164420f)
2007-10-10r18011: Should fix bug 3835.Derrell Lipman1-4/+28
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 (This used to be commit fa664b24b829f973156486896575c1007b6d7b01)
2007-10-10r18009: Fixes bug 4026.Derrell Lipman1-157/+419
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). (This used to be commit 8e119b64f1d92026dda855d904be09912a40601c)
2007-10-10r17800: Start using struct timespec internally for file timesJeremy Allison1-37/+47
on the wire. This allows us to go to nsec resolution for systems that support it. It should also now be easy to add a correct "create time" (birth time) for systems that support it (*BSD). I'll be watching the build farm closely after this one for breakage :-). Jeremy. (This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d)
2007-10-10r17761: Handle times consistently across all client utils.Jeremy Allison1-2/+2
Fixes bugs reported in libsmbclient. Jeremy. (This used to be commit 42a417fb75313b093948602c3be8e2f386048b5f)
2007-10-10r17571: Change the return code of cli_session_setup from BOOL to NTSTATUSVolker Lendecke1-8/+8
Volker (This used to be commit 94817a8ef53589011bc4ead4e17807a101acf5c9)
2007-10-10r17333: Some C++ warningsVolker Lendecke1-4/+4
(This used to be commit be9aaffdaccae06c8c035eaf31862e34b7cfbe38)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-113/+111
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16644: Fix bug #3887 reported by jason@ncac.gwu.eduJeremy Allison1-2/+2
by converting the lookup_XX functions to correctly return SID_NAME_TYPE enums. Jeremy. (This used to be commit ee2b2d96b60c668e37592c79e86c2fd851e15f69)
2007-10-10r16552: Fix bug 3849.Derrell Lipman1-3/+3
Added a next_token_no_ltrim() function which does not strip leading separator characters. The new function is used only where really necessary, even though it could reasonably be used in many more places, to avoid superfluous code changes. Derrell (This used to be commit d90061aa933f7d8c81973918657dd72cbc88bab5)
2007-10-10r16550: Fix bug 3866. Thanks for the report!Derrell Lipman1-6/+41
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 c1b4c510530ca3118d1eccb9615a8cad732c7373)
2007-10-10r16360: Fix Klocwork ID 136 520 521 522 523 542 574 575 576 607Volker Lendecke1-1/+3
in net_rpc.c: 715 716 732 734 735 736 737 738 739 749 in net_rpc_audit.c: 754 755 756 in net_rpc_join.c: 757 in net_rpc_registry: 766 767 in net_rpc_samsync.c: 771 773 in net_sam.c: 797 798 Volker (This used to be commit 3df0bf7d6050fd7c9ace72487d4f74d92e30a584)
2007-10-10r16287: Use intptr_t to return an integer of an unknown type castJeremy Allison1-0/+4
to void *. Jeremy. (This used to be commit e24361ecddef8a48a42a356775b93ce5c4027fae)
2007-10-10r14664: r13868@cabra: derrell | 2006-03-22 17:04:30 -0500Derrell Lipman1-14/+89
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 203b4911c16bd7e10198a6f0e63960f2813025ef)