summaryrefslogtreecommitdiff
path: root/source4/libcli
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r5092: Add a bit more const - moving it further into the LDB layer.Andrew Bartlett1-2/+2
Andrew Bartlett (This used to be commit ffad9b22be595279b247fa72d51145830fecbb06)
2007-10-10r5053: - fix up the library dependencies so that tools that need nbt don'tAndrew Tridgell3-5/+5
need to pull in the whole dcerpc subsystem - moved smbencrypt.c code into libcli/auth/ (This used to be commit 3351c636af23ad88649e84f4cb88fc1167d5c654)
2007-10-10r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for theAndrew Tridgell29-80/+80
large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10r5034: - added a type mapping function in pidl, so the type names in our IDLAndrew Tridgell1-6/+6
files don't need to match the type names in the generated headers - with this type mapping we no longer need definitions for the deprecated "int32", "uint8" etc form of types. We can now force everyone to use the standard types int32_t, uint8_t etc. - fixed all the code that used the deprecated types - converted the IDL types "int64" and "uint64" to "dlong" and "udlong". These are the 4 byte aligned 64 bit integers that Microsoft internally define as two 32 bit integers in a structure. After discussions with Ronnie Sahlberg we decided that calling these "int64" was confusing, as it implied a true 8 byte aligned type - fixed all the cases where we incorrectly used things like "NTTIME_hyper" in our C code. The generated API now uses a NTTIME for those. The fact that it is hyper-aligned on the wire is not relevant to the API, and should remain just a IDL property (This used to be commit f86521677d7ff16bdc4815f9524e5286026f10f3)
2007-10-10r4958: fix compiler warningsStefan Metzmacher1-2/+2
metze (This used to be commit 522af7ecc0020b7c56182ca628f6d1623abe303e)
2007-10-10r4957: the fetchfile _recv() function was neglecting to steal the data andAndrew Tridgell1-1/+11
free the connection context. This left a whole lot of state hanging around and didn't give the memory to the caller properly (This used to be commit 3e13e1d526563d91cb2342ae68455e54eb49a9bd)
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-10r4952: removed a bogus talloc_steal() that was trying to cope with theAndrew Tridgell1-1/+0
inverted memory hierarchy. Now the memory hierarchy is logical its not needed (and can cause a double free in RPC-SCHANNEL) (This used to be commit f8a950b57d7137c6fd0a77d063d946b4f9b3f014)
2007-10-10r4951: some of the code dealing with libcli was getting too complex trying toAndrew Tridgell6-24/+32
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-10r4950: removed some excessive debugging messagesAndrew Tridgell1-8/+0
(This used to be commit 4a351901aa49090700d89274559d6dda76f06b7d)
2007-10-10r4949: First version of a fetchfile composite function which connects to a ↵Volker Lendecke3-1/+208
server and loads a file. Needs a smb url parsing wrapper. Volker (This used to be commit fa435bf7c878d4a5beb6afb2ed6e2990abc11e82)
2007-10-10r4944: every event_add_*() caller was having to call talloc_steal() to takeAndrew Tridgell4-11/+6
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 Tridgell4-33/+7
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 Tridgell3-7/+14
in smb_composite_connect_send(). This makes doing parallel calls much easier. (This used to be commit 442308970c123b9fb25615673049e1c1c234a0b9)
2007-10-10r4937: simplify the connect code in the same wayAndrew Tridgell1-15/+12
(This used to be commit 347dfa47249d55c61e1e7c82d10444a71aca8a85)
2007-10-10r4936: moved to a convention where the completion function is only called inAndrew Tridgell2-24/+18
one place. This makes the code more robust, and simpler (it would have prevented the error that volker found). (This used to be commit 420b53091ee784d7891fb62d48e2f5a225b4dbf8)
2007-10-10r4935: fixed a bug where "c->status = xxx_handler(x);" could write to c afterAndrew Tridgell3-15/+22
it is freed. The problem is that the handler might complete the request, and called the c->async.fn() async handler. That handler might free the request handle. (This used to be commit c4faceadc74e0849f6197ccbec9952f6c94f6176)
2007-10-10r4927: parse the NBT session request in the smb server. This gets rid of thatAndrew Tridgell1-1/+12
annoying "not parsing session request" message on each SMB connection (This used to be commit b06b8dd2f4f4fea750b05fd29d68372828159f16)
2007-10-10r4924: continue the effort to simplify and generalise the compositeAndrew Tridgell5-22/+22
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-10r4922: fixed an infinite loop in the name resolve code when handling a methodAndrew Tridgell1-3/+1
in smb.conf that isn't implemented in the library (This used to be commit dd5b43ed37b37feec4708f8f13033b42eb6a838c)
2007-10-10r4919: if a caller doesn't provide an event context to the resolver library,Andrew Tridgell1-1/+6
then create one. This fixes a crash in the RAW-NEGNOWAIT test for 'host' resolution. (This used to be commit 3268d523cc381b9b3077f794bb53daf0865d139c)
2007-10-10r4916: added "host" name resolution using fork() per gethostbyname()Andrew Tridgell3-17/+270
comments welcome, but please think about the alternatives first :-) (This used to be commit 3d40b479907226be349137117e0d2bd718efa1a8)
2007-10-10r4915: free temp context _before_ the async callback, as the async callback ↵Andrew Tridgell1-1/+1
might destroy our top level context leaving the tmp context freed (so a double free) (This used to be commit b20c0561b8ec3ec7010f846be7a39165783e15c2)
2007-10-10r4911: make sure we fill in the transport called name on port 445 as wellAndrew Tridgell1-6/+9
(thanks to abartlet for spotting this bug) (This used to be commit 8b653f12f21e7a8eee8e60cefb193505c2df7f8f)
2007-10-10r4909: fixed name_trn_id generation (thanks to metze for spotting the bug!)Andrew Tridgell1-1/+3
(This used to be commit 9d2d16ce5fd57cad01ddaf1112beed916cc2088d)
2007-10-10r4901: a bit more info on nbt packets under high debug levelAndrew Tridgell1-2/+5
(This used to be commit 9a34af29388d8ca837c670d054a76d1f75098cbd)
2007-10-10r4898: - removed the unused wins_srv_*() codeAndrew Tridgell6-106/+359
- expanded the generic async name resolver to try multiple methods - added wins resolutions to the list of methods tried - fixed up the random trn id generation to use the good random generator (This used to be commit 266fd2751c01808e5a18d4094032af50554ceb7a)
2007-10-10r4896: make sure the event context doesn't go away while waiting for event ↵Andrew Tridgell1-1/+1
completion (This used to be commit c1063919c069b0b36dd3da6dc6853236629804e3)
2007-10-10r4894: namecache.c is not used any more eitherAndrew Tridgell1-247/+0
(This used to be commit 24927e69d824a1f3c01b2f63876afdfc6064d5ac)
2007-10-10r4893: Move to using secrets.ldb for the Kerberos verify, instead ofAndrew Bartlett1-12/+33
secrets.tdb from Samba3. Andrew Bartlett (This used to be commit 21bfda2a0d1c8373f8800269ed9b982e1b9a19e5)
2007-10-10r4891: - added a generic resolve_name() async interface in libcli/resolve/,Andrew Tridgell16-2730/+414
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-10r4890: Try to cope with mechanism mismatch in the client speaks first versionAndrew Bartlett1-7/+98
of the SPNEGO state-machine. (Such as on LDAP and HTTP) Andrew Bartlett (This used to be commit c1cae6b3b1efe109a09e449ed2e09983431eac7e)
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-10r4885: added a new NBT client library. Features include:Andrew Tridgell5-1/+1036
- structures defined using IDL in nbt.idl - build around our events structure, and talloc - fully async - supports all NBT packet fields as per rfc1002 - easy interfaces for name query and status For the moment there are just a couple of test functions in namequery.c, test_name_query() and test_name_status(). These will be removed when we hook the new library into libcli/ fully The new library will also be a fairly good basis for a nbt server. Although it can't be a server as-is, I wrote it with the needs of a server in mind (for example, extremely scalable idtree based packet handling) (This used to be commit ae7e625bfa4b4a3ee32c64566064b6a4c84ee4b9)
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-10r4795: stronget type checking in composite connect functionAndrew Tridgell1-2/+4
(This used to be commit e16f67c931ba93011d52fdf14312d12a9b09c49a)
2007-10-10r4791: used the new talloc type safety macros to make the "void *private"Andrew Tridgell5-25/+25
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-10r4783: got rid of another void* in the composite code. This brings us down toAndrew Tridgell5-114/+88
the minimal level I think (one private pointer for the composite function, and one private pointer for the caller) (This used to be commit 0240bf928163e32e7c69be88fe3ed4987dd18778)
2007-10-10r4782: volker quite rightly pointed out that there is too much of aAndrew Tridgell5-130/+131
proliferation of void* in the composite code. This removes two of the void* pointers from the main composite structure. (This used to be commit 5a89a5ed0fa022fb380bf72065904633270f34aa)
2007-10-10r4778: I forgot to set the session key for the spnego path. Fixed.Andrew Tridgell1-0/+1
(This used to be commit 870af4e2f2055013424d9dbe2df2c51faa810eec)
2007-10-10r4777: added a smb_composite_sesssetup() async composite function. ThisAndrew Tridgell9-576/+473
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 Tridgell5-4/+476
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 Tridgell5-45/+105
- 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 Tridgell5-91/+221
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-10r4755: the recent change in the definition of lp_passwordserver() breaks thisAndrew Tridgell2-204/+0
old code, so I'm just removing it, as it needs replacing anyway (This used to be commit cae7748d675e35bfb89b81349624258bc76fac1a)
2007-10-10r4754: tidied up the composite function infrastructure to make it easier toAndrew Tridgell4-44/+67
have composite functions that are not made up of functions that operate on smbcli_request structures. (This used to be commit 4f6055b4fb7e287a29544ff1ca4e22f698efc478)
2007-10-10r4726: - use the name tcon and tid instead of conn and cnumStefan Metzmacher3-5/+5
- make use of talloc destructors metze (This used to be commit 8308da6ce4a95f8c10e22949ef00e9e64f2dbb85)