summaryrefslogtreecommitdiff
path: root/source4/libcli/raw/clitransport.c
AgeCommit message (Collapse)AuthorFilesLines
2008-04-02Install public header files again and include required prototypes.Jelmer Vernooij1-3/+5
(This used to be commit 47ffbbf67435904754469544390b67d34c958343)
2008-02-21Remove more uses of global_loadparm.Jelmer Vernooij1-2/+3
(This used to be commit 47d05ecf6fef66c90994f666b8c63e2e7b5a6cd8)
2008-02-14Convert SMB and SMB2 code to use a common buffer handling structureAndrew Tridgell1-1/+3
This converts our SMB and SMB2 code to use a common structure "struct request_bufinfo" for information on the buffer bounds of a packet, alignment information and string handling. This allows us to use a common backend for SMB and SMB2 code, while still using all the same string and blob handling functions. Up to now we had been passing a NULL req handle into these common routines from the SMB2 side of the server, which meant that we failed any operation which did a bounds checked string extraction (such as a RenameInformation setinfo call, which is what Vista uses for renaming files) There is still some more work to be done on this - for example we can now remove many of the SMB2 specific buffer handling functions that we had, and use the SMB ones. (This used to be commit ca6d9be6cb6a403a81b18fa6e9a6a0518d7f0f68)
2008-01-03r26654: libcli/smb_composite: Rather than specifying each of the gazillion ↵Jelmer Vernooij1-10/+2
options for SMB individually, just specify the smbcli_options struct. (This used to be commit 8a97886e24a4b969aa91409c06f423b71a45f6eb)
2008-01-03r26651: libsmb: Allow specifying signing policy from higher up.Jelmer Vernooij1-1/+3
The number of arguments is getting a bit excessive now, so it probably makes sense to pass in the smbcli_options struct rather than all members individually and add a convenience function for obtaining a smbcli_options struct from a loadparm context. (This used to be commit 9f64213463b5bf3bcbf36913139e9a5042e967a2)
2008-01-02r26644: Janitorial: Pass resolve_context explicitly to various SMB ↵Jelmer Vernooij1-3/+3
functions, should help fix the build for OpenChange. (This used to be commit 385ffe4f4cc9a21a760c0f00410f56e2592fd507)
2007-12-21r26266: Remove more global_loadparm uses.Jelmer Vernooij1-3/+5
(This used to be commit 99113075c4a96679bcec4f4d6bba4acb3dee4245)
2007-10-10r25554: Convert last instances of BOOL, True and False to the standard types.Jelmer Vernooij1-8/+9
(This used to be commit 566aa14139510788548a874e9213d91317f83ca9)
2007-10-10r25398: Parse loadparm context to all lp_*() functions.Jelmer Vernooij1-3/+4
(This used to be commit 3fcc960839c6e5ca4de2c3c042f12f369ac5f238)
2007-10-10r25026: Move param/param.h out of includes.hJelmer Vernooij1-0/+1
(This used to be commit abe8349f9b4387961ff3665d8c589d61cd2edf31)
2007-10-10r24994: Fix some C++ warnings.Jelmer Vernooij1-1/+1
(This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39)
2007-10-10r23792: convert Samba4 to GPLv3Andrew Tridgell1-3/+2
There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
2007-10-10r23138: added a raw interface for SMBecho operationsAndrew Tridgell1-0/+68
(This used to be commit 590c6c21db5abd436441a9af62ee65436d6f1222)
2007-10-10r23057: only call the async recv function for the first pending receive, notAndrew Tridgell1-2/+5
all pending receives, when the transport dies. This is because the async callback most commonly shuts down the connection (it's the only reasonable thing to do when it's dead), and that frees the whole context. That means that if we loop more than once, we'll end up using freed memory. (This used to be commit 75d537d3a5e3fc5258ce48bfec0c0ce6160978f6)
2007-10-10r17930: Merge noinclude branch:Jelmer Vernooij1-1/+1
* Move dlinklist.h, smb.h to subsystem-specific directories * Clean up ads.h and move what is left of it to dsdb/ (only place where it's used) (This used to be commit f7afa1cb77f3cfa7020b57de12e6003db7cfcc42)
2007-10-10r17020: pass the real error to the failing requestsStefan Metzmacher1-4/+8
metze (This used to be commit 49b96ac44a883c020c69df7a12df154dc4faa4d5)
2007-10-10r15854: more talloc_set_destructor() typesafe fixesAndrew Tridgell1-5/+2
(This used to be commit 61c6100617589ac6df4f527877241464cacbf8b3)
2007-10-10r14464: Don't include ndr_BASENAME.h files unless strictly required, insteadJelmer Vernooij1-0/+1
try to include just the BASENAME.h files (containing only structs) (This used to be commit 3dd477ca5147f28a962b8437e2611a8222d706bd)
2007-10-10r12725: some minor updatesStefan Metzmacher1-1/+1
metze (This used to be commit f2e97983f278211c6d70400ce1f43d6a69df0d8a)
2007-10-10r12608: Remove some unused #include lines.Jelmer Vernooij1-1/+0
(This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981)
2007-10-10r12542: Move some more prototypes out to seperate headersJelmer Vernooij1-0/+1
(This used to be commit 0aca5fd5130d980d07398f3291d294202aefe3c2)
2007-10-10r11982: ensure the fde event gets freed before the socket itself, as otherwiseAndrew Tridgell1-1/+1
we get a error from epoll about disabling events for a file descriptor that is closed (This used to be commit f32739307464a1f0c835cff886b8c4b960778900)
2007-10-10r11812: Convert winbind to the async bind routines. Also remove tridge's ↵Volker Lendecke1-4/+0
hack for the winbind "bug" :-) Volker (This used to be commit fb9a3c7ef376f289288c71bc47d67f548ddb7194)
2007-10-10r11714: put in a workaround for a winbind problem volker asked me about. TheAndrew Tridgell1-1/+4
problem is that winbind currently relies on being able to receive on a smb connection from within the same connections receive routine. This means it relies on a non-serialised connection, so disable the serialisation until winbind is fixed. The correct fix will be to get rid of full_request() in dcerpc.c so that bind requests can be fully async. (This used to be commit c4115293d83a4a6d103e049c5832d4bcdc0a9dbc)
2007-10-10r11713: separate out the setting of the fde in the packet context from theAndrew Tridgell1-1/+2
enabling of packet serialisation (This used to be commit 6a47cd65a8b588f9ddd375c57caaba08281e7cbb)
2007-10-10r11669: - make sure req is initializedStefan Metzmacher1-1/+4
- call async callback on error metze (This used to be commit 43aa5cffd3fd8bf07b236a039f5146e1e44296c6)
2007-10-10r11660: - the libcli/raw/ lib no longer uses the SMBCLI_REQUEST_SEND state, orAndrew Tridgell1-6/+0
the associated send queue - fixed negnowait to not watch for the SMBCLI_REQUEST_SEND state (This used to be commit d19235ede5d352d0b0373d204f4357dddde5946f)
2007-10-10r11649: - add support for ntcancel replies (they only happen in error cases,Stefan Metzmacher1-0/+3
e.g when you supply an invalid TID or VUID) - as we don't yet understand how to check the smb_signing of this replies, we just ignore the whole packet abartlet,jra,tridge: can someone try to find out how to create and verify the signatures for this replies. what I noticed is that still use the increment by one for the request, and later requests are still generated fine, only the generating and verifying of the ntcancel replies make problems metze (This used to be commit e6eb0fd2c2f45d6f612d74c6b527c7b17094c907)
2007-10-10r11647: add smbcli_ prefixStefan Metzmacher1-1/+1
metze (This used to be commit 356e7d037cf3fc24844b2efa5071917ea03e6163)
2007-10-10r11644: free the buffer when it's not usedStefan Metzmacher1-0/+2
metze (This used to be commit 16f2d92618a55188d260cadd144281b325cdacda)
2007-10-10r11636: a bit neater solution to the nt_cancel problemAndrew Tridgell1-10/+1
(This used to be commit ba7864b07eebecd4d4eb2ce515412a49964ae179)
2007-10-10r11635: fix a handling of packet_send in the smb client libStefan Metzmacher1-1/+10
this was cause of the PANIC on the build farm on metze01 as we use req->out.buffer from the old request in the smb_raw_ntcancel() and send a 0 TID, that causes our server code to crash (a fix for the server code will follow) metze (This used to be commit 97cd824e44b03178706b108c7a78753faf412e8f)
2007-10-10r11609: fixed handling of one way requests with new send codeAndrew Tridgell1-3/+4
(This used to be commit d2b568a1114015839ca59c6f32bde4b06ea81ef9)
2007-10-10r11606: use the generic packet send code in libcli/raw/Andrew Tridgell1-77/+23
(This used to be commit 0bcea45b15b08cb42d7f6fbbb3a25f73b95f362c)
2007-10-10r11596: switched the libcli/raw/ code over to using the lib/stream/ genericAndrew Tridgell1-75/+47
packet parsing code. This simplifies the logic in the raw client library a fair bit (This used to be commit f8d43f1f67876360e1295d85a3c3702d1d60ed7b)
2007-10-10r10754: fixed a valgrind error for unmatched SMB repliesAndrew Tridgell1-3/+3
(This used to be commit b714ab64fd79d5cabc39779774fae7c3861a84da)
2007-10-10r10542: if the transport is dead we need to returnStefan Metzmacher1-0/+3
tridge: I think this is correct, comments? metze (This used to be commit e06ca726f3df013d869d943338bc6b7a151cdd3f)
2007-10-10r8407: fixed a bug left over from our old socket code.Andrew Tridgell1-23/+33
Thanks to lha for giving me a login on a netbsd machine to see this (This used to be commit 4e66f682e4f1c31bbe9441a13af2c245db31433d)
2007-10-10r8111: fixed the client library to work against w2k3 with nt status codesAndrew Tridgell1-1/+1
disabled. The main change is to turn off spnego, which cannot work at all without nt status codes (w2k3 gives a ERRHRD:ERRgeneral error when you try) I also modified NT_STATUS_EQUAL() to allow for nt->dos code equality, but only when nt status codes are disabled in smb.conf. That keeps all the existing torture code working, while still allowing us to correctly catch the cases where forced dos error codes are needed The dos->ntstatus mapping table has been removed completely, as it doesn't really make sense, is impossible to get right, and with the new dos status handling isn't needed. When matching a nt status code to a dos status code it makes far more sense to map from the nt code to the dos code and compare, rather than the reverse, as the nt->dos mapping is what windows has to do internally, so there really is a valid mapping table. (This used to be commit f21274e07b361ef40fdc0fe23e96f1c9c63a091c)
2007-10-10r8104: - added support for our client library to not negotiate nt status ↵Andrew Tridgell1-7/+14
codes, controlled with 'nt status support' option. - make nt_errstr() display nice strings for dos status codes encoded using NT_STATUS_DOS() - no longer map between dos and nt status codes in the client library, instead return using NT_STATUS_DOS() - fixed the RAW-CONTEXT test to look for NT_STATUS_DOS(ERRSRV, ERRbaduid) instead of NT_STATUS_INVALID_HANDLE (This used to be commit ff5549e87ffae9f062394f30d8fd1ae95b614735)
2007-10-10r7654: - add a timeout to all smb requests (default 60 seconds)Andrew Tridgell1-0/+46
- add a request destructor, to make it safe to destroy a pending request with talloc_free() (This used to be commit 72c6988767249caa585f37fec4c0afbf41557ec2)
2007-10-10r5322: removed a whole bunch of #include lines that minimal_includes.plAndrew Tridgell1-1/+0
thinks are not needed. Now to see how this fares on the build farm :) (This used to be commit 80ffcc650c9c86141507edd8338b97814a85f868)
2007-10-10r5304: removed lib/socket/socket.h from includes.hAndrew Tridgell1-0/+1
(This used to be commit b902ea546d2d1327b23f40ddaeeaa8e7e3662454)
2007-10-10r5197: moved events code to lib/events/ (suggestion from metze)Andrew Tridgell1-1/+1
(This used to be commit 7f54c8a339f36aa43c9340be70ab7f0067593ef2)
2007-10-10r5195: most events don't need the time of the event, so save a ↵Andrew Tridgell1-1/+0
gettimeofday() call and just use timeval_current() when its actually needed (This used to be commit 236403cc4dc2924ed6a898acae0bb44cc1688dcc)
2007-10-10r5185: make all the events data structures private to events.c. This willAndrew Tridgell1-17/+28
make it possible to add optimisations to the events code such as keeping the next timed event in a sorted list, and using epoll for file descriptor events. I also removed the loop events code, as it wasn't being used anywhere, and changed timed events to always be one-shot (as adding a new timed event in the event handler is so easy to do if needed) (This used to be commit d7b4b6de51342a65bf46fce772d313f92f8d73d3)
2007-10-10r4954: we don't need the separate event_remove_*() calls any more, as you nowAndrew Tridgell1-1/+1
remove an event by calling talloc_free(). (This used to be commit 8f19b6886cc58a56d52aecfc83a175197061e533)
2007-10-10r4951: some of the code dealing with libcli was getting too complex trying toAndrew Tridgell1-5/+8
handle the inverted memory hierarchy that a normal session establishment gave. The inverted hierarchy came from that fact that you first establish a socket, then a transport, then a session and finally a tree. That leads to the socket being at the top of the memory hierarchy and the tree at the bottom, which makes no sense from the users point of view, as they want to be able to free the tree and have everything disappear. The core problem was that the libcli interface didn't distinguish between establishing a primary context and a secondary context. If you establish a 2nd session on a transport then you want the transport to be referenced by the session, whereas if you establish a primary session then you want the transport to be a child of the session. To fix this I have added "parent_ctx" and "primary" arguments to the libcli intialisation functions. This makes using the library much easier, and gives us a memory hierarchy that makes much more sense. I was prompted to do this by a bug in the cifs backend, which was caused by the socket not being properly torn down on a disconnect due to the inverted memory hierarchy. (This used to be commit 5e8fd5f70178992e249805c2e1ddafaf6840739b)
2007-10-10r4944: every event_add_*() caller was having to call talloc_steal() to takeAndrew Tridgell1-2/+2
control of the event, so instead build that into the function. If you pass NULL as mem_ctx then it leaves it as a child of the events structure. (This used to be commit 7f981b9ed96f39027cbfd500f41e0c2be64cbb50)
2007-10-10r4943: Smplified the events handling code a lot. The first source ofAndrew Tridgell1-1/+1
complexity was that events didn't automatically cleanup themselves. This was because the events code was written before we had talloc destructors, so you needed to call event_remove_XX() to clean the event out of the event lists from every piece of code that used events. I have now added automatic event destructors, which in turn allowed me to simplify a lot of the calling code. The 2nd source of complexity was caused by the ref_count, which was needed to cope with event handlers destroying events while handling them, which meant the linked lists became invalid, so the ref_count ws used to mark events for later destruction. The new system is much simpler. I now have a ev->destruction_count, which is incremented in all event destructors. The event dispatch code checks for changes to this and handles it. (This used to be commit a3c7417cfeab429ffb22d5546b205818f531a7b4)