summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
AgeCommit message (Collapse)AuthorFilesLines
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 Tridgell3-11/+25
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 Tridgell2-4/+3
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 Tridgell2-18/+4
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)
2007-10-10r4938: allow the caller to supply an existing event_context if they want toAndrew Tridgell1-2/+8
in smb_composite_connect_send(). This makes doing parallel calls much easier. (This used to be commit 442308970c123b9fb25615673049e1c1c234a0b9)
2007-10-10r4924: continue the effort to simplify and generalise the compositeAndrew Tridgell1-3/+4
interface. This patch removes the "stage" variable, which is really better suited to the backend state structures (This used to be commit 39da684ea8bc72d7a4a12c00eaad56b4f32890a9)
2007-10-10r4891: - added a generic resolve_name() async interface in libcli/resolve/,Andrew Tridgell3-24/+42
which will eventually try all resolution methods setup in smb.conf - only resolution backend at the moment is bcast, which does a parallel broadcast to all configured network interfaces, and takes the first reply that comes in (this nicely demonstrates how to do parallel requests using the async APIs) - converted all the existing code to use the new resolve_name() api - removed all the old nmb code (yay!) (This used to be commit 239c310f255e43dd2d1c2433f666c9faaacbdce3)
2007-10-10r4886: fixed two places where we process the send side of a socket after theAndrew Tridgell1-0/+1
recv side in the same event. That's a bad idea, as the first callback could decide to destroy the socket. (This used to be commit bf74ea34fc0e3c31e220c8f5a9217c95f3ca1d52)
2007-10-10r4811: now that the event context is at the socket level, the event cleanupAndrew Tridgell2-1/+13
should be there too (This used to be commit 058ae5527e3daeb50eeea9e0ecee858c84e7e17d)
2007-10-10r4810: fixed anonymous connections with smbclient. Thanks to jbm for ↵Andrew Tridgell1-2/+6
pointing this out. (This used to be commit 7da0af98a0e0bc743d3c64be30b37cbc45e00737)
2007-10-10r4791: used the new talloc type safety macros to make the "void *private"Andrew Tridgell1-2/+2
pointers in the composite code type safe. This is a bit of an experiement, I'd be interested in comments on whether we should use this more widely. (This used to be commit 0e1da827b380998355f75f4ef4f424802059c278)
2007-10-10r4777: added a smb_composite_sesssetup() async composite function. ThisAndrew Tridgell4-496/+14
encapsulates all the different session setup methods, including the multi-pass spnego code. I have hooked this into all the places that previously used the RAW_SESSSETUP_GENERIC method, and have removed the old RAW_SESSSETUP_GENERIC code from clisession.c and clitree.c. A nice side effect is that these two modules are now very simple again, back to being "raw" session setup handling, which was what was originally intended. I have also used this to replace the session setup code in the smb_composite_connect() code, and used that to build a very simple replacement for smbcli_tree_full_connection(). As a result, smbclient, smbtorture and all our other SMB connection code now goes via these composite async functions. That should give them a good workout! (This used to be commit 080d0518bc7d6fd4bc3ef783e7d4d2e3275d0799)
2007-10-10r4769: added a smb_composite_connect() function that provides a simple asyncAndrew Tridgell2-3/+37
interface to a complete SMB connection setup. Internally it does: - socket connection - session request (if needed) - negprot - session setup - tcon This is the first example of a composite function that builds on other composite components (the socket connection is a composite function, which is used as a building block for this function). I think this will be quite common in composite functions in the future, building up ever more complex composite functions from smaller building blocks, while hiding the details from the caller. There are two things missing from this now. The first is async name resolution routines (wins, bcast, DNS etc), and the second is that this code currently only does a NT1 style session setup. I'll work on adding spnego and old style session setup support next. (This used to be commit 6bc9e17f5c5236f662c7c8f308d03e6d97379b23)
2007-10-10r4767: handle the different NBT session request refusals, and map them toAndrew Tridgell1-10/+41
reasonable NT_STATUS values (This used to be commit b193a9cb0c851a4ec55ad9956a815be93eea35e4)
2007-10-10r4765: simplify the async socket code to always go via the event handlerAndrew Tridgell1-18/+9
rather than short-circuiting in the unlikely event the OS returns an immediate success on a non-blocking connect (This used to be commit db4380717041485e216f965103f9e803518b45c3)
2007-10-10r4758: - added async support to the session request codeAndrew Tridgell4-40/+75
- added async support to the negprot client code - removed two unused parameters from smbcli_full_connection() code - converted smbclient to use smbcli_full_connection() rather than reinventing everything itself (This used to be commit 71cbe2873473e039b4511511302cb63f1c50bce8)
2007-10-10r4757: added the ability of the clisocket level of libcli to handle asyncAndrew Tridgell4-90/+220
socket connections. This was complicated by a few factors: - it meant moving the event context from clitransport to clisocket, so lots of structures changed - we need to asynchronously handle connection to lists of port numbers, not just one port number. The code internally tries each port in the list in turn, without ever blocking - the man page on how connect() is supposed to work asynchronously doesn't work in practice (now why doesn't this surprise me?). The getsockopt() for SOL_ERROR is supposed to retrieve the error, but in fact the next (unrelated) connect() call on the same socket also gets an error, though not the right error. To work around this I need to tear down the whole socket between each attempted port. I hate posix. Note that clisocket.c still does a blocking name resolution call in smbcli_sock_connect_byname(). That will be fixed when we add the async NBT resolution code. Also note that I arranged things so that every SMB connection is now async internally, so using plain smbclient or smbtorture tests all the async features of this new code. (This used to be commit 468f8ebbfdbdf37c757fdc4863626aa9946a8870)
2007-10-10r4726: - use the name tcon and tid instead of conn and cnumStefan Metzmacher1-3/+3
- make use of talloc destructors metze (This used to be commit 8308da6ce4a95f8c10e22949ef00e9e64f2dbb85)
2007-10-10r4591: - converted the other _p talloc functions to not need _pAndrew Tridgell3-5/+5
- added #if TALLOC_DEPRECATED around the _p functions - fixes the code that broke from the above while doing this I fixed quite a number of places that were incorrectly using the non type-safe talloc functions to use the type safe ones. Some were even doing multiplies for array allocation, which is potentially unsafe. (This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
2007-10-10r4549: got rid of a lot more uses of plain talloc(), instead usingAndrew Tridgell3-7/+7
talloc_size() or talloc_array_p() where appropriate. also fixed a memory leak in pvfs_copy_file() (failed to free a memory context) (This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
2007-10-10r4547: - added talloc_new(ctx) macro that is a neater form of the common ↵Andrew Tridgell1-1/+1
talloc(ctx, 0) call. - cleaned up some talloc usage in various files I'd like to get to the point that we have no calls to talloc(), at which point we will rename talloc_p() to talloc(), to encourage everyone to use the typesafe functions. (This used to be commit e6c81d7c9f8a6938947d3c1c8a971a0d6d50b67a)
2007-10-10r4364: - added support for testing of chained SMB operations in smbtortureAndrew Tridgell3-6/+140
- added test for chained OpenX/ReadX, simulating the OS/2 workplace shell - fixed a bug in handling chained fnum in openx and ntcreatex in the server (yes, I'm on holiday, but this bug was annoying me ....) (This used to be commit b3b8958a18e302b815d98c0e3879e404bced6a08)
2007-10-10r4361: fix the buildStefan Metzmacher1-2/+3
metze (This used to be commit 78b2af77e9e4b97c698d6d9e680207b1df289cb4)
2007-10-10r4356: Allow anonymous connections to use NTLMSSP. The silly bugs thatAndrew Bartlett1-1/+0
prevented this are gone. Andrew Bartlett (This used to be commit 87dad5ec538abad93d621078a82f162675847f9f)
2007-10-10r4316: - now that the trans2 code properly supports multi-part requests, we ↵Andrew Tridgell4-7/+7
can set a maximum sized max_data in libcli trans2 code - fixed string termination in the EA_LIST trans2 findfirst level (This used to be commit a2a5f147f4faac8a48ff8f1b3e5f1334c92575bb)
2007-10-10r4315: use the remote hosts max_xmit, not the local hosts, in calculating ↵Andrew Tridgell1-1/+1
max trans2 data sizes (This used to be commit 827008cfebf29d081b457ba7162d89c8150cb24b)
2007-10-10r4263: added support for the trans2 RAW_SEARCH_EA_LIST informationAndrew Tridgell2-2/+61
level. This is quite a strange level that we've never seen before, but is used by the os2 workplace shell. note w2k screws up this level when unicode is negotiated, so it only passes the RAW-SEARCH test when you force non-unicode (This used to be commit 25189b8fbf6515d573e3398dc9fca56505dc37b9)
2007-10-10r4261: added the RAW_FILEINFO_EA_LIST trans2 qfileinfo and qpathinfoAndrew Tridgell2-10/+170
level. Interestingly, this level did now show up on our trans2 scanner previously as we didn't have the FLAGS2_EXTENDED_ATTRIBUTES bit set in the client code. Now that we set that bit, new levels appear in windows servers. (This used to be commit 0b76d405a73e924dc2706f28bbf1084a59c9b393)
2007-10-10r4243: a sniff from kukks showed that the ea_set interface in trans2 ↵Andrew Tridgell2-4/+4
setfileinfo allows for multiple EAs to be set at once. This fixes all the ea code to allow for that. (This used to be commit b26828bef5d55e5eef0e34a164e76292df45e207)
2007-10-10r4229: - added support for multi-part SMBtrans and SMBtrans2 requests in theAndrew Tridgell2-18/+106
client code. This was essential to test the multi-part server code (which I will commit soon) - when the request state is an error, ensure that req->status is not NT_STATUS_OK (This used to be commit ef502c403044b68ccdff15b1a94d447d0f53473d)
2007-10-10r4228: make sure the caller knows the packet is in error when a signing ↵Andrew Tridgell1-0/+1
error occurs (This used to be commit 5e13571e6b9f5eb35f710c2c8bd85b5569665613)
2007-10-10r4182: fixed trans2 mkdir, allowing mkdir with an initial EA listAndrew Tridgell1-2/+2
(This used to be commit 7d981c29c28391813c7f93245f64b3ee108378a4)
2007-10-10r4173: - new t2open code, that can cope with "create with EAs". Many thanksAndrew Tridgell2-7/+7
to kukks on #samba-technical for the sniffs that allowed me to work this out - much simpler ntvfs open generic mapping code - added t2open create with EA torture test to RAW-OPEN test (This used to be commit a56d95ad89b4f32a05974c4fe9a816d67aa369e3)
2007-10-10r4080: missing file from the last commitStefan Metzmacher1-1/+1
metze (This used to be commit ea7b496995573426486b7eab5de822d5602d7368)
2007-10-10r4070: move some defines from asn_1.h to the places they belong toStefan Metzmacher1-3/+2
metze (This used to be commit ab2c2f27e1c61516e885f02bf26350f97209057a)
2007-10-10r4063: - change char * -> uint8_t in struct request_bufferStefan Metzmacher11-32/+32
- change smbcli_read/write to take void * for the buffers to match read(2)/write(2) all this fixes a lot of gcc-4 warnings metze (This used to be commit b94f92bc6637f748d6f7049f4f9a30b0b8d18a7a)
2007-10-10r4055: fixed more places to use type safe allocation macrosAndrew Tridgell2-4/+3
(This used to be commit eec698254f67365f27b4b7569fa982e22472aca1)
2007-10-10r4037: fixed a bunch of "might be uninitialised" warnings after enabling -O1 ↵Andrew Tridgell1-1/+1
in my compile (This used to be commit 0928b1f5b68c858922c3ea6c27ed03b5091c6221)
2007-10-10r4015: correct copyright attributionsAndrew Tridgell1-3/+2
(This used to be commit 078d9ab05bffc79e4f329ea18fe3dafd144d989c)
2007-10-10r3971: fix compiler warningsStefan Metzmacher2-3/+3
metze (This used to be commit 234166606dc86b9e98226cff94b3869ec173671e)
2007-10-10r3903: better fix for -r 3902Stefan Metzmacher1-2/+2
(not introduce new warnings:-) metze (This used to be commit 36b11992dc3b08914db24ec23f10cc8b3eb55320)
2007-10-10r3902: fix compiler warningsStefan Metzmacher1-2/+2
metze (This used to be commit ce7686ac3e15b0d52ef01bd8bd773641c8ce2e35)
2007-10-10r3830: unified the query/set security descriptor code with the rest of theAndrew Tridgell3-17/+29
queryfileinfo/setfileinfo logic, so querying/setting a security descriptor is treated as just another file query/set operation. This will allow NTVFS backends to see the query/set security descriptor operations as RAW_FILEINFO_SEC_DESC and RAW_SFILEINFO_SEC_DESC operations. (This used to be commit f68a6b6b915c37e48c42390c1e74c2d1c2636fa9)
2007-10-10r3829: added a RAW-ACLS test suite that tests query/set of ACLs on a fileAndrew Tridgell1-2/+13
(This used to be commit 2ff9816ae0ae41e0e63e4276a70d292888346dc7)
2007-10-10r3826: - added testing of ea lists in NTTRANS CREATEAndrew Tridgell3-11/+108
- fixed push/pull of chained ea lists - fixed a bug in the nttrans wire encoding (This used to be commit fcd09224076508f9c10095bf2e2c394232a4d297)
2007-10-10r3821: added client side code and test code for NTTRANS_CREATEAndrew Tridgell1-0/+133
(This used to be commit 8422789c06c203ea1c4761fecb16f79f99ac479b)
2007-10-10r3810: create a LIB_SECURITY subsystemStefan Metzmacher1-0/+1
- move dom_sid, security_descriptor, security_* funtions to one place and rename some of them metze (This used to be commit b620bdd672cfdf0e009492e648b0709e6b6d8596)
2007-10-10r3806: added support to smb_server and pvfs for the NTTRANS Create call. ThisAndrew Tridgell1-1/+1
call has an optional sec_desc and ea_list. (This used to be commit 8379ad14e3d51a848a99865d9ce8d56a301e8a3c)
2007-10-10r3654: Add static and fix indentation.Andrew Bartlett2-2/+2
Andrew Bartlett (This used to be commit cef31134ec4cd09eafd4f9f8f64e5fe3d68f19de)
2007-10-10r3652: Fix malloc-history dependent failures in smbtorture.Andrew Bartlett1-6/+7
Because -r 3591 removed the over-allocation, realloc() had a chance of returning a different pointer. This broke the length calculations in the trans2 send code. I think the length calculations coudld be better expressed (less cute PTR_DIFF tricks) but I'm not going to touch this any more than I need to. Andrew Bartlett (This used to be commit 4bfc916a2c3b9745f47ce4eaa892cdcc431e19db)