1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

50 Commits

Author SHA1 Message Date
Matthias Dieter Wallnöfer
8d80225afb ldb:tools - return LDB_ERR_OPERATIONS_ERROR on generic errors
Use "return" when located in "main" for consistency ("exit" would do the
same).

The patchset has been discussed with Jelmer Vernooij and afterwards LDB
maintainer Simo Sorce.
2011-02-09 18:59:19 +01:00
Matthias Dieter Wallnöfer
5e06b21cc1 ldb:tools - always check if ldb connection has been estabilished
Otherwise return "LDB_ERR_OPERATIONS_ERROR".
2011-02-09 18:59:19 +01:00
Matthias Dieter Wallnöfer
2937e63644 ldb:ldbadd tool - use LDB return codes where possible 2011-02-09 18:59:19 +01:00
Matthias Dieter Wallnöfer
de9217beaa ldb:ldbadd tool - use "%u" for printing out unsigned integers 2011-02-09 18:59:19 +01:00
Matthias Dieter Wallnöfer
c3ca0b05e5 ldb:ldbadd tool - use LDB result constants for consistency 2011-02-09 18:59:18 +01:00
Andrew Tridgell
6f2c4abadd s4-ldb: convert existing ldb tools to use new command line hooks
the usage() function needs to take a ldb context, as the popt_options
is specific to the ldb context

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-11-01 18:55:20 +11:00
Kamen Mazdrashki
35b1e00ba3 s4: Remove trailing whitespaces
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Kamen Mazdrashki
d71b20e8dc s4-dsdb: use ldb_msg_normalize() in ldbadd-process_file()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2010-07-19 17:33:35 +10:00
Andrew Tridgell
7cbcf652c5 s4-ldb: use a parent context in the ldb utils
This avoids a talloc free with references error on exit
2010-05-02 18:25:13 +02:00
Matthias Dieter Wallnöfer
e10fa46f3e LDB:tools - change counters to be unsigned
In most cases we do count LDB objects which are enumerated within the "unsigned"
type. Therefore no need to use "signed" counters.
2010-03-06 11:35:17 +01:00
Andrew Tridgell
36f8ece9de s4-ldb: show the error code as well as errstr
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-01-02 08:16:54 +11:00
Matthieu Patou
3bd4f6792c s4: make ldbadd/ldbmodify/ldbdelete really use the --controls switch 2009-12-23 08:09:19 -05:00
Andrew Tridgell
c99b310063 s4-ldb: when -v is specified, show progress of ldbadd/ldbmodify
This is useful for speed tests with large numbers of records.
2009-11-20 11:34:39 +11:00
Andrew Tridgell
c298e660bd ldb: ensure we cancel a ldb transaction
When we fail a ldbadd or ldbedit we should cancel the transaction to
prevent ldb giving a warning about having a open transaction in the
ldb destructor
2009-09-04 14:40:51 +10:00
Andrew Tridgell
bde679e6f8 show the full set of command line options for ldb tools
I always found it hard to remember some of the options. We might as
well use popt to give us the full list
2009-09-02 18:31:59 +10:00
Simo Sorce
380874ef86 Fix the mess with ldb includes.
Separate again the public from the private headers.

Add a new header specific for modules.
Also add service function for modules as now ldb_context and ldb_module are
opaque structures for them.
2009-01-30 01:02:03 -05:00
Andrew Bartlett
a9cf61dbdd Print error strings when transactions fail in ldb tools 2008-12-18 14:36:20 +11:00
Andrew Tridgell
f320e3a659 use transactions in ldbadd, ldbmodify and ldbedit
The command line tools ldbadd, ldbmodify and ldbedit should operate
within a transaction to make them more efficient. The ldbadd tool in
particular is much faster when adding a large number of records if all
the adds happen within a transaction. Previously there was a
transaction per record.
2008-12-16 14:39:42 +11:00
Simo Sorce
929adc9efa Make up the right dependencies now that ldb depends on libevents
(This used to be commit 3b8eec7ca334528cad3cdcd5e3fc5ee555d8d0e0)
2008-06-14 11:59:19 -04:00
Jelmer Vernooij
0020793515 Fix static module list generation for ldb.
(This used to be commit 92c1c0e9137f0845cac6cc96bf78711b6aaffe21)
2008-02-20 03:40:44 +01:00
Andrew Tridgell
6c973f4e8c r23798: updated old Temple Place FSF addresses to new URL
(This used to be commit 40c0919aaa9c1b14bbaebb95ecce53eb0380fdbb)
2007-10-10 14:59:15 -05:00
Andrew Tridgell
b8d69a7ea2 r23795: more v2->v3 conversion
(This used to be commit 84b468b2f8f2dffda89593f816e8bc6a8b6d42ac)
2007-10-10 14:59:14 -05:00
Jelmer Vernooij
e0e8fc3db4 r22682: Fix standalone ldb build when parent directory name != ldb.
(This used to be commit 532f28724dcc9e0fe7051e27d145469398041101)
2007-10-10 14:52:01 -05:00
Simo Sorce
a9e31b33b5 r19832: better prototypes for the linearization functions:
- ldb_dn_get_linearized
  returns a const string

- ldb_dn_alloc_linearized
  allocs astring with the linearized dn
(This used to be commit 3929c086d5d0b3f08b1c4f2f3f9602c3f4a9a4bd)
2007-10-10 14:28:22 -05:00
Andrew Tridgell
2ad8e1443d r19273: - fixed error handling with the ldap backend
- propogate errors to the ldbadd command line tool

- use the rdn_name module when testing the tdb backend to allow the
  same test code to correctly test the ldap and non-ldap backends
(This used to be commit dd82c474a123d90329bda653a4cb73c93e087b15)
2007-10-10 14:21:00 -05:00
Jelmer Vernooij
26af14c39b r13786: [merge] Add registration functions for LDB modules
Applications that use LDB modules will now have to run ldb_global_init()
before they can use LDB.

The next step will be adding support for loading LDB modules from .so
files. This will also allow us to use one LDB without difference between the
standalone and the Samba-specific build
(This used to be commit 52a235650514039bf8ffee99a784bbc1b6ae6b92)
2007-10-10 13:52:11 -05:00
Stefan Metzmacher
4d1c5a023c r12829: fix ldb headers, to not include '<...>' files in .c files
this helps in getting symbol -fvisibility=hidden (GCC 4 feature) working later.

metze
(This used to be commit 380938e97f31c7860aed1e73cc0110c6e17b472e)
2007-10-10 13:50:03 -05:00
Simo Sorce
c908d0b2aa r12733: Merge ldap/ldb controls into main tree
There's still lot of work to do but the patch is stable
enough to be pushed into the main samba4 tree.

Simo.
(This used to be commit 77125feaff252cab44d26593093a9c211c846ce8)
2007-10-10 13:49:47 -05:00
Jelmer Vernooij
d4de4c2d21 r12608: Remove some unused #include lines.
(This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981)
2007-10-10 13:49:03 -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
Simo Sorce
16aff2a184 r10305: start implementing better error handling
changed the prioivate modules API
error string are now not spread over all
modules but are kept in  a single place.

This allows a better control of memory
and error reporting.
(This used to be commit 3fc676ac1d6f59d08bedbbd9377986154cf84ce4)
2007-10-10 13:38:16 -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
Andrew Tridgell
b818ff3ede r7868: canonicalise the message before using ldb_add() in the ldbadd utility.
(This used to be commit 56f4af5f210da472d41d9bcf6918647181f6ad16)
2007-10-10 13:18:45 -05:00
Andrew Tridgell
f40e69da26 r7714: enable samba credentials handling in ldb tools. So you can now do a
encrypted ldbedit against w2k3
(This used to be commit 6277c3923e7d9c26753424b1e77ac62f8e0729a4)
2007-10-10 13:18:25 -05:00
Andrew Tridgell
ed3d8091ce r7709: - convert ldb to use popt, so that it can interact with the samba
cmdline credentials code (which will be done soon)

- added a ldb_init() call, and changed ldb_connect() to take a ldb
  context. This allows for much better error handling in
  ldb_connect(), and also made the popt conversion easier

- fixed up all the existing backends with the new syntax

- improved error handling in *_connect()

- fixed a crash bug in the new case_fold_required() code

- ensured that ltdb_rename() and all ltdb_search() paths get the read lock

- added a ldb_oom() macro to make it easier to report out of memory
  situations in ldb code
(This used to be commit f648fdf187669d6d87d01dd4e786b03cd420f220)
2007-10-10 13:18:24 -05:00
Richard Sharpe
da38166904 r6118: Make it so that we can do --with-zlib=no in configure and also a couple
of small typos.
(This used to be commit 9b4069e84573f85ce4341ceacd35737a18726a0b)
2007-10-10 13:11:20 -05:00
Simo Sorce
b1b14817ea r5585: LDB interfaces change:
changes:
- ldb_wrap disappears from code and become a private structure of db_wrap.c
  thanks to our move to talloc in ldb code, we do not need to expose it anymore

- removal of ldb_close() function form the code
  thanks to our move to talloc in ldb code, we do not need it anymore
  use talloc_free() to close and free an ldb database

- some minor updates to ldb modules code to cope with the change and fix some
  bugs I found out during the process
(This used to be commit d58be9e74b786a11a57e89df36081d55730dfe0a)
2007-10-10 13:10:55 -05:00
Andrew Tridgell
e82aad1ce3 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.
(This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
1a988ec9af r4474: - converted ldb to use talloc internally
- added gcov flags to Makefile.ldb

- expanded ldb test suite to get more coverage
(This used to be commit 0ab98f50a7e0fe15347a99e5c29a6590a87729a0)
2007-10-10 13:07:55 -05:00
Andrew Tridgell
9012a50153 r4059: moved the ldb -o option parsing to a common routine
(This used to be commit ee52c1e38c9bac852458196ffbd677cca62a3965)
2007-10-10 13:06:20 -05:00
Stefan Metzmacher
8a18778286 r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h

- make ldb_context and ldb_module private to the subsystem

- use ltdb_ prefix for all ldb_tdb functions

metze
(This used to be commit f5ee40d6ce8224e280070975efc9911558fe675c)
2007-10-10 13:05:52 -05:00
Simo Sorce
57d2043479 r3760: mention -o switch in help message
(This used to be commit 0e7d8753101f22aa192ac5628675a0374484d0e9)
2007-10-10 13:05:52 -05:00
Simo Sorce
679e95db03 r3754: merge in ldb modules support from the tmp branch ldbPlugins
(This used to be commit 71323f424b4561af1fdddd2358629049be3dad8c)
2007-10-10 13:05:51 -05:00
Andrew Tridgell
f0a8f718ff r792: - changed the ldb ldif_* functions to be in the ldb_ namespace
- added better error reporting in ldbdel

 - fixed a bug in handling packing of records which contain elements
   with no values (it caused db corruption)

 - allow search with "dn" as target attribute
(This used to be commit 36575396234e3d35dbd442c8f1ff54a17ae64e64)
2007-10-10 12:53:50 -05:00
Andrew Tridgell
68293565de r513: added a generic ldb debug system to allow the Samba debug functions to
be cleanly interfaced to ldb
(This used to be commit 74b89d5f960d6b936751e3f057b4540eb80b79cd)
2007-10-10 12:51:46 -05:00
Andrew Tridgell
d8ce7c6a2a r502: modified ldb to allow the use of an external pool memory
allocator. The way to use this is to call ldb_set_alloc() with a
function pointer to whatever memory allocator you like. It includes a
context pointer to allow for pool based allocators.
(This used to be commit 3955c482e6c2c9e975a4bb809ec8cb6068e48e34)
2007-10-10 12:51:45 -05:00
Andrew Tridgell
a7efe6c1c3 r159: nicer usage messages when no URL is given
(This used to be commit 8655f0b435e06af21d5d9fa210441fbf318673f0)
2007-10-10 12:51:12 -05:00
Andrew Tridgell
ac193579e7 r152: a quick airport commit ....
added ldbedit, a _really_ useful command

added ldbadd, ldbdel, ldbsearch and ldbmodify to build

solved lots of timezone issues, we now pass the torture tests with
client and server in different zones

fixed several build issues

I know this breaks the no-LDAP build. Wait till I arrive in San Jose for that
fix.
(This used to be commit af34710d4da1841653624fe304b1c8d812c0fdd9)
2007-10-10 12:51:11 -05:00
Andrew Tridgell
ee44733f94 added the rest of the ldb_modify() code, which required a fairly large
change in the ldb API. The API is now much closer to LDAP.
(This used to be commit e9e85c464411c561c5073d262a2e3533fec175ca)
2004-04-03 12:29:21 +00:00
Andrew Tridgell
58d50a614f make a more recent snapshot of ldb available to interested
people. Note that I decided to make it LGPL.

ldb is not finished yet, but enough of it is there for people to get
an idea of what it does, and quite a few simple tests work
(This used to be commit dc6f41f9e777d37f883303ddef0d96840d80f78e)
2004-03-31 06:45:39 +00:00