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

863 Commits

Author SHA1 Message Date
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
Andrew Bartlett
5a8f21cb88 lib/util Fix comments in rfc1738.c.
The Samba version does not use static buffers

Andrew Bartlett
2009-11-04 14:58:24 +11:00
Stefan Metzmacher
97a32035be tsocket: rewrite tsocket_guide.txt to reflect the current APIs
metze
2009-11-03 18:26:30 +01:00
Stefan Metzmacher
eb39f66940 tsocket_bsd: return -1 and set errno to ENAMETOOLONG if the unix path is too long
metze
2009-11-03 18:24:44 +01:00
Stefan Metzmacher
9b5d1e9e35 tsocket: remove prototype of non-existing tsocket_address_inet_set_broadcast()
metze
2009-11-03 18:14:23 +01:00
Andrew Bartlett
7a290130bd lib/util Use rfc1738.c from Squid for all our URL encode/decode needs.
Andrew Bartlett
2009-11-02 16:36:52 +11:00
Andrew Bartlett
87195f55de lib/util Add rfc1738 escape/unescape code from Squid
This is intended to replace our rfc1738_unescape(), and give us an
rfc1738_escape implementation (and hopefully is better tested and more
secure).

Andrew Bartlett
2009-11-02 16:36:52 +11:00
Kirill Smelkov
83de5c8263 tdb: update README a bit
While studying tdb, I've noticed a couple of mismatches between readme
and actual code:

- tdb_open_ex changed it's log_fn argument to log_ctx
- there is now no tdb_update(), which it seems was transformed into
  non-exported tdb_update_hash()

There were other mismatches, but I don't remember them now, sorry.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-29 10:14:34 +10:30
Kirill Smelkov
71a21393dd tdb: add tests for double .close() in pytdb
The reason I do it is that when using older python-tdb as shipped in
Debian Lenny, python interpreter crashes on this test:

    (gdb) bt
    #0  0xb7f8c424 in __kernel_vsyscall ()
    #1  0xb7df5640 in raise () from /lib/i686/cmov/libc.so.6
    #2  0xb7df7018 in abort () from /lib/i686/cmov/libc.so.6
    #3  0xb7e3234d in __libc_message () from /lib/i686/cmov/libc.so.6
    #4  0xb7e38624 in malloc_printerr () from /lib/i686/cmov/libc.so.6
    #5  0xb7e3a826 in free () from /lib/i686/cmov/libc.so.6
    #6  0xb7b39c84 in tdb_close () from /usr/lib/libtdb.so.1
    #7  0xb7b43e14 in ?? () from /var/lib/python-support/python2.5/_tdb.so
    #8  0x0a038d08 in ?? ()
    #9  0x00000000 in ?? ()

master's pytdb does not (we have a check for self->closed in obj_close()),
but still...

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-29 10:14:33 +10:30
Kirill Smelkov
b4424f8234 tdb: reset tdb->fd to -1 in tdb_close()
So that erroneous double tdb_close() calls do not try to close() same
fd again. This is like SAFE_FREE() but for fd.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-29 10:14:33 +10:30
Kirill Smelkov
cfed5f946d tdb: fix typo in python's Tdb.get() docstring
It's Tdb.get(), not Tdb.fetch().

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-29 10:14:33 +10:30
Kirill Smelkov
ecbe5ebd8d tdb: kill last bits from swig
We no longer use swig for pytdb, so there is no need for swig make
rules. Also pytdb.c header should be updated.

Signed-off-by: Kirill Smelkov <kirr@mns.spb.ru>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-29 10:14:33 +10:30
Andrew Tridgell
d4c0e8fdf0 tdb: detect tdb store of identical records and skip
This can help with ldb where we rewrite the index records
2009-10-25 13:15:18 +11:00
Stefan Metzmacher
3b62e250c0 tdb: rename 'struct list_struct' into 'struct tdb_record'
metze
2009-10-23 18:27:20 +02:00
Andrew Bartlett
44a727479e util:ldb Allow multiple entries to be added in one LDIF snippit 2009-10-23 15:41:25 +11:00
Andrew Tridgell
dfa0b74516 util: fixed place where we could look one byte past end of string
We need to check the length before the value
2009-10-22 12:47:54 +11:00
Rusty Russell
0944931159 lib/tdb: make tdbtool use tdb_check() for "check" command
Also, set logging function so we get more informative messages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:11:34 +10:30
Rusty Russell
022b4d4aa6 lib/tdb: add tdb_check()
ctdb wants a quick way to detect corrupt tdbs; particularly, tdbs with
loops in their hash chains.  tdb_check() provides this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:10:34 +10:30
Rusty Russell
0fc6800005 lib/tdb: add -t (always use transactions) option to tdbtorture
This means you can kill it at any time and expect no corruption.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:10:54 +10:30
Rusty Russell
b77f41d58b lib/tdb: wean off TDB_ERRCODE.
It was a regrettable hack which I used to reduce line count in tdb; in fact it caused confusion as can be seen in this patch.
In particular, ecode now needs to be set before TDB_LOG anyway, and having it exposed in
the header is useless (the struct tdb_context isn't defined, so it's doubly useless).
Also, we should never set errno, as io.c was doing.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:09:43 +10:30
Rusty Russell
703004340c lib/tdb: TDB_TRACE support (for developers)
When TDB_TRACE is defined (in tdb_private.h), verbose tracing of tdb operations is enabled.
This can be replayed using "replay_trace" from http://ccan.ozlabs.org/info/tdb.

The majority of this patch comes from moving internal functions to _<funcname> to
avoid double-tracing.  There should be no additional overhead for the normal (!TDB_TRACE)
case.

Note that the verbose traces compress really well with rzip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-10-22 00:00:12 +10:30
Andrew Tridgell
f49818e422 lib-util: check for too many combinations in generate_unique_strs() 2009-10-20 11:34:49 +11:00
Andrew Tridgell
5dcf0069b6 tdb: fixed the intermittent failure of tdbtorture in the build farm
There was a race condition that caused the torture.tdb to be left in a
state that needed recovery. The torture code thought that any message
from the tdb code was an error, so the "recovered" message, which is a
TDB_DEBUG_TRACE message, marked the run as being an error when it
isn't.
2009-10-20 10:59:40 +11:00
Andrew Tridgell
d680729dfb util: fixed generate_unique_strs() to be portable
'place' was going negative, and giving undefined results. The result
was duplicate names which gave errors in SMB2-DIR on PPC and other
systems.
2009-10-19 22:47:45 +11:00
Kamen Mazdrashki
f11cdc19d1 s4/asn1: Use explicite TALLOC_CTX in ber_write_OID functions 2009-10-16 12:54:13 +03:00
Simo Sorce
6618a062a1 talloc: Fix exports and increment talloc version 2009-10-14 11:05:52 -04:00
Simo Sorce
8fb483b296 talloc: Make abi checks in release script
Make always sure the exports and signature files are up to date before
shipping a release.
2009-10-14 11:05:52 -04:00
Simo Sorce
8e6df560b7 talloc: Move release script under /script too 2009-10-14 11:05:52 -04:00
Simo Sorce
2d6d6bcb5d talloc: Change the way mksysms work
Make sure we always have a sorted (per file) export file.
This way we can directly compare the real export and the check file w/o having
to further sort things.

Also return error code from abi_checks.sh if warnings were reported
2009-10-14 11:05:51 -04:00
Simo Sorce
7bce1ab5e8 Fix builds with external tdb
Make sure we do not reference our internal tdb directly.
Let configure define what tdb.h file to use so that builds that use an
extrenal tdb do not include 2 different versions of the tdb header.
2009-10-11 09:48:53 -04:00
Simo Sorce
99cdbe3571 Fix builds with external talloc
Make sure we do not reference our internal talloc directly.
Let configure define what talloc.h file to use so that builds that use an
extrenal talloc do not include 2 different versions of the talloc header.
2009-10-09 13:14:08 -04:00
Karolin Seeger
fc2604ed26 asn1_tests: Fix typo in comment.
Karolin
2009-10-09 11:27:06 +02:00
Andrew Tridgell
1d0fb1e0fb tdr: teach TDR about uint1632 enums
TDB doesn't have NDR64, but it needs to know how to map the new types
from pidl
2009-10-07 09:56:23 +11:00
Günther Deschner
ab8a16c77f lib/tdr: get rid of build warning when using TDR_ALLOC macro.
Guenther
2009-10-05 11:15:45 +02:00
Jeremy Allison
295fec2b46 NULL is not a valid event context.
Jeremy.
2009-10-01 16:18:33 -07:00
Kamen Mazdrashki
a58bc2c9a9 s4/asn1: ber_read_OID_String() to be based on _ber_read_OID_String_impl() 2009-10-01 23:13:00 +02:00
Kamen Mazdrashki
a96c8c2355 s4/asn1: local TALLOC_CTX should be child of torture_context 2009-10-01 23:13:00 +02:00
Kamen Mazdrashki
a51571bf41 s4/asn1: fixed typo in torture messages 2009-10-01 23:13:00 +02:00
Kamen Mazdrashki
97e7f48f75 s4/asn1: Added test for ber_read_partial_OID_String() 2009-10-01 23:13:00 +02:00
Kamen Mazdrashki
5021301a0e s4/asn1: Added test for ber_read_OID_String() 2009-10-01 23:12:59 +02:00
Kamen Mazdrashki
681064e66e s4/asn1: Added test for ber_write_partial_OID_String() 2009-10-01 23:12:59 +02:00
Kamen Mazdrashki
3c3ef94ab3 s4/asn1: Added test for ber_write_OID_String() 2009-10-01 23:12:59 +02:00
Kamen Mazdrashki
bd5343924f s4/asn1: Added torture suite for ASN1 2009-10-01 23:12:59 +02:00
Kamen Mazdrashki
8330d78b21 util: strhex_to_str() fixed to handle '0x' correctly 2009-10-01 23:12:58 +02:00