1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-30 13:18:05 +03:00
Commit Graph

3823 Commits

Author SHA1 Message Date
Andrew Tridgell
f8a950b57d r4952: removed a bogus talloc_steal() that was trying to cope with the
inverted memory hierarchy. Now the memory hierarchy is logical its not
needed (and can cause a double free in RPC-SCHANNEL)
2007-10-10 13:09:09 -05:00
Andrew Tridgell
5e8fd5f701 r4951: some of the code dealing with libcli was getting too complex trying to
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.
2007-10-10 13:09:09 -05:00
Andrew Tridgell
4a351901aa r4950: removed some excessive debugging messages 2007-10-10 13:09:09 -05:00
Volker Lendecke
fa435bf7c8 r4949: First version of a fetchfile composite function which connects to a server and
loads a file. Needs a smb url parsing wrapper.

Volker
2007-10-10 13:09:08 -05:00
Rafal Szczesniak
97d40f1603 r4948: Typo fixes in comments.
rafal
2007-10-10 13:09:08 -05:00
Andrew Tridgell
8c89551554 r4945: the te element isn't needed any more
In general, now that events are children of the structure they are
handling events for, the caller only needs to keep the event handle
around if it plans on changing the event flags later
2007-10-10 13:09:08 -05:00
Andrew Tridgell
7f981b9ed9 r4944: every event_add_*() caller was having to call talloc_steal() to take
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.
2007-10-10 13:09:08 -05:00
Andrew Tridgell
a3c7417cfe r4943: Smplified the events handling code a lot. The first source of
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.
2007-10-10 13:09:08 -05:00
Andrew Tridgell
133e67bb1f r4942: converted the cifs backend to not use event_context_merge(). Instead,
is supplies the server event context during the connect.
2007-10-10 13:09:08 -05:00
Stefan Metzmacher
c583f80623 r4941: - all needed data is now in sam.ldb and hacked.ldb is not needed anymore by the hacked ldap backend
- readd the schema naming context container object as it's needed for a w2k3 dc join

metze
2007-10-10 13:09:08 -05:00
Tim Potter
d4f7f6b0b4 r4940: Add a variable to hold a list of typedefs for which we shouldn't generate
a dissector for.  A hand written dissector needs to be added to eparser.c
for the plugin to link.
2007-10-10 13:09:07 -05:00
Andrew Tridgell
fb326cbb32 r4939: make a few more private pointers type safe (this might help abartlet
track down a bug he just told me about)
2007-10-10 13:09:07 -05:00
Andrew Tridgell
442308970c r4938: allow the caller to supply an existing event_context if they want to
in smb_composite_connect_send(). This makes doing parallel calls much
easier.
2007-10-10 13:09:07 -05:00
Andrew Tridgell
347dfa4724 r4937: simplify the connect code in the same way 2007-10-10 13:09:07 -05:00
Andrew Tridgell
420b53091e r4936: moved to a convention where the completion function is only called in
one place. This makes the code more robust, and simpler (it would have
prevented the error that volker found).
2007-10-10 13:09:07 -05:00
Andrew Tridgell
c4faceadc7 r4935: fixed a bug where "c->status = xxx_handler(x);" could write to c after
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.
2007-10-10 13:09:07 -05:00
Tim Potter
362151788b r4930: Update my copyright. 2007-10-10 13:09:06 -05:00
Andrew Tridgell
b06b8dd2f4 r4927: parse the NBT session request in the smb server. This gets rid of that
annoying "not parsing session request" message on each SMB connection
2007-10-10 13:09:06 -05:00
Andrew Tridgell
39da684ea8 r4924: continue the effort to simplify and generalise the composite
interface. This patch removes the "stage" variable, which is really
better suited to the backend state structures
2007-10-10 13:09:06 -05:00
Andrew Bartlett
ff8298bb90 r4923: Avoid using krb5-config in the path if a krb5 prefix was already set.
Andrew Bartlett
2007-10-10 13:09:06 -05:00
Andrew Tridgell
dd5b43ed37 r4922: fixed an infinite loop in the name resolve code when handling a method
in smb.conf that isn't implemented in the library
2007-10-10 13:09:06 -05:00
Andrew Tridgell
3268d523cc r4919: if a caller doesn't provide an event context to the resolver library,
then create one. This fixes a crash in the RAW-NEGNOWAIT test for
'host' resolution.
2007-10-10 13:09:06 -05:00
Andrew Tridgell
3d40b47990 r4916: added "host" name resolution using fork() per gethostbyname()
comments welcome, but please think about the alternatives first :-)
2007-10-10 13:09:05 -05:00
Andrew Tridgell
b20c0561b8 r4915: free temp context _before_ the async callback, as the async callback might destroy our top level context
leaving the tmp context freed (so a double free)
2007-10-10 13:09:05 -05:00
Andrew Bartlett
bc901ecfb4 r4914: Fill in the realm for the self-join.
Andrew Bartlett
2007-10-10 13:09:05 -05:00
Andrew Tridgell
8b653f12f2 r4911: make sure we fill in the transport called name on port 445 as well
(thanks to abartlet for spotting this bug)
2007-10-10 13:09:05 -05:00
Andrew Tridgell
9d2d16ce5f r4909: fixed name_trn_id generation (thanks to metze for spotting the bug!) 2007-10-10 13:09:05 -05:00
Andrew Tridgell
9a34af2938 r4901: a bit more info on nbt packets under high debug level 2007-10-10 13:09:05 -05:00
Andrew Tridgell
f6ff9e6f39 r4900: build fix for IRIX 6.5 2007-10-10 13:09:05 -05:00
Andrew Tridgell
852f1e73b4 r4899: fixed build 2007-10-10 13:09:04 -05:00
Andrew Tridgell
266fd2751c r4898: - removed the unused wins_srv_*() code
- 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
2007-10-10 13:09:04 -05:00
Andrew Bartlett
eb46adade4 r4897: Unbreak the LDAP server. Somehow the generic service structures
(which seem just a little too complex) changed, but this code was not
updated or tested.

Also clarify the existing code, by not reusing variables.

Andrew Bartlett
2007-10-10 13:09:04 -05:00
Andrew Tridgell
c1063919c0 r4896: make sure the event context doesn't go away while waiting for event completion 2007-10-10 13:09:04 -05:00
Andrew Bartlett
53b98c674b r4895: I missed this in my previous 'use secrets.ldb' commit.
Andrew Bartlett
2007-10-10 13:09:04 -05:00
Andrew Tridgell
24927e69d8 r4894: namecache.c is not used any more either 2007-10-10 13:09:04 -05:00
Andrew Bartlett
21bfda2a0d r4893: Move to using secrets.ldb for the Kerberos verify, instead of
secrets.tdb from Samba3.

Andrew Bartlett
2007-10-10 13:09:04 -05:00
Andrew Tridgell
1c83c80ef2 r4892: we don't need nameserv.h any more 2007-10-10 13:09:03 -05:00
Andrew Tridgell
239c310f25 r4891: - added a generic resolve_name() async interface in libcli/resolve/,
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!)
2007-10-10 13:09:03 -05:00
Andrew Bartlett
c1cae6b3b1 r4890: Try to cope with mechanism mismatch in the client speaks first version
of the SPNEGO state-machine.  (Such as on LDAP and HTTP)

Andrew Bartlett
2007-10-10 13:09:03 -05:00
Andrew Tridgell
c5c65ad8fb r4889: make sure ndr print flags are initialised in ndrdump 2007-10-10 13:09:03 -05:00
Andrew Tridgell
d93b6a5b8e r4888: use the neater calling convention 2007-10-10 13:09:03 -05:00
Andrew Tridgell
a034556faa r4887: removed a bogus cast 2007-10-10 13:09:03 -05:00
Andrew Tridgell
bf74ea34fc r4886: fixed two places where we process the send side of a socket after the
recv side in the same event. That's a bad idea, as the first callback
could decide to destroy the socket.
2007-10-10 13:09:02 -05:00
Andrew Tridgell
ae7e625bfa r4885: added a new NBT client library. Features include:
- 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)
2007-10-10 13:09:01 -05:00
Andrew Tridgell
f65f239978 r4884: - 2nd part of support ndr_size_ generation on unions as well as structures
- added "nopull" and "nopush" flags, to allow for externally written parsers for sub-structures
2007-10-10 13:09:01 -05:00
Andrew Tridgell
852ad354b4 r4883: support ndr_size_ generation on unions as well as structures 2007-10-10 13:09:01 -05:00
Tim Potter
be2bb36856 r4865: Fix up subtree name when dissecting unions. E.g in LSA, The subtree
used to be called something like "Level, R->out.info" but now is called
"Lsa PolicyInformation".
2007-10-10 13:09:01 -05:00
Andrew Tridgell
e7262dccce r4863: schema_find_attribute() should be static 2007-10-10 13:09:01 -05:00
Simo Sorce
0315159daf r4862: - better structure schema tests
- fix check for deletion of required attributes on modify
  removed by mistake with the previous commits
2007-10-10 13:09:00 -05:00
Simo Sorce
c6257379e0 r4859: changed a numbe rof things:
- Try to no tcopy memory if not necessary
- let the searches hang around until we finish the operation
- greatly simplify the modify operation

still todo:

- check attributes syntax
- check objectclasses type, we cannot allow to add a new structural
  objectclass to an exixting entry unless the existing one is a parent
- more tests
2007-10-10 13:09:00 -05:00