1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-21 18:04:06 +03:00

86 Commits

Author SHA1 Message Date
Andrew Tridgell
9a52d1a467 r11592: fixed a crash bug from the ldb_result changes (res was being used after being freed)
(This used to be commit 5c7f3fef3e2324f0d1edda0f0f06f662bbcf7e08)
2007-10-10 13:45:55 -05:00
Simo Sorce
5c95905871 r11567: Ldb API change patch.
This patch changes the way lsb_search is called and the meaning of the returned integer.
The last argument of ldb_search is changed from struct ldb_message to struct ldb_result
which contains a pointer to a struct ldb_message list and a count of the number of messages.
The return is not the count of messages anymore but instead it is an ldb error value.

I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good
amount of places. I also tried to double check all my changes being sure that the calling
functions would still behave as before. But this patch is big enough that I fear some bug
may have been introduced anyway even if it passes the test suite. So if you are currently
working on any file being touched please give it a deep look and blame me for any error.

Simo.
(This used to be commit 22c8c97e6fb466b41859e090e959d7f1134be780)
2007-10-10 13:45:53 -05:00
Andrew Bartlett
256a872763 r11356: More cracknames work. This copes with a lookup for a
servicePrincipalName with a realm, which always returns 'domain only',
with the realm as the domain.

Andrew Bartlett
(This used to be commit 476cd0c649d69f682dee27c1ae2a73b870b300d0)
2007-10-10 13:45:23 -05:00
Andrew Bartlett
489ad64cad r11339: Fix the build by adding the serviceprincial name cracknames helper.
Andrew Bartlett
(This used to be commit 0a5bf9348ae179698daa291b94546c893e258097)
2007-10-10 13:45:21 -05:00
Andrew Bartlett
db4b95827e r11270: Move the core CrackNames code from rpc_server/drsuapi to dsdb/samdb.
I'm sure this will not be the final resting place, but it will do for
now.

Use the cracknames code in auth/ for creating a server_info given a
principal name only (should avoid assumtions about spliting a
user@realm principal).

Andrew Bartlett
(This used to be commit c9d5d8e45dd7b7c99b6cf35b087bc18012f31222)
2007-10-10 13:45:11 -05:00
Andrew Tridgell
33da2fabe6 r10914: moved the ldap time string functions into ldb so they can be used by
the time attribute handling functions
(This used to be commit 93c296d52718e77f8b702e1721b548eaadc56c76)
2007-10-10 13:39:42 -05:00
Andrew Tridgell
a599edf04c 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.
(This used to be commit f6818daecca95760c12f79fd307770cbe3346f57)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
860ffba4e1 r10897: added in a hackish ldb proxy module that I am using to experiment with
mmc management support
(This used to be commit 99a5b088810e8e2f4e28b99a4a0e5e7dc9301594)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
36d73b0e71 r10894: make the handling of dn/distinguishedName much closer to real
ldap. Also ensure we put a objectclass on our private ldb's, so they
have some chance of being stored in ldap if you want to
(This used to be commit 1af2cc067f70f6654d08387fc28def67229bb06a)
2007-10-10 13:39:40 -05:00
Andrew Bartlett
1377cca5f4 r10810: This adds the hooks required to communicate the current user from the
authenticated session down into LDB.  This associates a session info
structure with the open LDB, allowing a future ldb_ntacl module to
allow/deny operations on that basis.

Along the way, I cleaned up a few things, and added new helper functions
to assist.  In particular the LSA pipe uses simpler queries for some of
the setup.

In ldap_server, I have removed the 'ldasrv:hacked' module, which hasn't
been worked on (other than making it continue to compile) since January,
and I think the features of this module are being put into ldb anyway.

I have also changed the partitions in ldap_server to be initialised
after the connection, with the private pointer used to associate the ldb
with the incoming session.

Andrew Bartlett
(This used to be commit fd7203789a2c0929eecea8125b57b833a67fed71)
2007-10-10 13:39:32 -05:00
Andrew Bartlett
5e0fd505ab r10791: Add copyright, fix comments (this isn't the timestamps module any more)
Andrew Bartlett
(This used to be commit efdc6d834aecbf978f538365c72149fa7afe0828)
2007-10-10 13:39:29 -05:00
Andrew Tridgell
78d0e79c9f r10759: make modules easier to write by allowing modules to only implement the
functions they care about, instead of all functions. This also makes
it more likely that future changes to ldb will not break existing
modules
(This used to be commit 45f0c967b58e7c1b2e900a4d74cfde2a2c527dfa)
2007-10-10 13:39:27 -05:00
Andrew Tridgell
5fd031c97d r10753: don't require every ldb module to implement both a search_bytree() and
a search() function, instead each module now only implements the
bytree method, and the expression based search is handled generically
by the modules code. This makes for more consistency and less code
duplication.

fixed the tdb backend to handle BASE searches much more
efficiently. They now always only lookup one record, regardless of the
search expression
(This used to be commit 7e44f9153c5578624e2fca04cdc0a00af0fd9eb4)
2007-10-10 13:39:26 -05:00
Simo Sorce
63b43dd12f r10477: expose transactions outside ldb and change the API once more
do not autostart transactions on ldb operations if a transaction is already in place
test transactions on winsdb

all my tests passes so far
tridge please confirm this is ok for you
(This used to be commit c2bb2a36bdbe0ec7519697a9a9ba7526a0defac2)
2007-10-10 13:38:52 -05:00
Andrew Tridgell
37cefc8b41 r10411: we don't need the 10 times retry on rid allocation now, as
transactions ensure two account creations can't interfere with each
other
(This used to be commit 91c27bc97662c8d8b764c76bd2d98a1b04f47337)
2007-10-10 13:38:42 -05:00
Simo Sorce
3d7935e656 r10306: change these modules to use new error API
(This used to be commit e86c9b4a7f399a3152a2703c76406e9d69ec1225)
2007-10-10 13:38:16 -05:00
Simo Sorce
4f85004da5 r10300: forgot to change the dsdb modules function names
(This used to be commit e9018e3d9f69528acc0c440929fdb8d95413fa0d)
2007-10-10 13:38:15 -05:00
Tim Potter
3caab0a64d r9992: More fixes from the 64-bit warning police.
(This used to be commit cda829f0d9476bd8b057a7019f55fac206205825)
2007-10-10 13:36:27 -05:00
Andrew Bartlett
9b905c9f27 r9930: Use a single samdb_base_dn() function rather than lots of silly
searches all over the place.

This can be extended to cover an NT4 (no ADS) mode in future as well.

Andrew Bartlett
(This used to be commit 0761b22f99a128bd9634a191adc88b0e30982a3a)
2007-10-10 13:36:23 -05:00
Jelmer Vernooij
08f630be82 r9915: Some more mappings. Fix weird sAMAccountName values.
(This used to be commit 8ff1358f401e0086b941f4ff73af5d4c38a1f8bf)
2007-10-10 13:36:21 -05:00
Jelmer Vernooij
ca6c0af86f r9908: Generate posixUser and posixGroup as well
(This used to be commit ebed25b47d3d8bd350b51b462d605d713f17602d)
2007-10-10 13:36:21 -05:00
Jelmer Vernooij
e2e2508b58 r9899: Be more conservative about what is sent to the remote server in ldb_map.
(This used to be commit 76e943d4416e38ce4cce27d5403bc3e133d0025b)
2007-10-10 13:36:21 -05:00
Tim Potter
23f68eda42 r9883: More nested initialiser fixes.
(This used to be commit 579d11147849932ec76a175f815de890a8ea20ad)
2007-10-10 13:36:20 -05:00
Jelmer Vernooij
b19cc95a88 r9849: Extend testsuite a bit more.
(This used to be commit 5cbe1e6b70b03be441a36b36fb969339df0dfd45)
2007-10-10 13:36:17 -05:00
Jelmer Vernooij
222fdd5237 r9842: More error checks in the ldb_map modules, extend testsuite
(This used to be commit b7992de4b7d42a55e00509c887a269a07c19627d)
2007-10-10 13:36:17 -05:00
Jelmer Vernooij
84bfcd3c78 r9835: Make ldb_map compile in the stand-alone LDB build
(This used to be commit 2283a336e0e31e6857621d9806bba54c400bd986)
2007-10-10 13:36:17 -05:00
Jelmer Vernooij
6cf1b0c07c r9793: Be more verbose, check for errors in upgrade script.
(This used to be commit b7c09df9e506f8048f69c4bdd1c3351e3b554e18)
2007-10-10 13:35:02 -05:00
Jelmer Vernooij
f9447d2a17 r9786: Move ldb_map into ldb/modules/
Move samba3sam to dsdb/
(This used to be commit eb9d615bcd49328131613f64745760a90553b7f2)
2007-10-10 13:35:01 -05:00
Jelmer Vernooij
584f3aeb7e r9768: Arrrgh.. Right this time.
(This used to be commit 8bded3fc926b8eb6285e06fd4b4706b779edb386)
2007-10-10 13:34:58 -05:00
Jelmer Vernooij
2f6fd1d45c r9767: Fix typo
(This used to be commit 0602e8b3e7b5921fa99bfe788fe290f03b3dc7ac)
2007-10-10 13:34:58 -05:00
Simo Sorce
61aaf82b62 r9654: introduce the samdb_search_dn call
(This used to be commit 333ebb40d55c60465564b894d5028b364e99ee00)
2007-10-10 13:34:38 -05:00
Simo Sorce
3e4c4cff21 r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names
Provide more functions to handle DNs in this form
(This used to be commit 692e35b7797e39533dd2a1c4b63d9da30f1eb5ba)
2007-10-10 13:33:32 -05:00
Simo Sorce
b59bbe3fec r9385: Remove unused functions
(This used to be commit fac8ff623778250acd830f358fcd34b85f7983b6)
2007-10-10 13:33:31 -05:00
Stefan Metzmacher
3be75a4c6d r9240: - move struct security_token to the idl file, with this we can
the ndr_pull/push/print functions for it in the ntacl-lsm module

- fix compiler warnings in the ldap_encode_ndr_* code

metze
(This used to be commit 83d65d0d7ed9c240ad44aa2c881c1f07212bfda4)
2007-10-10 13:31:37 -05:00
Stefan Metzmacher
ede70c80e8 r9208: fix a crash bug
metze
(This used to be commit f8a25ac2397d50359f4903618832da7886d91d6f)
2007-10-10 13:31:31 -05:00
Jelmer Vernooij
6553dd0c60 r8811: Fix the build..
(This used to be commit fac77f5fa267da57a55e88cad8993897e80741a0)
2007-10-10 13:30:07 -05:00
Rafal Szczesniak
ebb76f84ad r8810: Fix missing headers. Still doesn't fix the build but getting closer there.
rafal
(This used to be commit bc638cc3d66525cf91ef76eb0c486542fff2b929)
2007-10-10 13:30:07 -05:00
Andrew Bartlett
0b7a387831 r8791: (missing from previous commit)
Add templating support for foreignSecurityPrincipal to the samdb
module.

Andrew Bartltt
(This used to be commit 5f51d806d718bfa6931d102ff4e866c688a6ecd9)
2007-10-10 13:30:06 -05:00
Andrew Bartlett
a7f9d9c5b8 r8740: Extend the rdn_name module to handle adding the rdn as an attribute. ie:
dn: cn=foo,ou=bar
objectClass: person

implies

dn: cn=foo,ou=bar
objectClass: person
cn: foo
(as well as a pile more default attributes)

We also correct the case in the attirbute to match that in the DN
(win2k3 behaviour) and I have a testsuite (in ejs) to prove it.

This module also found a bug in our provision.ldif, so and reduces
code complexity in the samdb module.

Andrew Bartlett
(This used to be commit 0cc58f5c3cce12341ad0f7a90cdd85a3fab786b3)
2007-10-10 13:30:00 -05:00
Andrew Tridgell
f1418f62ee r8715: - revert the %PRIi64 stuff. Tim, we explicitly check for %llu support
in configure, and replace snprintf if the system doesn't support
  it. Our replacement code does not handle the "%PRIi64" stuff, so
  using it would break us on lots of platforms

- fixed constant array initialisers to work on HPUX.
(This used to be commit c6bae3e87e2dcb3a89bbb32da131627c60871e3d)
2007-10-10 13:29:58 -05:00
Tim Potter
ab4f3a663b r8714: Oops - get it right this time!
(This used to be commit 1d2b708da657a3f3c81bb60600f66bc359c2eab7)
2007-10-10 13:29:58 -05:00
Tim Potter
a33c02612a r8713: Experiment to try and fix warnings on 64-bit machines without breaking
32-bit ones.  Yes, this weird looking macros are part of C99.
(This used to be commit 7b316f119b8486b75ebe63b185c50fab82313e58)
2007-10-10 13:29:57 -05:00
Andrew Bartlett
d3a2b03f76 r8674: With the rdn_name module, we don't need this duplication in the samdb
module any more.

Andrew Bartlett
(This used to be commit da48e77e7ca21bc99f2829a22ea3dc96ba413191)
2007-10-10 13:29:53 -05:00
Andrew Bartlett
4396d0d148 r8669: The objectguid module belongs in Samba's ldb module collection, not in
ldb, as it can't build without the NDR and GUID code.

Also make it properly use the NDR encoding for the GUID (I forgot last
time, and used a string), as well as set the dependencies on the
module correctly.

Andrew Bartlett
(This used to be commit 8054abc76e5e3588cebc7fc01062a1223b7f140b)
2007-10-10 13:29:52 -05:00
Andrew Bartlett
c7204bd985 r8666: The same fix as the last commit, I was caught out on a move from a
BOOL to int function return.

Andrew Bartlett
(This used to be commit e03e00fe606db443783f1dea03411025c01c7de5)
2007-10-10 13:29:51 -05:00
Andrew Bartlett
c2f9eb30cd r8664: I got caught out not testing...
I replaced these function calls, and they went from BOOL to int return
values, so naturally failed.

Andrew Bartlett
(This used to be commit 1982fdb6f3355494ecaae93280eea4e69c78430f)
2007-10-10 13:29:51 -05:00
Andrew Bartlett
8191f2cc80 r8663: Since simo constructed the samdb module, he and tridge have worked on
a DN parsing system.  Leverage that in the dsdb module.

Andrew Bartlett
(This used to be commit 2408f322765fc1b1769d5c8ea69eae4d968cd195)
2007-10-10 13:29:51 -05:00
Andrew Bartlett
6173fad231 r8660: Use templates for the initial provision of user and computer accounts.
This ensures the templating code is used, and also makes it clearer
what I need to duplicate in the vampire area.

Also fix a silly bug in the template application code (the samdb
module) that caused templates to be compleatly unused (my fault, from
my commit last night).

Andrew Bartlett
(This used to be commit 4a8ef7197ff938942832034453f843cb8a50f2d1)
2007-10-10 13:29:51 -05:00
Andrew Bartlett
24d2107324 r8650: Use the timestamps and a new objectguid module rather than placing
boilerplate attributes in every entry in provision.ldif.

The next step will be to use templates.

Andrew Bartlett
(This used to be commit 940ed9827f5ab83b668a60a2b0110567dd54c3e2)
2007-10-10 13:29:50 -05:00
Andrew Tridgell
139e43bf9c r8568: change missing templates to warnings, so that provisioning with an existing db
doesn't print lots of fatal errors
(This used to be commit d8d47bb18fbb467e253e99c4281578d6e4762de3)
2007-10-10 13:29:39 -05:00