1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

1306 Commits

Author SHA1 Message Date
Andrew Tridgell
7ed65d2e12 build: result of hack session with ita 2010-04-06 20:26:40 +10:00
Andrew Tridgell
9129c3b3b6 build: fixes from ita 2010-04-06 20:26:40 +10:00
Andrew Tridgell
065e3e2509 build: using deps= for deps is clearer 2010-04-06 20:26:39 +10:00
Andrew Tridgell
5ad6369cd0 build: started to split up wafsamba.py into separate modules 2010-04-06 20:26:38 +10:00
Andrew Tridgell
64f5cdd204 build: moved wafsamba.py to buildtools 2010-04-06 20:26:38 +10:00
Andrew Tridgell
cada19f58b build: cope with empty source lists for libs 2010-04-06 20:26:38 +10:00
Andrew Tridgell
f15a81c1c0 build: added ASN1, PIDL and ET build rules
also added selftest example command
2010-04-06 20:26:38 +10:00
Andrew Tridgell
391f953c58 build: added build groups 2010-04-06 20:26:38 +10:00
Andrew Tridgell
f74584a96c build: recursive dependency calculation 2010-04-06 20:26:38 +10:00
Andrew Tridgell
24511472a3 build: DEFUN->DEFINE, and fixed CFLAGS handling 2010-04-06 20:26:38 +10:00
Andrew Tridgell
07eeed33f6 build: heimdal_build waf support
heimdal now mostly builds
2010-04-06 20:26:38 +10:00
Andrew Tridgell
bb1e36a86b build: make CHECK_FUNCS_IN() smarter about mandatory libraries 2010-04-06 20:26:37 +10:00
Andrew Tridgell
2998ea91ec build: added gettext/libintl to libreplace 2010-04-06 20:26:37 +10:00
Andrew Tridgell
15d523bb00 build: add LIBREPLACE_EXT 2010-04-06 20:26:37 +10:00
Andrew Tridgell
7aeffe68b1 build: added ASN1 and ERRTABLE build targets 2010-04-06 20:26:37 +10:00
Andrew Tridgell
06940d5796 build: auto-strip empty dependencies 2010-04-06 20:26:37 +10:00
Andrew Tridgell
eab4d4598e build: added LIBREPLACE_NETWORK 2010-04-06 20:26:37 +10:00
Andrew Tridgell
c3d04fd8fc build: don't distinguish system and local libs in wscript files 2010-04-06 20:26:37 +10:00
Andrew Tridgell
de2d305bfe build: add libresolv 2010-04-06 20:26:36 +10:00
Andrew Tridgell
8e81ea7c3a build: on the fly dependency checking 2010-04-06 20:26:36 +10:00
Andrew Tridgell
9e79e14e14 build: auto-remove circular dependencies 2010-04-06 20:26:36 +10:00
Andrew Tridgell
281f27d54b build: check for circular build dependencies 2010-04-06 20:26:36 +10:00
Andrew Tridgell
4f920748d4 build: death to singletons 2010-04-06 20:26:36 +10:00
Andrew Tridgell
e3dca1412b build: simpler BUILD_SUBDIR 2010-04-06 20:26:36 +10:00
Andrew Tridgell
371f9d35a7 build: more header checks 2010-04-06 20:26:36 +10:00
Andrew Tridgell
aa0476024c build: use runonce for config checks 2010-04-06 20:26:35 +10:00
Andrew Tridgell
ff9f972d55 build: added public_headers support 2010-04-06 20:26:35 +10:00
Andrew Tridgell
a3421fe6e9 build: added BUILD_SUBDIR() wrapper 2010-04-06 20:26:35 +10:00
Andrew Tridgell
5393e6c9d2 build: recognise manpages keyword 2010-04-06 20:26:35 +10:00
Andrew Tridgell
73634d6ff3 build: added autoproto stub 2010-04-06 20:26:35 +10:00
Andrew Tridgell
b1d24c7a8f build: put config.h in top dir by default 2010-04-06 20:26:35 +10:00
Andrew Tridgell
1cfc330156 build: allow override of config.h location 2010-04-06 20:26:35 +10:00
Andrew Tridgell
186e7115ab build: more developer flags 2010-04-06 20:26:35 +10:00
Andrew Tridgell
13cbd9f919 build: s4 wants config.h in include/ 2010-04-06 20:26:35 +10:00
Andrew Tridgell
4ed59b826c build: add dummy flags for auto-generated scripts 2010-04-06 20:26:34 +10:00
Andrew Tridgell
9a1cd09a10 build: added ADD_CFLAGS() and started of Samba4 build 2010-04-06 20:26:34 +10:00
Andrew Tridgell
7723519cf7 build: SAMBA_BUILD_ENV() is now in conf.* 2010-04-06 20:26:34 +10:00
Andrew Tridgell
bf4f9962f6 build: moved lib -> shared
- remove lib dep creation, it's done by waf
2010-04-06 20:26:34 +10:00
Andrew Tridgell
0316ec1d89 build: tdb does not depend on talloc 2010-04-06 20:26:34 +10:00
Andrew Tridgell
2b5a1cc70c build: added waf build rules for ldb 2010-04-06 20:26:34 +10:00
Andrew Tridgell
635a7ce6c1 build: some more config checks 2010-04-06 20:26:34 +10:00
Andrew Tridgell
45d23d1f53 build: added recursive library handling 2010-04-06 20:26:34 +10:00
Andrew Tridgell
04aa584c02 build: added target directory options 2010-04-06 20:26:34 +10:00
Andrew Tridgell
8f062f4a0f build: neater way to find libreplace and start on tevent waf build 2010-04-06 20:26:33 +10:00
Andrew Tridgell
f5d85a31d9 build: added some comments for tdb build 2010-04-06 20:26:33 +10:00
Andrew Tridgell
2bd0756dc5 build: more binaries for waf tdb build 2010-04-06 20:26:33 +10:00
Andrew Tridgell
8d6eb2a02c build: added waf build for tdb 2010-04-06 20:26:33 +10:00
Andrew Tridgell
5c103b484f build: renamed autoconf.py to wafsamba.py and added SAMBA_*() functions 2010-04-06 20:26:33 +10:00
Andrew Tridgell
34b77a15d3 build: updates to waf scripts for replace and talloc 2010-04-06 20:26:33 +10:00
Andrew Tridgell
9757da515d build: a first attempt at waf build for talloc and libreplace
very rough so far
2010-04-06 20:26:33 +10:00
Kai Blin
b1192bbfc9 lib/replace: Don't use StrnCpy inside crypt.c
With this and the int32_t/int64_t change, talloc crossbuilds to android
2010-04-04 13:51:02 +02:00
Kai Blin
781a0c0846 lib/replace: use correct inttypes in crypt.c
This makes the android crossbuild slightly less broken.
2010-04-04 13:42:15 +02:00
Andrew Tridgell
710aa773d5 socket-wrapper: not all systems have FIONREAD defined
tru64 for example
2010-04-03 13:31:12 +11:00
Andrew Tridgell
b81100c710 debug: enable talloc logging
we want to ensure talloc warnings are printed in the log
2010-04-02 18:52:29 +11:00
Andrew Tridgell
fde50c633f talloc: a useful bit of debug code
this is useful when tracking down talloc loops. It is probably too
expensive to have on by default.
2010-04-02 18:52:29 +11:00
Andrew Tridgell
1b4bbec523 talloc: add a define for TALLOC_MAX_DEPTH
Thanks to the suggestion from simo
2010-04-02 18:52:29 +11:00
Andrew Tridgell
5ccd30e9ac talloc: change talloc minor version to 2.0.2
this has the talloc_is_parent() bugfix
2010-04-02 13:15:18 +11:00
Andrew Tridgell
ff2b7d42e6 talloc: limit the depth that talloc will go for talloc_is_parent()
We have a bug in the dcerpc registry code that can cause a talloc loop
that chews unlimited CPU because of talloc_is_parent() during a
talloc_free()
2010-04-02 13:15:18 +11:00
Jelmer Vernooij
36c84854cb subunit: Include remainder of bindings and metadata. 2010-03-31 04:24:04 +02:00
Jelmer Vernooij
6897be7475 testtools: Fix included testtools, for systems that don't have it. 2010-03-31 04:19:36 +02:00
Jelmer Vernooij
a8ac7fda57 Put testtools directly under lib/ to make it easier to install from Samba 4. 2010-03-31 03:19:18 +02:00
Jelmer Vernooij
31094b0e8c smbtorture: Report number of available tests in a testsuite using subunit. 2010-03-31 02:57:47 +02:00
Jelmer Vernooij
197c98292b subunit: Also import copies of filters and perl module. 2010-03-31 02:20:10 +02:00
Andrew Tridgell
08e0d94fae replace: allow memmem() with an empty string to return NULL
This is how FreeBSD behaves. We don't rely on it returning the string
in Samba.
2010-03-30 20:34:17 +11:00
Andrew Tridgell
0f113faea8 charset: look for the codepages in the right place
selftest runs from source3/source4. The codepages when not installed
are in ../codepages
2010-03-30 12:31:03 +11:00
Jelmer Vernooij
082e7f20d7 subunit: Update to newer upstream version. 2010-03-29 18:05:29 +02:00
Jelmer Vernooij
4bbc3ff037 s4-python: Move dnspython to lib/, like the other Python modules
This also avoids it from being installed if it's already present on the
system.
2010-03-29 18:05:29 +02:00
Andrew Tridgell
686221eae2 s4-waf: use the libreplace strerror_r if needed 2010-03-29 21:34:29 +11:00
Andrew Tridgell
7ed349cace pytalloc: allow for using a system libtalloc-dev with pytalloc
When we have a system talloc library, we still need to grab pytalloc.h
from lib/talloc. We don't want to just use -Ilib/talloc, as otherwise
we'll get the in-tree talloc.h which may not be compatible with the
system talloc.h

So we need to give the path to pytalloc.h
2010-03-29 21:34:29 +11:00
Andrew Tridgell
08faa3a43c talloc: testsuite should use <talloc.h> not "talloc.h"
if we are using the system talloc, the testsuite needs to use the
system talloc.h
2010-03-29 21:34:29 +11:00
Simo Sorce
c1f6f61f62 tdb: update exports and signatures files 2010-03-26 15:21:15 -04:00
Volker Lendecke
261c3b4f1b tdb: Add a non-blocking version of tdb_transaction_start 2010-03-26 14:27:47 -04:00
Andreas Schneider
a6f25fc635 s3-smbd: Don't close stdout if we want to log to stdout. 2010-03-26 14:48:54 +01:00
Andrew Tridgell
5609c50433 tevent: added tevent_re_initialise()
This allows us to re-initialise a tevent context without destroying
the pointer. That means that if someone keeps a long term ptr to the
event context across a fork it will still work.

This also brings the memory handling in single and standard process
models much closer together, which means less bugs that we don't find
with make test.
2010-03-26 21:13:27 +11:00
Andrew Tridgell
525a4fb2c4 util: on FreeBSD true is in /usr/bin. Use execvp to find it 2010-03-26 19:03:22 +11:00
Andrew Tridgell
fae84f98e3 libutil: moved the networking defines to util_net.h
These were causing thousands of warnings on solaris8
2010-03-26 17:36:02 +11:00
Andrew Tridgell
c81d2ae3c9 libreplace: strerror_r() is needed by heimdal on solaris8 2010-03-26 16:50:48 +11:00
Andrew Tridgell
63fc397808 tsocket: not all systems have IPV6_V6ONLY 2010-03-26 16:50:48 +11:00
Volker Lendecke
59315887a0 tdb: Fix indentation in tdb_new_database() 2010-03-25 10:30:10 +01:00
Volker Lendecke
ea8e0d5d54 Fix some nonempty blank lines 2010-03-25 10:24:45 +01:00
Andrew Tridgell
088096d1ba python: use '#!/usr/bin/env python' to cope with varying install locations
this should be much more portable
2010-03-25 14:37:19 +11:00
Andrew Tridgell
a599319d0a libreplace: fixed declaration of dprintf() on FreeBSD 2010-03-24 07:11:38 +01:00
Andrew Tridgell
4c4d0a029d build: fixed nss_wrapper on solaris
solaris has different getpwnam_r syntax
2010-03-24 15:50:50 +11:00
Matthias Dieter Wallnöfer
31b4585489 convert_string_talloc_convenience - print out the input buffer in a better way (using dump_data since it isn't always directly readable) 2010-03-22 23:21:17 +01:00
Volker Lendecke
e2c7e5c4f7 tdb: Fix bug 7248, avoid the nanosleep dependency 2010-03-22 21:29:21 +01:00
Stefan Metzmacher
01f2c023f7 lib/util: add allocate_anonymous_shared()
metze
2010-03-22 17:15:10 +01:00
Volker Lendecke
56940a28ff Fix an uninitialized variable 2010-03-21 21:01:28 +01:00
Volker Lendecke
d097d9fb09 Use TALLOC_FREE in talloc_pop() 2010-03-21 17:12:23 +01:00
Volker Lendecke
0f3040a61f Use calloc instead of ZERO_STRUCTP in talloc_stackframe_create() 2010-03-21 17:12:23 +01:00
Volker Lendecke
6695b0e87d Trim an overlong line 2010-03-21 17:12:23 +01:00
Günther Deschner
f06779629d nss_wrapper.pl: allow to specify gid for new users.
Guenther
2010-03-19 09:54:10 +01:00
Andrew Tridgell
55c45110e6 charset: fixed a problem with the global use of the iconv_convenience structure
We had a crash bug where a cached copy of a iconv convenience pointer
was used after being freed when loadparm asked for iconv to
reload. This could happen if a python module used a iconv based
function before loadparm was completed.

The fix is to ensure that any use of this pointer remains valid, by
reusing the pointer itself when it has already been initialised, but
filling in the child elements with the updated values.
2010-03-18 14:18:41 +11:00
Stefan Metzmacher
d23581b4d7 talloc_stack: reset stackframe pointers to NULL
This makes it easier to debug the code in future.

metze
2010-03-15 15:08:24 +01:00
Stefan Metzmacher
10ed809a1a talloc_stack: make sure we never let talloc_tos() return ts->talloc_stack[-1]
In smbd there's a small gab between TALLOC_FREE(frame); before
be call smbd_parent_loop() where we don't have a valid talloc stackframe.

smbd_parent_loop() calls talloc_stackframe() only within the while(1) loop.
As DEBUG(2,("waiting for connections")) uses talloc_tos() to construct
the time header for the debug message we crash on some systems.

metze
2010-03-15 15:08:23 +01:00
Matthieu Patou
8306eb1c5f s4: create ../lib/iniparser_build/config.m4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-11 13:31:37 +01:00
Andrew Bartlett
6441a5b0b9 Explain why we don't use certain characters in the generated pw 2010-03-11 15:34:01 +11:00
Endi S. Dewata
a6253a45c0 lib/util - Removed curly braces from generate_random_password(). 2010-03-11 15:31:08 +11:00
Andrew Bartlett
4ab3e220c4 Move prototype to header of common code for set_sockaddr_port 2010-03-11 11:27:47 +11:00
Kamen Mazdrashki
d142d9fb64 doxygen: talloc_get_type name fixed in Doxygen documentation
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-10 17:11:55 +01:00
Stefan Metzmacher
6ea3393798 lib/util: change samba_runcmd() to use tevent_req _send/_recv
metze
2010-03-09 21:49:45 +11:00
Andrew Tridgell
f3c738f819 replace: added get_current_dir_name() 2010-03-05 23:07:32 +11:00
Andrew Tridgell
ee4ae0e7ad s4-privs: add root_privileges_original_uid()
This can be used to get the uid we changed away from when we gained 
root privileges

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-03-05 23:07:31 +11:00
Karolin Seeger
340797f3fa Fix typo in comments. 2010-03-03 16:03:13 +01:00
Matthieu Patou
b953c4c67c s3: Move source3/iniparser to lib/iniparser to allow sharing between s3/s4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-03-03 09:22:39 +01:00
Volker Lendecke
fb98f60594 tdb: If tdb_parse_record does not find a record, return -1 instead of 0 2010-02-28 17:40:59 +01:00
Andreas Schneider
1983256c70 tsocket: Improve the tsocket_address_bsd_sockaddr documentation.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-26 08:57:30 +01:00
Stefan Metzmacher
792dd38d7c lib/util: add generate_random_password()
metze
2010-02-26 08:57:28 +01:00
Andrew Tridgell
b0b857d6ca s4-dns: use a loadparm list for samba_runcmd() commands
This allows commands with multiple arguments and quoting to be used,
while still avoiding running a shell (and this having shell expansion
problems)
2010-02-26 18:19:27 +11:00
Rusty Russell
ec96ea690e tdb: handle processes dying during transaction commit.
tdb transactions were designed to be robust against the machine
powering off, but interestingly were never designed to handle the case
where an administrator kill -9's a process during commit.  Because
recovery is only done on tdb_open, processes with the tdb already
mapped will simply use it despite it being corrupt and needing
recovery.

The solution to this is to check for recovery every time we grab a
data lock: we could have gained the lock because a process just died.
This has no measurable cost: here is the time for tdbtorture -s 0 -n 1
-l 10000:

Before:
	2.75 2.50 2.81 3.19 2.91 2.53 2.72 2.50 2.78 2.77 = Avg 2.75

After:
	2.81 2.57 3.42 2.49 3.02 2.49 2.84 2.48 2.80 2.43 = Avg 2.74

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 13:23:58 +10:30
Rusty Russell
1bf482b9ef patch tdb-refactor-tdb_lock-and-tdb_lock_nonblock.patch 2010-02-24 13:18:06 +10:30
Rusty Russell
ececeffd85 tdb: add -k option to tdbtorture
To test the case of death of a process during transaction commit, add
a -k (kill random) option to tdbtorture.  The easiest way to do this
is to make every worker a child (unless there's only one child), which
is why this patch is bigger than you might expect.

Using -k without -t (always transactions) you expect corruption, though
it doesn't happen every time.  With -t, we currently get corruption but
the next patch fixes that.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:53:05 +10:30
Rusty Russell
8c3fda4318 tdb: don't truncate tdb on recovery
The current recovery code truncates the tdb file on recovery.  This is
fine if recovery is only done on first open, but is a really bad idea
as we move to allowing recovery on "live" databases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:50:41 +10:30
Rusty Russell
9f295eecff tdb: remove lock ops
Now the transaction code uses the standard allrecord lock, that stops
us from trying to grab any per-record locks anyway.  We don't need to
have special noop lock ops for transactions.

This is a nice simplification: if you see brlock, you know it's really
going to grab a lock.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:49:22 +10:30
Rusty Russell
a84222bbaf tdb: rename tdb_release_extra_locks() to tdb_release_transaction_locks()
tdb_release_extra_locks() is too general: it carefully skips over the
transaction lock, even though the only caller then drops it.  Change
this, and rename it to show it's clearly transaction-specific.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 11:02:55 +10:30
Rusty Russell
dd1b508c63 tdb: cleanup: remove ltype argument from _tdb_transaction_cancel.
Now the transaction allrecord lock is the standard one, and thus is cleaned
in tdb_release_extra_locks(), _tdb_transaction_cancel() doesn't need to
know what type it is.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 12:42:24 +10:30
Rusty Russell
fca1621965 tdb: tdb_allrecord_lock/tdb_allrecord_unlock/tdb_allrecord_upgrade
Centralize locking of all chains of the tdb; rename _tdb_lockall to
tdb_allrecord_lock and _tdb_unlockall to tdb_allrecord_unlock, and
tdb_brlock_upgrade to tdb_allrecord_upgrade.

Then we use this in the transaction code.  Unfortunately, if the transaction
code records that it has grabbed the allrecord lock read-only, write locks
will fail, so we treat this upgradable lock as a write lock, and mark it
as upgradable using the otherwise-unused offset field.

One subtlety: now the transaction code is using the allrecord_lock, the
tdb_release_extra_locks() function drops it for us, so we no longer need
to do it manually in _tdb_transaction_cancel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 15:42:15 +10:30
Rusty Russell
caaf5c6baa tdb: suppress record write locks when allrecord lock is taken.
Records themselves get (read) locked by the traversal code against delete.
Interestingly, this locking isn't done when the allrecord lock has been
taken, though the allrecord lock until recently didn't cover the actual
records (it now goes to end of file).

The write record lock, grabbed by the delete code, is not suppressed
by the allrecord lock.  This is now bad: it causes us to punch a hole
in the allrecord lock when we release the write record lock.  Make this
consistent: *no* record locks of any kind when the allrecord lock is
taken.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:45:26 +10:30
Rusty Russell
9341f230f8 tdb: cleanup: always grab allrecord lock to infinity.
We were previously inconsistent with our "global" lock: the
transaction code grabbed it from FREELIST_TOP to end of file, and the
rest of the code grabbed it from FREELIST_TOP to end of the hash
chains.  Change it to always grab to end of file for simplicity and
so we can merge the two.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:45:14 +10:30
Rusty Russell
1ab8776247 tdb: remove num_locks
This was redundant before this patch series: it mirrored num_lockrecs
exactly.  It still does.

Also, skip useless branch when locks == 1: unconditional assignment is
cheaper anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 15:01:07 +10:30
Rusty Russell
d48c3e4982 tdb: use tdb_nest_lock() for seqnum lock.
This is pure overhead, but it centralizes the locking.  Realloc (esp. as
most implementations are lazy) is fast compared to the fnctl anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:40:57 +10:30
Rusty Russell
4738d474c4 tdb: use tdb_nest_lock() for active lock.
Use our newly-generic nested lock tracking for the active lock.

Note that the tdb_have_extra_locks() and tdb_release_extra_locks()
functions have to skip over this lock now it is tracked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:44:40 +10:30
Rusty Russell
9136818df3 tdb: use tdb_nest_lock() for open lock.
This never nests, so it's overkill, but it centralizes the locking into
lock.c and removes the ugly flag in the transaction code to track whether
we have the lock or not.

Note that we have a temporary hack so this places a real lock, despite
the fact that we are in a transaction.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-22 13:58:07 +10:30
Rusty Russell
e8fa70a321 tdb: use tdb_nest_lock() for transaction lock.
Rather than a boutique lock and a separate nest count, use our
newly-generic nested lock tracking for the transaction lock.

Note that the tdb_have_extra_locks() and tdb_release_extra_locks()
functions have to skip over this lock now it is tracked.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:37:34 +10:30
Rusty Russell
ce41411c84 tdb: cleanup: find_nestlock() helper.
Factor out two loops which find locks; we are going to introduce a couple
more so a helper makes sense.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:35:54 +10:30
Rusty Russell
db270734d8 tdb: cleanup: tdb_release_extra_locks() helper
Move locking intelligence back into lock.c, rather than open-coding the
lock release in transaction.c.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-24 10:41:15 +10:30
Rusty Russell
fba42f1fb4 tdb: cleanup: tdb_have_extra_locks() helper
In many places we check whether locks are held: add a helper to do this.

The _tdb_lockall() case has already checked for the allrecord lock, so
the extra work done by tdb_have_extra_locks() is merely redundant.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:34:26 +10:30
Rusty Russell
b754f61d23 tdb: don't suppress the transaction lock because of the allrecord lock.
tdb_transaction_lock() and tdb_transaction_unlock() do nothing if we
hold the allrecord lock.  However, the two locks don't overlap, so
this is wrong.

This simplification makes the transaction lock a straight-forward nested
lock.

There are two callers for these functions:
1) The transaction code, which already makes sure the allrecord_lock
   isn't held.
2) The traverse code, which wants to stop transactions whether it has the
   allrecord lock or not.  There have been deadlocks here before, however
   this should not bring them back (I hope!)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:31:49 +10:30
Rusty Russell
5d9de604d9 tdb: cleanup: tdb_nest_lock/tdb_nest_unlock
Because fcntl locks don't nest, we track them in the tdb->lockrecs array
and only place/release them when the count goes to 1/0.  We only do this
for record locks, so we simply place the list number (or -1 for the free
list) in the structure.

To generalize this:

1) Put the offset rather than list number in struct tdb_lock_type.
2) Rename _tdb_lock() to tdb_nest_lock, make it non-static and move the
   allrecord check out to the callers (except the mark case which doesn't
   care).
3) Rename _tdb_unlock() to tdb_nest_unlock(), make it non-static and
   move the allrecord out to the callers (except mark again).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:26:13 +10:30
Rusty Russell
e9114a7585 tdb: cleanup: rename global_lock to allrecord_lock.
The word global is overloaded in tdb.  The global_lock inside struct
tdb_context is used to indicate we hold a lock across all the chains.

Rename it to allrecord_lock.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:19:47 +10:30
Rusty Russell
7ab422d6fb tdb: cleanup: rename GLOBAL_LOCK to OPEN_LOCK.
The word global is overloaded in tdb.  The GLOBAL_LOCK offset is used at
open time to serialize initialization (and by the transaction code to block
open).

Rename it to OPEN_LOCK.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:18:33 +10:30
Rusty Russell
a6e0ef87d2 tdb: make _tdb_transaction_cancel static.
Now tdb_open() calls tdb_transaction_cancel() instead of
_tdb_transaction_cancel, we can make it static.

Signed-off-by: Rusty Russell<rusty@rustcorp.com.au>
2010-02-24 10:39:59 +10:30
Rusty Russell
452b4a5a6e tdb: cleanup: split brlock and brunlock methods.
This is taken from the CCAN code base: rather than using tdb_brlock for
locking and unlocking, we split it into brlock and brunlock functions.

For extra debugging information, brunlock says what kind of lock it is
unlocking (even though fnctl locks don't need this).  This requires an
extra argument to tdb_transaction_unlock() so we know whether the
lock was upgraded to a write lock or not.

We also use a "flags" argument tdb_brlock:
1) TDB_LOCK_NOWAIT replaces lck_type = F_SETLK (vs F_SETLKW).
2) TDB_LOCK_MARK_ONLY replaces setting TDB_MARK_LOCK bit in ltype.
3) TDB_LOCK_PROBE replaces the "probe" argument.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-17 12:17:19 +10:30
Andreas Schneider
13e2f5f971 libreplace: Remove the obsolete signal type cast.
AC_SIGNAL_TYPE is already obsolete in autoconf. C89 requires signal
handlers to return void, only K&R returned int.
2010-02-23 12:23:45 +01:00
Andreas Schneider
8ac0c9fc67 libutil: Remove obsolete signal type cast. 2010-02-23 12:23:44 +01:00
Brad Hards
dd89dc2c31 Spelling fixes for libutil
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:35 +01:00
Brad Hards
e4c2f4dc75 Spelling fixes in lib/zlib.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:35 +01:00
Brad Hards
198b17abf0 Spelling fixes for libreplace.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:34 +01:00
Brad Hards
319d3bf9d9 Spelling fixes for tsocket API documentation.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:33 +01:00
Brad Hards
11b211cf98 Spelling fixes for lib/compression.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:33 +01:00
Brad Hards
7863bb1511 Spelling fixes for nss_wrapper.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:33 +01:00
Brad Hards
842fb05b11 Spelling fixes for popt API documentation.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:32 +01:00
Brad Hards
119a8230eb Spelling fixes for tevent.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:32 +01:00
Brad Hards
09e756b1d6 Spelling fixes for tdb.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:31 +01:00
Michael Adam
1a42b020fd nss_wrapper: fix segfault in print_group() in the testsuite
Running
'TESTS=posix_s3 POSIX_SUBTESTS="RPC-SAMR-LARGE-DC LOCAL-NSS-WRAPPER" make test'
from s3 made smbtorture4 crash on my box.

Michael
2010-02-19 00:37:41 +01:00
Günther Deschner
2eb83f2964 s4-smbtorture: add LOCAL-NSS-WRAPPER-DUPLICATES test.
Guenther
2010-02-18 23:25:16 +01:00
Günther Deschner
9b9c9fd175 s4-smbtorture: be more verbose in LOCAL-NSS-WRAPPER.
Guenther
2010-02-18 23:25:16 +01:00
Stefan Metzmacher
c42d9c4ec4 tsocket/bsd: fix comment in tdgram_bsd_recvfrom_handler()
metze
2010-02-18 09:38:00 +01:00
Jeremy Allison
936828de71 Fix commit d07cd37b99
Which was:

    tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD

Metze, this has to have been wrong - you are throwing away the talloc_realloc
pointer returned. Also no error checking. Please review.

Thank goodness for gcc warnings :-).

Jeremy.
2010-02-17 09:24:34 -08:00
Stefan Metzmacher
d07cd37b99 tsocket/bsd: fix bug #7115 FreeBSD includes the UDP header in FIONREAD
metze
2010-02-17 14:46:39 +01:00
Stefan Metzmacher
1ffcb991a9 tsocket/bsd: set IPV6_V6ONLY on AF_INET6 sockets
Some system already have this as default. It's easier
to behave the same way on all systems and handle ipv6
and ipv4 sockets separate.

metze
2010-02-17 14:46:39 +01:00
Stefan Metzmacher
8a0949dfc8 tsocket/bsd: fix bug #7140 autodetect ipv4 and ipv6 based on the remote address if the local address is any
metze
2010-02-17 14:46:08 +01:00
Stefan Metzmacher
6637b2f4b0 tsocket/bsd: fix bug #7140 use calculated sa_socklen for bind() in tstream_bsd_connect_send()
This is needed because, we can't use sizeof(sockaddr_storage) for AF_UNIX
sockets. Also some platforms require exact values for AF_INET and AF_INET6.

metze
2010-02-17 14:45:34 +01:00
Stefan Metzmacher
135543b4c3 tsocket/bsd: fix do_bind logic for AF_INET
We want the explicit bind() when we don't use the any address.

metze
2010-02-17 14:13:57 +01:00
Stefan Metzmacher
0b3e950731 socket_wrapper: also ignore AF_INET6 in swrap_setsockopt()
metze
2010-02-17 14:13:55 +01:00
Andrew Tridgell
8756e13009 util: added samba_runcmd()
This allows us to run a child command in an async fashion, with
control over logging of stdout and stderr (which appears in the Samba
log file). This is useful for ensuring we don't miss important
messages from rndc commands (for example).

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-17 19:43:32 +11:00
Andrew Tridgell
0bedb9cf5e s4-dsdb: removed gendb_search_single_extended_dn()
Use dsdb_search_one() instead, which allows for arbitrary controls

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-16 21:10:51 +11:00
Andrew Tridgell
ccfa40fdc3 util: update three other copies of our dlinklist.h macros
ldb and tevent have their own copies of these macros. This brings them
in sync with the master copy of dlinklist.h
2010-02-14 18:44:21 +11:00
Andrew Tridgell
76a7382346 lib: use TYPESAFE_QSORT() in lib/ and libcli/ 2010-02-14 18:44:20 +11:00
Andrew Tridgell
282cc79454 s4-ldb: use TYPESAFE_QSORT() in the rest of the ldb code 2010-02-14 18:44:20 +11:00
Volker Lendecke
e371317686 use ZERO_STRUCT 2010-02-13 13:25:32 +01:00
Volker Lendecke
95ca53f3e0 Use ZERO_STRUCTP 2010-02-13 13:25:17 +01:00
Volker Lendecke
1a995ab51e s3: Fix a typo 2010-02-13 13:25:03 +01:00
Andrew Tridgell
1373e748aa tdb: use fdatasync() instead of fsync() in transactions
This might help on some filesystems
2010-02-13 22:36:11 +11:00
Andrew Tridgell
f435538576 libreplace: add fdatasync() if not available 2010-02-13 22:36:11 +11:00
Andrew Tridgell
63844609da util: added TYPESAFE_QSORT() macro
This makes it much harder to get the type of a qsort comparison
function wrong.
2010-02-13 22:36:11 +11:00
Volker Lendecke
6824c6f46b tdb: Apply some const, just for clarity 2010-02-13 12:19:09 +01:00
Volker Lendecke
ebc08b9938 s3: Add tdb_data_equal 2010-02-12 23:12:10 +01:00
Andrew Tridgell
ae95d611b6 util: added file_compare() utility function
file_compare() returns true if two files are the same. It is meant for
small files.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-11 21:04:13 +11:00
Andrew Tridgell
d6fb64c512 libreplace: added replacements for dprintf() and vdprintf()
these are very useful for writing files with formatted writes

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-02-11 21:04:13 +11:00
Andrew Tridgell
91cb7b7c60 test:local added LOCAL-DLINKLIST testsuite
(cherry picked from commit 95a5bee2c30a67a35604b0456ab7836f6dc67702)
2010-02-10 15:55:34 -08:00
Andrew Tridgell
32809bd8c1 util: rewrite dlinklist.h so that DLIST_ADD_END() is O(1)
This changes the meaning of the ->prev pointer in our doubly linked
lists to point at the end of the list from the front of the list. That
allows us to implement DLIST_ADD_END() and related functions in O(1)
time, which can be a huge saving in many places in Samba.

This also means that the 'type' argument to various DLIST_*() macros
is no longer needed, but I have left it in for now to keep the
patchset small, which will make it easier to revert if any problems
are found. In the future we should remove the 'type' arguments.

(jra. Move the one use of DLIST_TAIL over to the new macros).
2010-02-10 15:53:58 -08:00
Jeremy Allison
32575ed70f Temporary changes to dlinklist to keep the implementation static whilst
uses of (list)->prev are moved over to DLIST_PREV. This will be replaced
when the final (new) version of the dlinklist.h header is added.

Jeremy.
2010-02-10 15:30:59 -08:00
Rusty Russell
b37b452cb8 tdb: fix recovery reuse after crash
If a process (or the machine) dies after just after writing the
recovery head (pointing at the end of file), the recovery record will filled
with 0x42.  This will not invoke a recovery on open, since rec.magic
!= TDB_RECOVERY_MAGIC.

Unfortunately, the first transaction commit will happily reuse that
area: tdb_recovery_allocate() doesn't check the magic.  The recovery
record has length 0x42424242, and it writes that back into the
now-valid-looking transaction header) for the next comer (which
happens to be tdb_wipe_all in my tests).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-10 16:56:14 +10:30
Rusty Russell
6269cdcd15 tdb: give a name to the invalid recovery area constant (0)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2010-02-10 16:56:13 +10:30
Simo Sorce
6339de7f4f release-scripts: parametrize scripts
This should make it easier to keep all release scripts alined as it will reduce
the difference between them to ideally a few variables

Also moves the tdb script in the scripts directory.
2010-02-08 10:29:06 -05:00
Simo Sorce
6bf2a821b7 talloc: Fix abi checks in release script
We must perform abi checks against the version we are going to release.
Not against the current tree we are in.
2010-02-08 10:12:50 -05:00
Simo Sorce
1422a94654 talloc: Fix abi checks and ifdefs
teach the abi check scripts to skip the DOXYGEN sections
fix the header to use #ifdef DOXYGEN and not #if DOXYGEN
2010-02-08 10:02:49 -05:00
Stefan Metzmacher
02320cb0e2 libreplace: add check for NSS_WRAPPER_DISABLE similar to SOCKET_WRAPPER_DISABLE
metze
2010-02-08 09:59:23 +01:00
Volker Lendecke
6e7bcaa878 libreplace: Attempt to fix bug 5910, detect a broken getaddrinfo
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-08 09:59:20 +01:00
Bo Yang
8c8bb51de1 s3: signals are processed twice in child.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-09 17:05:58 +08:00
Andrew Tridgell
7fed22eb0a talloc: fixed doc typo 2010-02-08 11:04:59 +11:00
Andreas Schneider
da0e396deb Move the talloc details to the mainpage.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-08 11:04:59 +11:00
Andreas Schneider
52c0cd38fa talloc: Added doxygen config file.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-08 11:04:59 +11:00
Andreas Schneider
fbd646a783 talloc: Documented talloc with doxygen.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2010-02-08 11:04:59 +11:00
Simo Sorce
70534adee1 tdb: raise version to 1.2.1
after recent fixes we need to raise the version to 1.2.1 so that
we can require also the right patched version.
2010-02-06 10:48:39 -05:00
Matthias Dieter Wallnöfer
e4d29bb4fd s4:UID wrapper - Make it work on older distributions
On my older CentOS 4 installation I had the problem with the missing
substitution prototypes ("uwrap_*"). So I added them to "uid_wrapper.h".

Also, I made the head of the "uid_wrapper.c" file more like the one of
"nss_wrapper.c" - it shouldn't change that much, I did it only to be consistent.

This patch should fix the build on older distributions while keep it running on
newer ones.
2010-02-05 19:47:26 +01:00
Matthias Dieter Wallnöfer
16aa0744c6 s4:UID wrapper - Fix includes
The includes of the UID wrapper headers werent't really efficient according
to metze's post on the technical mailing list (http://lists.samba.org/archive/samba-technical/2010-February/069165.html).
To achieve this move the "uid_wrapper.h" includes into "lib/util/unix_privs.c",
 "lib/util/util.c", "ntvfs/posix/pvfs_acl.c" and "ntvfs/unixuid/vfs_unixuid.c".
2010-02-05 19:47:26 +01:00
Matt Kraai
a7250eb142 Change uint_t to unsigned int in lib/util
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:17 +01:00
Matt Kraai
2cb2d5317f Change uint_t to unsigned int in lib/talloc
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:16 +01:00
Matt Kraai
d4fc2e8201 Change uint_t to unsigned int in lib/crypto
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:16 +01:00
Matt Kraai
a2c95a5d96 Change uint_t to unsigned int in lib/replace
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-02-02 07:18:16 +01:00
Volker Lendecke
531059696e tdb: fix an early release of the global lock that can cause data corruption
There was a bug in tdb where the

                tdb_brlock(tdb, GLOBAL_LOCK, F_UNLCK, F_SETLKW, 0, 1);

(ending the transaction-"mutex") was done before the

                        /* remove the recovery marker */

This means that when a transaction is committed there is a window where another
opener of the file sees the transaction marker while the transaction committer
is still fully functional and working on it. This led to transaction being
rolled back by that second opener of the file while transaction_commit() gave
no error to the caller.

This patch moves the F_UNLCK to after the recovery marker was removed, closing
this window.
2010-02-01 15:06:29 +01:00
Stefan Metzmacher
ad6ea7b189 lib/util: remove data_blob_talloc_reference()
We want to avoid the usage of talloc_reference() in Samba.

metze
2010-01-29 11:16:44 +01:00
Kai Blin
88099bcc93 tsocket: Fix the description of tstream_writev_queue_send/recv 2010-01-28 11:16:24 +01:00
Kai Blin
9184f524f0 tsocket: Fix description for tstream_readv_pdu_queue_send/recv 2010-01-28 11:11:33 +01:00
Björn Jacke
e87adf523b Revert "libreplace: fix unused varibale warning on IRIX"
this one was broken
2010-01-26 01:16:37 +01:00
Björn Jacke
b6839e1bfd libreplace: fix unused varibale warning on IRIX 2010-01-26 00:19:10 +01:00
Karolin Seeger
463aa06442 lib/popt: Fix typo in README.
Karolin
2010-01-25 19:54:24 +01:00
Volker Lendecke
a771c184b1 libreplace: Fix a C++ warning 2010-01-23 14:35:38 +01:00
Jelmer Vernooij
c42242d132 s4: Include Python.h early to avoid double definition errors. 2010-01-21 16:15:10 +13:00
Lars Müller
9e318129e0 Work around bad use of autoconf interna
Merge fix made by Andreas Schwab <schwab@linux-m68k.org>.  This change
had been in use by SUSE since 2008-07-03.
2010-01-18 11:49:01 +01:00
Jelmer Vernooij
2ec5792a4b subunit/testtools: Include newer version. 2010-01-16 19:56:21 +13:00
Jelmer Vernooij
28577aae92 Import testtools as well, required for subunit. 2010-01-16 19:53:49 +13:00
Jelmer Vernooij
b6b46b4978 subunit: Import new version. 2010-01-16 19:53:49 +13:00
Jelmer Vernooij
2e38cb2cbb Add README about subunit. 2010-01-16 19:53:49 +13:00
Jelmer Vernooij
664b74d366 Add script for updating the copy of subunit. 2010-01-16 19:53:49 +13:00
Andreas Schneider
04f3f27f7e tsocket: Added doxygen config file.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-11 11:23:04 +01:00
Andreas Schneider
574f77f89e tsocket: Added complete doxygen documentation.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-11 11:22:59 +01:00
Andrew Tridgell
273a4d9803 s4-debug: removed debug_ctx(). It didn't catch on :-)
There was only one user, which isn't worth it for the overhead.
2010-01-09 10:15:13 +11:00
Björn Jacke
571ee54b79 lib/util: move TIME_T_MIN/MAX defines into header file 2010-01-07 00:50:29 +01:00
Stefan Metzmacher
c01f443ebc tdb: fix standalone 'make installdocs'
metze
2010-01-06 14:43:39 +01:00
Brian Lu
0a3a6bb8f9 tdb: create symbol links to shared libraries see https://bugzilla.samba.org/show_bug.cgi?id=6991 for details
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-06 14:27:50 +01:00
Brian Lu
eff6022d51 talloc: create symbol links to shared libraries see https://bugzilla.samba.org/show_bug.cgi?id=6991 for details
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-06 14:27:44 +01:00
Brian Lu
f408d58d95 tevent: create symbol links to shared libraries see https://bugzilla.samba.org/show_bug.cgi?id=6991 for details
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-01-06 14:27:38 +01:00
Andrew Tridgell
fef3c910da libreplace: some systems don't have memmem()
added rep_memmem() and a testsuite
2010-01-02 10:08:12 +11:00
Stefan Metzmacher
17c804a675 tsocket: only copy the specific part of sockaddr*
This makes sure we fill the unspefic bytes with 0
and have zero termination for sockaddr_un.

metze
2009-12-24 17:38:29 +01:00
Stefan Metzmacher
4784c8c3be tsocket: allow AF_UNIX sockaddrs smaller than sizeof(sockaddr_un)
This is needed as getpeername() truncates the length to 2 if the
peer socket has no name.

metze
2009-12-24 17:38:04 +01:00
Jelmer Vernooij
0110990f01 tdb: Also build and install tdb manpages from standalone tdb. 2009-12-21 23:40:12 +01:00
Jelmer Vernooij
8b278e6dc1 tdb: Fix formatting of API check file. 2009-12-21 23:40:12 +01:00
Stefan Metzmacher
4b7a6b1f8f tevent: prefix types and defined with tevent_ and TEVENT_
This fixes the build warnings on some build-farm hosts.

metze
2009-12-20 14:21:50 +01:00
Peter Rosin
590f7c262d Output %p as unsigned in snprintf replacement. 2009-12-19 19:43:52 +01:00
Brendan Powers
027cba6a49 Return NULL in strlower_talloc if src is NULL
Prevents strlower_talloc from segfaulting if you pass it a NULL string.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
2009-12-18 14:27:43 +11:00
Günther Deschner
a23084e1e8 tdbtool: avoid using c++ reserved words.
Guenther
2009-12-17 15:40:42 +01:00
Andreas Schneider
a5bdab8b32 tsocket: Fixed tsocket_guide.txt asciidoc syntax. 2009-12-15 23:34:23 +01:00
Andreas Schneider
e33ae22b87 tsocket: Fixed documentation for tsocket_address_bsd_sockaddr(). 2009-12-15 23:34:22 +01:00
Andreas Schneider
ab04dd3be7 tsocket: Fixed typo in LGPL header. 2009-12-15 23:34:22 +01:00
Stefan Metzmacher
edbf2caa6f tsocket: add tsocket_address_bsd_sockaddr() and tsocket_address_bsd_from_sockaddr()
metze
2009-12-15 23:34:22 +01:00
Simo Sorce
7f956869ff Fix release script to work with recent git versions 2009-12-15 09:17:25 -05:00
Andrew Tridgell
71943e8858 util: added binsearch.h for binary array searches
This was moved from the schema_query code. It will now be used in more
than one place, so best to make it a library macro. I think there are
quite a few places that could benefit from this.
2009-12-10 17:51:29 +11:00
Kamen Mazdrashki
4653d05fef tdr-test: Fix 'push_charset' test
4 bytes of 'bloe' string are pushed, so we should
check only for the first 4 caracters

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-08 12:39:10 +11:00
Kamen Mazdrashki
8efabcc8a5 talloc: Fix write behind memory block
If ALWASY_REALLOC is defined and we are to 'shrink' memory block,
memcpy() will write outside memory just allocated.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2009-12-08 12:39:10 +11:00
Simo Sorce
4334092cba Fix release script with newer versins of git 2009-12-07 09:25:03 -05:00
Matthias Dieter Wallnöfer
012494b800 util/util_strlist - add a call "const_str_list" for making "unconst" lists "const" 2009-12-01 16:46:29 +11:00
Volker Lendecke
4d8118f145 tevent: Fix a comment 2009-11-26 17:22:56 +01:00
Matthias Dieter Wallnöfer
c1cb1f7724 charset/tests/iconv - Remove the "const" from "ptr_in" to prevent "discard_const_p" use
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 16:50:49 +01:00
Matthias Dieter Wallnöfer
9776cb0345 tdb tools: Mostly cosmetic adaptions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 16:50:48 +01:00
Matthias Dieter Wallnöfer
94c33bdd72 util/strlist: Fix up "const" warnings in the string list and test code
This work I did using suggestions by Jelmer.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 16:50:47 +01:00
Stefan Metzmacher
5ca0a4bfd6 tdb: change version to 1.2.0 after adding TDB_*ALLOW_NESTING
metze
2009-11-20 09:45:43 +01:00
Stefan Metzmacher
3b9f19ed91 tdb: add TDB_DISALLOW_NESTING and make TDB_ALLOW_NESTING the default behavior
We need to keep TDB_ALLOW_NESTING as default behavior,
so that existing code continues to work.

However we may change the default together with a major version
number change in future.

metze
2009-11-20 09:45:36 +01:00
Ronnie Sahlberg
436b55db1f New attempt at TDB transaction nesting allow/disallow.
Make the default be that transaction is not allowed and any attempt to create a nested transaction will fail with TDB_ERR_NESTING.

If an application can cope with transaction nesting and the implicit
semantics of tdb_transaction_commit(), it can enable transaction nesting
by using the TDB_ALLOW_NESTING flag.
(cherry picked from ctdb commit 3e49e41c21eb8c53084aa8cc7fd3557bdd8eb7b6)

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-11-20 09:45:34 +01:00
Stefan Metzmacher
85449b7bcc tdb: always set tdb->tracefd to -1 to be safe on goto fail
metze
2009-11-20 09:45:34 +01:00
Andrew Tridgell
e73b790c04 fixed the build
whoever pushed 15d93a5d8e, please check
that what you push compiles and passes tests. In this case it didn't
compile.
2009-11-18 12:46:45 +11:00
Aravind Srinivasan
f7e3809d66 s4/torture: add a new ulong parameteric torture option 2009-11-17 17:06:26 -08:00
Volker Lendecke
4a777ec4d7 Attempt to fix the s4 build -- we can not use map_nt_error_from_unix in lib/ 2009-11-14 11:32:38 +01:00
Volker Lendecke
f38edcd61a Introduce tevent_req_poll_ntstatus 2009-11-14 11:03:28 +01:00
Volker Lendecke
c254349261 Introduce tevent_req_simple_finish_ntstatus 2009-11-14 11:03:28 +01:00
Kamen Mazdrashki
5b75201dbb util: str_list_unique() bugfix
j is actually the index of the last element in the list
size of the list though is j+1 <- to make room for the
terminating NULL element
2009-11-13 23:19:06 +11:00
Kamen Mazdrashki
b7839b73b1 util: str_list_unique_2() test implementation
Difference with previous test for str_list_unique() is
that this test allows number of elements and number
of duplicates to be supplied on command line using
--option="list_unique:count=47"
--option="list_unique:dups=7"
2009-11-13 23:19:06 +11:00
Andrew Bartlett
fd5174e88c lib/util Split data_blob_hex_string() into upper and lower
Rather than have a repeat of the bugs we found at the plugfest where
hexidecimal strings must be in upper or lower case in particular
places, ensure that each caller chooses which case they want.

This reverts most of the callers back to upper case, as things were
before tridge's patch.  The critical call in the extended DN code is
of course handled in lower case.

Andrew Bartlett
2009-11-12 16:34:01 +11:00
Volker Lendecke
be88a126ea tdb: Fix a C++ warning 2009-11-08 00:28:22 +01:00