1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

684 Commits

Author SHA1 Message Date
Andrew Bartlett
8f1810362d lib/util Use lib/util/ms_fnmatch.c in common for gen_fnmatch()
gen_fnmatch was a duplicate symbol in the top level build.

gen_fnmatch() used for simple non-CIFS pattern matching, so selecting
the lib/util implementation should not be a concern.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
3892112e7b lib/util Rename ms_fnmatch() to ms_fnmatch_protocol() to avoid dup symbol
This verison of the function takes a protcol as argument to determine
matching rules.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Andrew Bartlett
1475013963 lib/util Move source3 tdb_wrap_open() into the common code.
This #if _SAMBA_BUILD == 3 is very unfortunate, as it means that in
the top level build, these options are not available for these
databases.  However, having two different tdb_wrap lists is a worse
fate, so this will do for now.

Andrew Bartlett
2011-05-06 07:51:24 +02:00
Jeremy Allison
4f41be356a Fix many const compiler warnings. 2011-05-05 10:41:59 -07:00
Jeremy Allison
1c714850d5 Clean up some const and other compiler warnings.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu May  5 00:59:40 CEST 2011 on sn-devel-104
2011-05-05 00:59:40 +02:00
Jeremy Allison
ff215f5c89 I added them, so I get to kill them :-). Finally remove all uses of safe_strcpy and safe_strcat. Change to strlcpy, strlcat.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed May  4 22:14:14 CEST 2011 on sn-devel-104
2011-05-04 22:14:14 +02:00
Jeremy Allison
df023b8657 Tidy up some missing checks for NULL in strlcpy. 2011-05-04 12:12:15 -07:00
Jeremy Allison
5fa6f390d1 Remove overmalloc_safe_strcpy - can be simple strlcpy. 2011-05-04 12:12:14 -07:00
Jeremy Allison
0c464df22b Change safe_strcpy_base to strlcpy_base. Note the size doesn't change here as the original macro auto-added the -1. 2011-05-04 12:12:14 -07:00
Jeremy Allison
017e0c8d95 Fix simple uses of safe_strcpy -> strlcpy. Easy ones where we just remove -1. 2011-05-04 12:12:13 -07:00
Andrew Bartlett
92e490ac09 lib/util make string_wrappers.h a public header
This isn't a very good public header, but util.h includes it, so we
don't have much choice in the short term.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue May  3 08:37:22 CEST 2011 on sn-devel-104
2011-05-03 08:37:22 +02:00
Andrew Bartlett
2c32534d5b lib/util Use lib/util/util_str.c in common, including strequal()
strequal() is now implemented in terms of strcasecmp_m() which is
tested in smbtorture and which does not talloc() for ASCII or
non-ASCII comparions, and has an ASCII fast-path.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
86a62ab434 lib/util Use compiler-checked safe string macros in top level code.
This brings the 'safe' macros to the top level code, and removes
duplication of the safe_strcpy() and safe_strcat() functions.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
d01f318179 s4: fix arguments to safe_strcpy()
Found by the s3-derivied safe_strcpy() macro.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
80f1d49b61 lib/util/charset Use push_string and talloc_strupper/strlower from common code
The only caller of push_string() (not to be confused with
push_string_check()) in the common code was encode_pw_buffer(), and it
didn't use the alignment or STR_UPPER flags.

The talloc_strupper() and talloc_strlower() functions are tested in
smbtorture, and are next_codepoint() based.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
2742ec0e34 Remove strlower_m() and strupper_m() from source4 and common code.
This function is problematic because a string may expand in size when
changed into upper or lower case.  This will then push characters off
the end of the string in the s3 implementation, or panic in the former
s4 implementation.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
eea783e04c lib/util Move set_socket_options() into common code. 2011-05-03 07:37:07 +02:00
Andrew Bartlett
fbea52f74a lib/util Move more network utility functions from source3 into lib/util
This will help with the merge of the interfaces layer.

Andrew Bartlett
2011-05-03 07:37:07 +02:00
Andrew Bartlett
bcd68837ee lib/util Rename conv_str_size() -> conv_str_size_error() 2011-04-30 10:38:25 +02:00
Andrew Bartlett
93ace5cc24 lib/util Re-merge the string_sub() and all_string_sub() from source3
Andrew Bartlett
2011-04-29 16:38:15 +10:00
Andrew Bartlett
9a9124b087 lib/util/charset Move strstr_m() to the top level 2011-04-29 16:38:14 +10:00
Andrew Bartlett
0df4061cff lib/util/charset Merge talloc-based pull and push charset functions
These were copied from source3/lib/charcnv.c

Andrew Bartlett
2011-04-28 05:30:20 +02:00
Andrew Bartlett
790ab3e0db lib/util/charset Add copyright headers
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 28 04:13:44 CEST 2011 on sn-devel-104
2011-04-28 04:13:44 +02:00
Andrew Tridgell
d17f4352fe lib/util/charset Make fast path from UTF16 to '8 bit' charsets clearer
This breaks the fast path into handling for -1 and handling for
specified lenghts, avoding branch operations on each character.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28 03:24:06 +02:00
Andrew Bartlett
eee1ff2fb5 lib/util/charset Add tests for srclen=-1 behaviour.
This confirms that we do include a null terminator in all non-failed
conversions.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28 03:24:05 +02:00
Andrew Bartlett
4081ea5b49 lib/util/charset use convert_string.c in common
This brings another layer of the charcnv library in common.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28 03:24:05 +02:00
Andrew Bartlett
75d5ba4109 lib/util/charset Fix string termination conditions for UTF16 strings
This punts partial UTF16 strings to iconv() to deal with, as it's not
a fast path any longer if it's got an odd length.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-28 03:24:05 +02:00
Andrew Bartlett
3e85b960fa dynconfig: Have only one dynconfig.o in the common code. 2011-04-27 22:22:26 +10:00
Andrew Bartlett
26a0ba7ee9 lib/util Define samba-util-common only for s3-waf
It causes too much trouble in the top level build.

Andrew Bartlett
2011-04-26 11:37:46 +10:00
Stefan Metzmacher
c0441b17e6 lib/util: add RBVAL, RBVALS, RSBVAL and RSRBVALS macros
They pull and push [u]int64_t values in big endian.

metze
2011-04-24 09:48:51 +02:00
Jelmer Vernooij
0645c01b85 Fix case of libUTIL_LDB.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Apr 23 18:52:06 CEST 2011 on sn-devel-104
2011-04-23 18:52:06 +02:00
Volker Lendecke
4981adcca3 asn1: Fix Coverity ID 2299, CHECKED_RETURN 2011-04-22 10:06:36 +02:00
Andrew Bartlett
6f846ddf32 lib/util/charset Always set *converted_size even on failure
The caller may wish to inspect the partially converted string.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 20 05:17:48 CEST 2011 on sn-devel-104
2011-04-20 05:17:48 +02:00
Andrew Bartlett
79e6fea774 lib/util/charset create _handle functions for convert_string() et al
This is now API compatible with the existing code in lib/util/charset

lazy_initialize_conv() is no longer called as init_iconv() is called
when the smb.conf is processed, and get_conv_handle() will auto-init
with defaults if required.

load_case_tables_library() is no longer requried as all binaries and
libraries already load these in their entry points, as otherwise all
the other string functions would fail.

Andrew Bartlett
2011-04-20 04:31:07 +02:00
Brad Hards
2c55a995fe util: Build samba-util without unresolved symbols.
This is useful for the Samba4 case where external users otherwise need to link to
(private) libsamba-util-common.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Apr 16 12:29:33 CEST 2011 on sn-devel-104
2011-04-16 12:29:33 +02:00
Andrew Bartlett
e1078b87de lib/util Move alpha_strcpy() from s3 into common code
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Apr 14 09:21:59 CEST 2011 on sn-devel-104
2011-04-14 09:21:59 +02:00
Günther Deschner
b4e4b60719 s3-includes: include lib/util/debug.h headers in includes.h not smb.h
Guenther
2011-04-14 00:47:57 +02:00
Volker Lendecke
4be643d4ce lib: Move next_token next to next_token_talloc
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-04-13 14:13:25 -07:00
Andrew Bartlett
53e0bada43 build: Bring DYNCONFIG into samba-util library to avoid symbol duplication
When this was depended on directly as a subsystem, it ended up in
multiple libraries.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 13 08:39:35 CEST 2011 on sn-devel-104
2011-04-13 08:39:35 +02:00
Andrew Bartlett
4158e9a7e5 s3-charcnv: Move convert_string() et al to lib/util/charset
This is the first step to this being the common convert_string
implementation.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
d335b635c2 lib/util/charset Add many more charset tests
This confirms that the behaviour of the convert_string() API (with the
process-wide iconv handle).

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
748c31dc5d lib/util/charset Add convert_string_error()
This adds an interface that matches the source3/ convert string code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
8db1648f66 lib/util/charset Make ASCII conversion validate it's input
We should not just strip the high bits off unicode strings being
converted to ASCII, we need to actually fail the conversion.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
a2c691ab9a lib/util/charset Rename convert_string test to allow a 'non_handle' test
A future commit will test (with a subset of tests) the varient of this
function without _handle.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
7bbd701a13 lib/util/charset Add more tests for convert_string_error_handle()
This helps define the semantics of this function very clearly,
particularly for partial and invalid inputs.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
93463829af lib/util/charset Preserve 'pull' errors even when converting via UTF16
When we do not have a direct iconv handle between any two charsets, we
must go iva UTF16.  However, we should still return the same buffer
and error code as if we were able to go direct - including the partial
conversion and the error code.

This is important for locating the invalid multibyte character in the
stream, for example.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
1efa600144 lib/util/charset Add tests for convert_string_error_handle
These confirm that the errno is set correctly and that we stop on a
partial multibyte character

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:08 +10:00
Andrew Bartlett
b21129ae20 lib/util/charset Add expected values for upper/lower case tests
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
cd63c9205e lib/util/charset Fix and add public interface for convert_string_error_handle
It makes much more sense for this to match the source3/ interface and
return a bool.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
17ccff973a lib/util: Make string_replace from s3 common
The s4 implementation didn't do multibyte strings, so was only good
for '/' which is known to be safe in all multibyte charsets.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
b2e37d9ce1 lib/util ucs2_align is identical, put it in common
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
2eea91957c lib/util Move simple string routines into common code.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
9941dfe9f6 lib/util/charset Move source3/lib/util_unistr.c to the common code.
This file (largely) contains functions to deal with UTF16 strings.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-04-13 14:47:07 +10:00
Andrew Bartlett
fe458f23ad lib/util make UTIL_TDB a library 2011-04-13 11:47:36 +10:00
Andrew Tridgell
a8da13cd5c lib: make asn1_util a private library
this prevents symbol duplication of the asn1 symbols in the service
and ntvfs subsystems

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Andrew Tridgell
15576da63a lib: moved data_blob.c into samba-util-common
this avoids a duplication of the data_blob symbols some binaries
(eg. smbtorture)

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-06 08:12:19 +02:00
Andrew Tridgell
4a98d6ce96 debug: default debug to stderr
if setup_logging() hasn't been called then default to sending debug to
stderr

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-04-04 10:30:29 +10:00
Volker Lendecke
644222a1e3 debug: Restore the s3-style check in check_log_size()
This has caused me considerable grief.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar 31 19:42:38 CEST 2011 on sn-devel-104
2011-03-31 19:42:38 +02:00
Andrew Bartlett
620921b36b lib/util/charset Add tests for strcasecmp_m(), talloc_strupper() et al
This adds tests for:
 strncasecmp_m
 strcasecmp_m
 strupper_talloc_n
 strlower_talloc
 strhaslower
 strhasupper

The tests can certainly be improved with pre-calculated upper and
lower case text, but this at least puts them though their paces.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Mar 31 14:24:22 CEST 2011 on sn-devel-104
2011-03-31 14:24:22 +02:00
Volker Lendecke
466da70d77 charconv: Use talloc_tos() in the S3 build
In S3 we put a talloc_pool on top of the stack so that an allocation from
talloc_tos() normally is just a pointer increment.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Mar 31 09:14:01 CEST 2011 on sn-devel-104
2011-03-31 09:14:01 +02:00
Jeremy Allison
7cd5a79cd4 Arg. I hate the "if (xxx) return foo" all on one line style of code.
Fix the talloc leaks I introduced by not spotting these returns.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 31 05:19:34 CEST 2011 on sn-devel-104
2011-03-31 05:19:33 +02:00
Jeremy Allison
21193c8eeb Don't burn 2k of stack on every iconv, use the heap when it's a slow call.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 31 04:09:09 CEST 2011 on sn-devel-104
2011-03-31 04:09:09 +02:00
Andrew Bartlett
b3ffcf888c lib/util/charset smb_panic() on incorrect use of strlen_m_ext
This may save a developer some time in the future.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Mar 31 02:40:31 CEST 2011 on sn-devel-104
2011-03-31 02:40:31 +02:00
Andrew Bartlett
7fe9bb8c84 lib/util/charset Add tests for strlen_m_ext() and convert_string_talloc()
This convers a few more cases for convert_string_talloc() and
introduces tests for strlen_m_ext() across complex multibyte strings.

Andrew Bartlett
2011-03-31 10:53:24 +11:00
Andrew Bartlett
d4f3a380e4 lib/util/charset Add wrapper to allow testing of strlen_m_ext()
This allows test routines to force in particular character sets, and
not rely on the smb.conf.

Andrew Bartlett
2011-03-31 10:53:24 +11:00
Andrew Bartlett
46db53b159 lib/util/charset correct calculation of UTF8 character sizes
Characters between 0x800 0x0FFFF are 3 bytes long.

Andrew Bartlett
2011-03-31 10:52:42 +11:00
Jeremy Allison
c109a70531 Fix convert_string() to take a *converted_size arg. and return a bool.
Makes these interfaces much harder to misuse and easier to ensure error
checking.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Wed Mar 30 23:59:37 CEST 2011 on sn-devel-104
2011-03-30 23:59:37 +02:00
Andrew Bartlett
43e364e61b lib/util/charset Add tests for convert_string_talloc_handle()
Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 30 13:02:47 CEST 2011 on sn-devel-104
2011-03-30 13:02:47 +02:00
Andrew Bartlett
a64958a880 lib/util Move base64 functions into lib/util/base64.c
Andrew Bartlett
2011-03-30 12:17:05 +02:00
Andrew Bartlett
c395209791 lib/util/charset Remove pointless static bool initialised 2011-03-30 12:17:05 +02:00
Günther Deschner
b2af281e50 s3-messages: only include messages.h where needed.
Guenther
2011-03-30 01:13:09 +02:00
Günther Deschner
96487959e9 lib/util/util_pw: share more code between lib/util/util_pw.c and source3/lib/username.c
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
64421129b6 lib/util/util_pw: share sys_get{pw,gr} group of calls.
Guenther
2011-03-30 01:13:06 +02:00
Günther Deschner
f4868ab646 lib/util/util_pw: temporary rename of getpwnam_alloc and getpwuid_alloc.
Guenther
2011-03-30 01:13:06 +02:00
Andrew Tridgell
af31bf6bf5 debug: ignore debug_set_logfile() with a blank string
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Mar 29 07:03:58 CEST 2011 on sn-devel-104
2011-03-29 07:03:58 +02:00
Andrew Tridgell
8d2d0ef0eb lib: removed a spurios declaration of 'logfile'
we don't have a global logfile variable any more

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-29 06:17:03 +02:00
Andrew Tridgell
f0922147fe charcnv: ensure convert_string_error doesn't conflict with s3 function
use _handle for handle based functions

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Mar 25 05:22:24 CET 2011 on sn-devel-104
2011-03-25 05:22:24 +01:00
Andrew Bartlett
b5616adc8a lib/util/charset rename iconv_convenience to iconv_handle
This better reflects what this structure is

Andrew Bartlett
2011-03-25 04:37:06 +01:00
Andrew Tridgell
2643a7ba6b charcnv: added convert_string_error()
this will allow us to remove conv_silent

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
aaae4123b9 unistr: moved some UCS2 macros into util_unistr
we need to move towards eliminating smb_ucs2_t. This moves a couple of
the related macros into the only file they are used in

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
5a20325c86 libcli: created smb_constants.h
this starts the (long!) process of moving some of the SMB constants
into common files. This just moves the FLAGS2_ defines, which are
needed for common string routines (for FLAGS2_UNICODE_STRINGS)
2011-03-25 04:37:06 +01:00
Andrew Tridgell
980064b76d lib: remove unused pieces of string_wrappers.h 2011-03-25 04:37:06 +01:00
Andrew Tridgell
8cd4a38d72 lib: move the string wrappers from source3/include to common lib/util
this will allow the common charcnv library to use the string wrappers

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-03-25 04:37:06 +01:00
Andrew Tridgell
15e84a9a09 charcnv: removed the allow_badcharcnv and allow_bad_conv options to convert_string*()
we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104
2011-03-24 01:47:26 +01:00
Andrew Tridgell
451856698f charset: remove another allow_badcharcnv check
better to fail only if there is a bad character
2011-03-24 01:01:04 +01:00
Andrew Bartlett
41051fd3d3 lib/util: Merge basic string length and comparison functions
These functions now use the codepoints for more accurate string
handling and now form common code.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Mar 23 08:21:54 CET 2011 on sn-devel-104
2011-03-23 08:21:54 +01:00
Andrew Tridgell
cd4306b01e charcnv: remove the automatic fail on allow_badcharcnv true
we should just fail the call if the string really is bad
2011-03-23 12:19:29 +11:00
Andrew Tridgell
6e8b6358ec fault: fixed smb_panic() prototypes
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Mar 23 01:51:44 CET 2011 on sn-devel-104
2011-03-23 01:51:44 +01:00
Andrew Tridgell
a65ba83ae6 fault: moved fault.c into common library 2011-03-23 11:03:58 +11:00
Andrew Tridgell
1ac079e3f6 fault: switch s4 to use the common fault.c 2011-03-23 11:03:57 +11:00
Andrew Tridgell
580997ede0 fault: get fault.c ready for use by s4
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c,
and uses a function pointer to setup which smb_panic call to use
2011-03-23 11:03:57 +11:00
Andrew Tridgell
058c3bb923 fault: moved s3 fault.c to top level 2011-03-23 11:03:57 +11:00
Andrew Tridgell
cb2cc34eff fault: rename fault.c to fault_s4.c
this is in preparation for merging the s3 fault code into common
2011-03-23 11:03:57 +11:00
Jelmer Vernooij
df0b7f1c34 lib/: Fix prototypes for functions. 2011-03-19 03:20:05 +01:00
Simo Sorce
5d55ae0a29 lib-util: put data_blob back in the public library
data_blob is defined ina public header, so it needs to be exposed in the public
library.

Autobuild-User: Simo Sorce <idra@samba.org>
Autobuild-Date: Thu Mar 17 15:39:08 CET 2011 on sn-devel-104
2011-03-17 15:39:08 +01:00
Andrew Tridgell
5ca9db07f5 lib: fixed header paths
this is a public header, and needs to use sane paths for the public
header creation
2011-03-15 12:22:19 +11:00
Andrew Tridgell
7293c370d3 talloc: use <talloc.h> not "talloc.h"
this ensures we use the right header
2011-03-15 12:22:19 +11:00
Matthias Dieter Wallnöfer
f5ce61ea57 lib/util/fault.c - "call_backtrace" - no need to have "backtrace_size" as size_t
The function "backtrace" returns an "int".
2011-03-10 11:12:05 +01:00
Andrew Tridgell
3560db3da3 debug: fixed a valgrind error
Thanks to Volker for spotting this one!

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Mar  4 03:09:52 CET 2011 on sn-devel-104
2011-03-04 03:09:52 +01:00
Günther Deschner
875d9b8098 lib/util: LIBCRYPTO is in common already, so add it to samba-util-common.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Mar  3 18:08:30 CET 2011 on sn-devel-104
2011-03-03 18:08:30 +01:00
Andrew Bartlett
5f5ca913b7 lib/util: new merged debug system
This is the s3 debug system, with a number of changes to tidy it up
for common use.  The debug class system is simplified by the removal of the
ISSET table, the system no longer attempts to cope with assignment of
DEBUGLEVEL, and the full class table is always available (rather than
just DEBUGLEVEL_CLASS[DBCG_ALL]) from startup.  It is also no longer
confusingly described as a hack, but as the initial table.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Mar  1 04:32:12 CET 2011 on sn-devel-104
2011-03-01 04:32:12 +01:00
Andrew Bartlett
4acef317a0 lib/util move debug.[ch] out of the way
This will allow a modified version of the s3 debug system to be the
new common debug system.

Andrew Bartlett
2011-03-01 03:46:18 +01:00
Andrew Bartlett
608c8e7872 lib/util/time: Merge time functions from source3/lib/time.c 2011-03-01 02:13:22 +01:00
Jelmer Vernooij
31d09b13d3 tdb: Use <tdb.h> to include tdb so system headers are found when building against system tdb. 2011-02-28 21:11:21 +01:00
Jelmer Vernooij
21d926f0ef Use <tevent.h> so the system tevent gets included, if enabled. 2011-02-28 21:11:21 +01:00
Volker Lendecke
d163f5d67c Remove sys_select[_intr] 2011-02-28 16:40:20 +01:00
Volker Lendecke
83becbe369 s3: Add sys_poll_intr 2011-02-28 16:40:19 +01:00
Volker Lendecke
be33e2e0a7 s3: Add sys_poll 2011-02-28 16:40:19 +01:00
Volker Lendecke
fec0baacb6 s3: Make is_zero_addr take a sockaddr_storage
All callers had to cast this anyway

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Feb 27 11:02:53 CET 2011 on sn-devel-104
2011-02-27 11:02:53 +01:00
Günther Deschner
110f11d136 lib/util/charset: ICONV_WRAPPER needs talloc.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Feb 23 12:46:33 CET 2011 on sn-devel-104
2011-02-23 12:46:33 +01:00
Andrew Tridgell
3c12c4c1a4 build: move idtree.c into samba-util-common 2011-02-23 00:45:21 +01:00
Andrew Tridgell
9174d73173 build: moved more files into samba-util-common
this removes UTIL_SRC from the s3 waf build, as it is now all in
common with samba-util-common
2011-02-23 00:45:21 +01:00
Andrew Tridgell
457025eee7 build: created samba-util-common library
this library will contain files that can be built in common between s3
and s4. Both samba-util and samba-util3 depend on it.

Currently this library needs to be marked as allow_undefined_symbols,
in order to allow s4 to build it. We can remove that flag once we have
all the needed symbols in common

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-23 00:45:21 +01:00
Stefan Metzmacher
d7fa349052 s3:auth: change num_groups to from size_t to uint32_t
This will help with the change from UNIX_USER_TOKEN to security_unix_token

metze
2011-02-22 16:20:11 +11:00
Jelmer Vernooij
82fa772fa2 Fix missing dependency on libreplace.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Feb 21 01:17:33 CET 2011 on sn-devel-104
2011-02-21 01:17:33 +01:00
Andrew Bartlett
1ad8e5229f lib/util/charset Add back setlocale(), but only when called from binaries
When called from a library, we don't want to call this, as we may
overwrite some of our calling program's context.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Feb 18 09:29:35 CET 2011 on sn-devel-104
2011-02-18 09:29:35 +01:00
Andrew Bartlett
2a3a86a86f lib/util/charcnv Move iconv handle setup in common
We now use the struct smb_iconv_convenience at the core of all our
iconv code, and use global_iconv_convenience for the callers that
don't specify one.

Andrew Bartlett
2011-02-18 18:41:01 +11:00
Andrew Bartlett
e4c2023082 lib/util Remove #if _SAMBA_BUILD_ == 4 that isn't required any more 2011-02-18 18:41:00 +11:00
Andrew Bartlett
8afc271e2a lib/util/charset Use top level iconv.c in source3
The two files were very similar already, the only change required was
to adopt the s3 module registration fucntion name.

(NTSTATUS wasn't used as the charset code does not otherwise use that
type).

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-02-18 18:41:00 +11:00
Andrew Bartlett
92faeaeea8 charset Remove use of {isupper,islower,toupper,tolower}_w functions
These now call the common _m functions that consider UTF16 code points.

This removes the code which will make up a 'lame' table in memory, as
this can just as correctly be handled by running the algorithm at runtime (which is to call toupper() and tolower() on characters < 128).

When used, a top level waf build will always locate the correct table
- in the build tree or outside - due to relinking the installed
binary.

Andrew Bartlett
2011-02-18 17:00:34 +11:00
Andrew Bartlett
83a63baecc lib/util Make UTIL_LDB conditional on an s4 build
This allows this file to be used in common.
2011-02-18 16:46:42 +11:00
Andrew Tridgell
40a48f5502 s4-util: removed the valgrind_strlen() routine
this was for a bug in valgrind from 7 years ago.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 15:09:47 +11:00
Andrew Tridgell
324270ee57 libutil: make waf rules usable by s3 waf build
we need samba-util to be s4 only for now, because of the debug system
differences

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 15:09:47 +11:00
Andrew Tridgell
fd000928e3 charset: allow s3 waf build to use lib/util/charset
the only conflict is with 'CHARSET' itself, which now builds
conditionally on _SAMBA_BUILD_==4

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-18 15:09:47 +11:00
Andrew Bartlett
13f287fbc2 lib/util/charset use get_dyn_CODEPAGEDIR(), which is in common
This is provided by the s3 and s4 dynconfig implementations.

Andrew Bartlett
2011-02-18 15:09:47 +11:00
Andrew Bartlett
a47120ae93 lib/util/charset split codepoints.c into it's own subsystem 2011-02-18 15:09:47 +11:00
Andrew Bartlett
d8d81a7786 lib/util/charset use a path to dynconfig.h that works in s3 and s4 2011-02-18 15:09:47 +11:00
Andrew Bartlett
0581a5bb3c lib/util/charset add functions isupper_m and islower_m 2011-02-18 15:09:46 +11:00
Günther Deschner
3eb7e125ab waf: pure cosmetic reformatting of the two samba-util object lists (to ease comparing).
Guenther
2011-02-11 14:14:23 +01:00
Andrew Tridgell
8dc92c8f71 ldb: use #include <ldb.h> for ldb
thi ensures we are using the header corresponding to the version of
ldb we're linking against. Otherwise we could use the system ldb for
link and the in-tree one for include

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-10 06:51:07 +01:00
Andrew Tridgell
1867a6033c s4-charset: use dyn_CODEPAGEDIR for location of upcase.dat/lowcase.dat
this matches samba3 behaviour

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-02-07 13:22:02 +11:00
Andrew Tridgell
13470f11ee charcnv: removed call to setlocale() (bug 7519)
We don't need this setlocale() call, and it can break applications
that use our libraries

Thanks to Milan Crha for pointing this out

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Feb  4 06:51:01 CET 2011 on sn-devel-104
2011-02-04 06:51:01 +01:00
Stefan Metzmacher
c9e6bf047d lib/util: add tests for anonymous_shared_allocate/free()
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jan 20 06:25:03 CET 2011 on sn-devel-104
2011-01-20 06:25:03 +01:00
Stefan Metzmacher
cc59f347ee lib/util: add anonymous_shared_free()
metze
2011-01-20 05:31:45 +01:00
Stefan Metzmacher
34ea909636 lib/util: s/allocate_anonymous_shared/anonymous_shared_allocate/
metze
2011-01-20 05:31:45 +01:00
Stefan Metzmacher
9e00d2a9a4 lib/util: fix rounding to page size in allocate_anonymous_shared()
metze
2011-01-20 05:31:43 +01:00
Matthias Dieter Wallnöfer
07bcf6197d lib/util/time.c - make the "strftime" output locale independant ("%c" is not)
So that it also works on Solaris.
2010-12-22 12:21:16 +01:00
Andrew Tridgell
da5c328b4b s4-dns: disable segfault handling in dlz_bind9
we don't want bind9 calling the Samba segv handler
2010-12-21 11:18:19 +01:00
Matthias Dieter Wallnöfer
3b591caed0 lib/util/asn1.c - remove the "const" specifier from OID
There is no reason to have it "const" since it's an allocated thing.
2010-12-21 15:10:37 +11:00
Volker Lendecke
49dc973586 lib: Protect against tevent nterror mismatches
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Dec 20 00:12:02 CET 2010 on sn-devel-104
2010-12-20 00:12:02 +01:00
Michael Adam
b3d4b20525 util_net: fix a comment typo in interpret_string_addr_internal()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2010-12-17 15:59:43 +01:00
Matthieu Patou
77c1747f21 build: fix bad syntax
Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Tue Dec 14 20:55:17 CET 2010 on sn-devel-104
2010-12-14 20:55:17 +01:00
Jelmer Vernooij
35fbc7bbda s4-smbtorture: Make test names lowercase and dot-separated.
This is consistent with the test names used by selftest, should
make the names less confusing and easier to integrate with other tools.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2010-12-11 04:16:13 +01:00
Matthieu Patou
672c48b763 build: finishing fixing broken libiconv on hpux 2010-12-10 02:07:18 +03:00
Matthieu Patou
c4e795c6bf build: Cope with broken libiconv
library iconv needs mbrtowc but some system didn't provide it (ie.
HP-UX 11.0)

Autobuild-User: Matthieu Patou <mat@samba.org>
Autobuild-Date: Wed Dec  8 23:19:19 CET 2010 on sn-devel-104
2010-12-08 23:19:19 +01:00
Andrew Tridgell
735c1cd2da s4-pkgconfig: add @LIB_RPATH@ to our link flags
this is only set when rpath is used on install. It ensures that
applications that link against Samba libraries get the rpath right

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Dec  8 12:46:00 CET 2010 on sn-devel-104
2010-12-08 12:46:00 +01:00
Matthias Dieter Wallnöfer
bd3e5804a4 Revert "lib/util:tests/time.c - "test_timestring" - fix it on Solaris"
This reverts commit 654e0102dd.
This should better be handled by the replace library.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Dec  6 12:17:31 CET 2010 on sn-devel-104
2010-12-06 12:17:31 +01:00
Matthias Dieter Wallnöfer
619a49c421 lib/util/fault.c - fix "pid_t" printf warning on Solaris
According to "http://www.ibm.com/developerworks/linux/library/l-solar/"
it's generally a 32bit "int" - therefore this cast should fit.
2010-12-06 11:28:59 +01:00
Rusty Russell
521e96ca75 idtree: fix overflow for v. large ids on allocation and removal
Chris Cowan tracked down a SEGV in sub_alloc: idp->level can actually
be equal to 7 (MAX_LEVEL) there, as it can be in sub_remove.

(We unfairly blamed a shift of a signed var for this crash in commit
 2db1987f5a).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Mon Dec  6 05:02:22 CET 2010 on sn-devel-104
2010-12-06 05:02:22 +01:00
Matthias Dieter Wallnöfer
654e0102dd lib/util:tests/time.c - "test_timestring" - fix it on Solaris
Solaris returns "Thu Jan 01" and not "Thu Jan  1" - therefore proof for
both.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Dec  5 23:09:13 CET 2010 on sn-devel-104
2010-12-05 23:09:13 +01:00
Holger Hetterich
b8282a29f9 Fix bug #3185 - testparm exits 0 if it can read the config file regardless of errors
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Dec  4 02:30:00 CET 2010 on sn-devel-104
2010-12-04 02:30:00 +01:00
Andrew Bartlett
58920aab02 lib/debug Add clarifying comments 2010-11-24 08:37:04 +01:00
Matthias Dieter Wallnöfer
e8bae4c40a waf:lib/util - add missing dependency on talloc
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sat Nov 20 23:35:48 CET 2010 on sn-devel-104
2010-11-20 23:35:48 +01:00
Andrew Bartlett
f20cf61080 Add attribute macros for Heimdal to use
Heimdal uses HEIMDAL_NORETURN_ATTRIBUTE and HEIMDAL_PRINTF_ATTRIBUTE,
and we need to provide a link between these and Samba's function
attribute handling.

Andrew Bartlett
2010-11-15 01:25:06 +00:00
Jelmer Vernooij
7e8ea2ca34 unix_privs: Add missing dependency on libreplace. 2010-11-12 17:42:13 +00:00
Andrew Tridgell
cb9fba1ed3 debug: fixed default debug settings
this fixes -d in our command line tools (eg. samba-tool)

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Thu Nov  4 01:48:15 UTC 2010 on sn-devel-104
2010-11-04 01:48:15 +00:00
Michael Adam
50bdd93136 lib/util/charset/charconv: clarify comments in next_codepoint_convenience_ext()
Give the unicod U+<hexnumber> notation of the codepoints
referred to in the comments. Also reformat the comments some.
2010-11-03 22:45:20 +00:00
Michael Adam
c18b67235c lib/util/charset/util_unistr: clarify the comment header for strlen_m(). 2010-11-03 22:45:20 +00:00
Michael Adam
9b86df8ce8 lib/util/charset/util_unistr: add strlen_m_ext_term() - variant of strlen_m_ext() counting terminator 2010-11-03 22:45:20 +00:00
Michael Adam
82c8b31ebc lib/util/charset/util_unistr: add strlen_m_ext that takes input and output charset
The function calculates the number of units (8 or 16-bit, depending
on the destination charset), that would be needed to convert the
input string which is expected to be in in src_charset encoding
to the dst_charset (which should be a unicode charset).
2010-11-03 22:45:20 +00:00
Michael Adam
72f8336865 lib/charcnv/util_unistr: add next_codepoint_ext() that accepts input charset.
next_codepoint() takes as string in CH_UNIX encoding and returns the
unicode codepoint of the next (possibly multibyte) character of the
input string.

The new next_codepoint_ext() function adds the encoding of the input
string as a parameter. next_codepoint() now only calls next_codepoint_ext()
with CH_UNIX als src_charset argument.
2010-11-03 22:45:20 +00:00
Michael Adam
7a2b03964c lib/charset/charcnv: rename a parameter of next_codepoint_convenience_ext() for clarity 2010-11-03 22:45:20 +00:00
Michael Adam
5829cb0a98 lib/charset/charcnv: add next_codepoint_convenience_ext() that accepts input charset.
next_codepoint_convenience() takes as string in CH_UNIX encoding and returns the
unicode codepoint of the next (possibly multibyte) character of the
input string.

The new next_codepoint_convenience_ext() function adds the encoding of the input
string as a parameter. next_codepoint_convenience() now only calls
next_codepoint_convenience_ext() with CH_UNIX als src_charset argument.
2010-11-03 22:45:19 +00:00
Michael Adam
f14d84e2f2 util/charset: remove a duplicate comment.
This seems to have been copied twice from source3/ code.
2010-11-03 22:45:19 +00:00
Andrew Bartlett
db2a61ab26 debug Explain the behaviour of setup_logging() more clearly 2010-11-02 04:36:04 +00:00
Andrew Bartlett
4ae27891f8 lib/debug Use vdprintf rather than manually allocate
This allows the system to use whatever buffers it wants for the string
rather than assuming we need to malloc() it.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Nov  2 00:18:43 UTC 2010 on sn-devel-104
2010-11-02 00:18:43 +00:00
Andrew Bartlett
e7eac0e391 lib/util Remove setup_logging_stdout()
This API is no longer required now that we don't attempt to build ndrdump
with the s3 build system, and because the s3 debug system will soon have the
same setup_logging() API.

Andrew Bartlett
2010-11-01 23:34:06 +00:00
Matthieu Patou
9f0fb0261e build: check that if we provide -liconv we can build shared libs
On Solaris with sun studio compiling an executable with -liconv even if
there is no libiconv.so or libiconv.a will work but not for a shared
lib.

This problem leads to build problem as the linker won't be able to find
libiconv when building shared lib as liconv is wrongly specified
2010-10-31 18:51:54 +03:00
Jelmer Vernooij
3deece5591 s4: Remove the old perl/m4/make/mk-based build system.
The new waf-based build system now has all the same functionality, and
the old build system has been broken for quite some time.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-31 02:01:44 +00:00
Stefan Metzmacher
5bb7723803 lib/util: remove useless ../lib/util/mutex.*
Only the disabled process_thread.c registers uses the register fn,
all other functions are not used anywhere.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue Oct 26 23:29:46 UTC 2010 on sn-devel-104
2010-10-26 23:29:46 +00:00
Jelmer Vernooij
8cf61377aa waf: Remove lib prefix from libraries manually. 2010-10-26 10:17:17 -07:00
Matthias Dieter Wallnöfer
fd7943bc80 ldb:gendb_* calls: support a "NULL" resultset parameter
This is useful for "samdb_search_count" where only the amount of entries
matters.
2010-10-25 18:58:20 +02:00
Volker Lendecke
0831807782 Add dump_data_cb() 2010-10-24 20:46:28 +00:00
Volker Lendecke
611bcfcb49 Add print_asc_cb() 2010-10-24 20:46:28 +00:00
Jelmer Vernooij
833480d3ad s4: Rename LIBSAMBA-* to libsamba-* 2010-10-24 00:20:04 +00:00
Jelmer Vernooij
9757a0c54c s4: Rename UID_WRAPPER to uid_wrapper.
Only link to uid_wrapper when it is enabled.
2010-10-23 22:24:06 +00:00
Jelmer Vernooij
7b8549348a s4: Rename WRAP_XATTR to wrap_xattr. 2010-10-23 22:24:06 +00:00
Kai Blin
c320c1ab98 lib/util: Add tevent WERROR wrappers
Signed-off-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Sat Oct 23 07:35:28 UTC 2010 on sn-devel-104
2010-10-23 07:35:28 +00:00
Kamen Mazdrashki
14cb61da8f asn1_tests: Implement negative unit-tests for ber_write_OID_String() 2010-10-22 01:48:58 +03:00
Kamen Mazdrashki
6b63ad6ff1 asn1: ber_write_OID_String() to be more picky about supplied OID
Now function will check for invalid OID handling cases where:
 - sub-identifier has invalid characters (non-digit)
 - 'dot' separator found on unexpected place. For instance
    '.' at start or end of the OID. Two '.' in a row.
2010-10-22 01:48:58 +03:00
Andrew Tridgell
1cbb6150a1 lib: make WRAP_XATTR a private library
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:26 +11:00
Andrew Tridgell
3981399957 s4-waf: removed the XATTR and SASL aliases
these were hangovers from the old build system names

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2010-10-21 19:03:25 +11:00
Matthias Dieter Wallnöfer
4a33071e83 s4:lib/util/charset/iconv.c - remove a distinction which can never happen
"ret->cd_direct" is never set before. It is set in the "if" upperwards but
then the function is terminated with "return".
2010-10-21 08:28:50 +02:00
Volker Lendecke
62bea12c5d s3: Don't use talloc_autofree_context in map_file 2010-10-20 18:09:19 +02:00
Kamen Mazdrashki
099b0057be asn1_tests.c: Make test data static const 2010-10-20 13:12:17 +00:00
Kamen Mazdrashki
d057ca3e3f lib/util/asn1.c: comment spelling 2010-10-20 13:12:17 +00:00
Matthias Dieter Wallnöfer
a3f61dea40 Revert "s4:remove "util_ldb" submodule and integrate the three gendb_* calls in "dsdb/common/util.c""
This reverts commit 8a2ce5c47c.

Jelmer pointed out that these are also in use by other LDB databases - not only
SAMDB ones.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Oct 17 13:37:16 UTC 2010 on sn-devel-104
2010-10-17 13:37:16 +00:00
Matthias Dieter Wallnöfer
8a2ce5c47c s4:remove "util_ldb" submodule and integrate the three gendb_* calls in "dsdb/common/util.c"
They're only in use by SAMDB code.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Sun Oct 17 09:40:13 UTC 2010 on sn-devel-104
2010-10-17 09:40:13 +00:00
Matthias Dieter Wallnöfer
39bd4ce920 s4:lib/util/util_ldb.c - remove unused "gendb_add_ldif" call 2010-10-17 10:29:46 +02:00
Matthias Dieter Wallnöfer
be4a0d35ac s4:"wrap_casefold" - move it to "ldb_wrap.c" since it's only used there 2010-10-17 10:20:40 +02:00
Andrew Bartlett
d406e511a5 lib/debug Add DEBUGC and DEBUGADDC as dummies
This allows code that needs to also compile against the source3
debug code to compile in source4.

Andrew Bartlett
2010-10-12 02:54:16 +00:00
Jelmer Vernooij
ba02178e87 util: Fix installation path of tevent_ntstatus.h, tevent_unix.h (bug 7720).
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Oct 11 09:24:56 UTC 2010 on sn-devel-104
2010-10-11 09:24:56 +00:00
Jelmer Vernooij
904a6c3761 util: Link headers to correct subsystem, fix formatting. 2010-10-10 23:50:46 +02:00
Rusty Russell
2db1987f5a idtree: fix right shift of signed ints, crash on large ids on AIX
Right-shifting signed integers in undefined; indeed it seems that on
AIX with their compiler, doing a 30-bit shift on (INT_MAX-200) gives
0, not 1 as we might expect.

The obvious fix is to make id and oid unsigned: l (level count) is also
logically unsigned.

(Note: Samba doesn't generally get to ids > 1 billion, but ctdb does)

Reported-by: Chris Cowan <cc@us.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User: Rusty Russell <rusty@samba.org>
Autobuild-Date: Wed Oct  6 08:31:09 UTC 2010 on sn-devel-104
2010-10-06 08:31:09 +00:00
Stefan Metzmacher
59d00fc439 lib/util/asn1: let asn1_peek_full_tag() return an error if we fail to parse tag hdr/len
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Oct  4 14:46:40 UTC 2010 on sn-devel-104
2010-10-04 14:46:40 +00:00
Volker Lendecke
fc6e910e69 s3: Fix a 64-bit BUG
Quick explanation why this is a problem:

It is not safe to pass a pointer to a uint32_t into a routine that expects
a size_t *. The routine that this pointer is passed to has no chance to find
out that in reality it was passed a pointer to a uint32_t. On platforms where
sizeof(size_t)==8, we get a nice overwrite of a stack area that should not
be overwritten.

As this happens over an over again: Does someone know a means to make gcc
stop with an error in this case?

Volker
2010-10-02 11:17:49 +02:00
Günther Deschner
b38d0542e1 samba: share select wrappers.
Guenther
2010-10-01 22:30:22 +02:00
Andrew Tridgell
3b52b6249b util: added BINARY_ARRAY_SEARCH_V()
this is used to search an array of values
2010-09-29 16:36:22 -07:00
Volker Lendecke
35d9530f3b Remove talloc_autofree_context() from pm_process
This would be a classic for talloc_tos(), InFile is freed a few lines down. But
unfortunately S4 does not support talloc_tos().
2010-09-27 18:14:47 +02:00
Volker Lendecke
8e02130c62 Lift talloc_autofree_context() from OpenConfFile() 2010-09-27 18:14:47 +02:00