1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-06 08:23:50 +03:00
Commit Graph

66 Commits

Author SHA1 Message Date
Andrew Tridgell
f6818daecc r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(

I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes

In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.

Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
2007-10-10 13:39:41 -05:00
Andrew Tridgell
09948a5933 r10213: fixed a memory leak in the ldap client and server code spotted by Karl
Melcher. ldap_encode() now takes a memory context to use for the data
blob
2007-10-10 13:38:09 -05:00
Simo Sorce
d844d45d87 r8917: Better support for extended ldap search operations
Try to follow the RFC where possible and adapt to
  openLdap and AD way of handling this structure
2007-10-10 13:30:57 -05:00
Simo Sorce
a9e8cd0bad r8585: add to ldb and ldap comparison functionality
better pares filters
Approx is currently only a stub need to dig more info to
understand what it really means and how it works exactly
2007-10-10 13:29:41 -05:00
Simo Sorce
a910671bd8 r8530: Now our ldap server is able to fullfill present and substring searches 2007-10-10 13:29:35 -05:00
Tim Potter
bcfb3a45e4 r8414: Some C++ friendlyness fixes - 'not' is apparently a keyword in C++. 2007-10-10 13:23:00 -05:00
Andrew Tridgell
f22c3b84c8 r7749: some bug fixes from testing with socket:testnonblock
- fixed some infinite loops in asn1.c

- ensure asn1 callers know if an error is end of buffer or bad data

- handle npending 0 in ldap server
2007-10-10 13:18:30 -05:00
Andrew Tridgell
82b1feeafe r7724: added encoding of LDB_OP_NOT search components 2007-10-10 13:18:26 -05:00
Andrew Tridgell
25d500b6e5 r7723: - fix a mismatched asn1 push/pop on bind
- add error checking to ldap_encode()

- fixed the asn1 codes for extended search

- use asn1 context macros
2007-10-10 13:18:26 -05:00
Andrew Tridgell
09060994c1 r7720: - simplify the asn1 decode of ldap_search() a lot, taking advantage of
the fact that the ldap data structures now use ldb_message_element.

- fixed null termination of elements in ildap
2007-10-10 13:18:26 -05:00
Andrew Tridgell
2e3c660b2f r7626: a new ldap client library. Main features are:
- hooked into events system, so requests can be truly async and won't
   interfere with other processing happening at the same time

 - uses NTSTATUS codes for errors (previously errors were mostly
   ignored). In a similar fashion to the DOS error handling, I have
   reserved a range of the NTSTATUS code 32 bit space for LDAP error
   codes, so a function can return a LDAP error code in a NTSTATUS

 - much cleaner packet handling
2007-10-10 13:18:14 -05:00
Andrew Tridgell
bcd4671aca r7598: take advantage of struct data_blob and struct ldb_val being the same
structure in a couple of places
2007-10-10 13:18:13 -05:00
Andrew Tridgell
87fc307339 r7596: next step in ldap cleanup. I'm aiming to get rid of the cut&pasted
ldif parsing code in libcli/ldap/ldap_ldif.c, and instead use the ldb
ldif code. To do that I have changed the ldap code to use 'struct
ldb_message_element' instead of 'struct ldap_attribute'. They are
essentially the same structure anyway, so by making them really the
same it will be much easier to use the ldb code in libcli/ldap/

I have also made 'struct ldb_val' the same as a DATA_BLOB, which will
simplify data handling in quite a few places (I haven't yet removed
all the code that maps between these two, that will come later)
2007-10-10 13:18:12 -05:00
Andrew Tridgell
912d0427f5 r7593: simplified the memory management in the ldap code. Having a mem_ctx
element in a structure is not necessary any more.
2007-10-10 13:18:12 -05:00
Andrew Tridgell
041bce5913 r7567: added wire parsing of NOT and extended ldap search requests. This
allows us to parse and handle the complex queries we are getting from
w2k, such as

(|(|(&(!(groupType:1.2.840.113556.1.4.803=1))(groupType:1.2.840.113556.1.4.803=2147483648)(groupType:1.2.840.113556.1.4.804=6))(samAccountType=805306368))(samAccountType=805306369))
2007-10-10 13:18:10 -05:00
Andrew Tridgell
96620ab2ee r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_tree
instead of a search expression. This allows our ldap server to pass
  its ASN.1 parsed search expressions straight to ldb, instead of going
  via strings.

- updated all the ldb modules code to handle the new interface

- got rid of the separate ldb_parse.h now that the ldb_parse
  structures are exposed externally

- moved to C99 structure initialisation in ldb

- switched ldap server to using ldb_search_bytree()
2007-10-10 13:18:06 -05:00
Andrew Tridgell
235cf625e2 r7524: make the ldap ASN.1 filter parse code go via a struct
ldb_parse_tree. This also fixes the error handling.

next step will be to pass the parse tree straight into ldb, avoiding
the string encoding completely.
2007-10-10 13:18:06 -05:00
Andrew Tridgell
0e9f18c448 r7519: rip the copy of the ldap expression parser out of libcli/ldap/ and use
the original one in lib/ldb/ instead. Having two copies of this code
is silly.
2007-10-10 13:18:04 -05:00
Andrew Tridgell
eb7979d9de r6817: - fixed empty ldap search elements in filters
- added support for guids in cldap netlogon searches.

the cldap server now passes the LDAP-CLDAP torture test
2007-10-10 13:16:47 -05:00
Andrew Tridgell
8890dd3ac3 r6763: added functions in libcli/ldap/ to binary encode some NDR structures into
ldap friendly filter strings
2007-10-10 13:16:42 -05:00
Andrew Tridgell
b644ff6fe1 r6745: - escape spaces in binary ldap blobs
- expose the ldap filter string parsing outside of ldap.c
2007-10-10 13:16:40 -05:00
Andrew Tridgell
2b36f1dfdd r6726: support binary search elements in ldap_decode() 2007-10-10 13:16:38 -05:00
Andrew Tridgell
d5353b6342 r6689: minor ldap client library work
- added support for binary encoded search filters
 - fixed some const handling
 - changed the message type to an enum, to help debugging
2007-10-10 13:16:34 -05:00
Andrew Tridgell
80ffcc650c r5322: removed a whole bunch of #include lines that minimal_includes.pl
thinks are not needed. Now to see how this fares on the build farm :)
2007-10-10 13:09:41 -05:00
Andrew Tridgell
0df3fdd817 r5305: removed libcli/ldap/ldap.h from includes.h 2007-10-10 13:09:39 -05:00
Andrew Tridgell
9db6c79e90 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
2007-10-10 13:09:38 -05:00
Stefan Metzmacher
add1c57937 r5137: fix types
metze
2007-10-10 13:09:26 -05:00
Andrew Tridgell
ec32b22ed5 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
89b74b5354 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
eec698254f r4055: fixed more places to use type safe allocation macros 2007-10-10 13:06:20 -05:00
Stefan Metzmacher
9701abfa3a r3585: check sscanf return code
metze
2007-10-10 13:05:35 -05:00
Stefan Metzmacher
4868f1ea85 r3584: fix referral handling
metze
2007-10-10 13:05:35 -05:00
Stefan Metzmacher
1e9c0b68ca r3583: - seperate the ldap client code and the ldap parsing code
(vl: we should only sync the parsing code with trunk)

- use hierachical talloc in the ldap client code

metze
2007-10-10 13:05:35 -05:00
Andrew Tridgell
a7e5bde6be r3475: don't pass a ptr to an enum as a ptr to an int (bug found by tcc) 2007-10-10 13:05:18 -05:00
Andrew Tridgell
b97e395c81 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h) 2007-10-10 13:05:17 -05:00
Andrew Tridgell
7b7477ac42 r3453: - split out the auth and popt includes
- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
2007-10-10 13:05:13 -05:00
Andrew Tridgell
6b1f86aea8 r3449: more include file reduction
the ldb part isn't ideal, I will have to think of a better solution
2007-10-10 13:05:13 -05:00
Andrew Tridgell
2e25c71853 r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.

Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/

This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
2007-10-10 13:05:11 -05:00
Andrew Bartlett
9c911b361c r3079: make code more pretty :-)
Andrew Bartlett
2007-10-10 13:01:56 -05:00
Stefan Metzmacher
e23dcb1887 r2884: parse LDAP Control messages
metze
2007-10-10 12:59:42 -05:00
Stefan Metzmacher
cc77baf729 r2861: encode and decode BindRequest/Response correct
and some minor changes
- make ldap_encode/decode_response maore usable

metze
2007-10-10 12:59:40 -05:00
Stefan Metzmacher
1dabd04e26 r2853: add torture test to find the defaultNamingContext on the RootDSE
try a sasl sealed CompareRequest

abartlet: we need to check how SINGING only can work,
          it failed for me:-(

metze
2007-10-10 12:59:38 -05:00
Stefan Metzmacher
778cf6d92b r2851: don't destroy the gensec context it's used for sign and seal
check the result of ldap_receive()

metze
2007-10-10 12:59:38 -05:00
Stefan Metzmacher
4233067921 r2750: decode AbandonRequest correct (untested:-)
metze
2007-10-10 12:59:30 -05:00
Stefan Metzmacher
72dfea2b07 r2747: use DATA_BLOB for attribute values
en/decode CompareRequest/Response correct

metze
2007-10-10 12:59:29 -05:00
Simo Sorce
ddd74dae8e r2695: revert "Del" renaming 2007-10-10 12:59:24 -05:00
Simo Sorce
5ed9a6eb18 r2689: Use consistent naming Del -> Delete
Add delete functionality to ldb simple lda server backend
add some const in ldap.h
2007-10-10 12:59:22 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
f12ee2f241 r2629: convert gensec to the new talloc model
by making our gensec structures a talloc child of the open connection
we can be sure that it will be destroyed when the connection is
dropped.
2007-10-10 12:59:14 -05:00
Stefan Metzmacher
e942f414c5 r2508: - implemented ldap_decode() for UnbindRequest and ExtendedRequest
- fail when we got a wrong tag in ldap_decode()

metze
2007-10-10 12:59:00 -05:00