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

958 Commits

Author SHA1 Message Date
Andrew Bartlett
f9b7cd53b9 s4-xattr: Use libreplace xattr functions directly 2012-06-02 02:13:49 +02:00
Jeremy Allison
50d4c96d66 Remove an unused variable.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun  1 03:03:12 CEST 2012 on sn-devel-104
2012-06-01 03:03:12 +02:00
Volker Lendecke
54cde76e37 lib: add tevent_req_poll_werror
Signed-off-by: Kai Blin <kai@samba.org>
2012-05-30 00:37:56 +02:00
Stefan Metzmacher
b2c9fe4ad1 lib/util: move tevent_req_poll_ntstatus() to tevent_ntstatus.c
metze
2012-05-14 15:12:34 +02:00
Stefan Metzmacher
b4f2184a29 lib/util: add missing 'errors' dependency to 'tevent-util'
metze
2012-05-14 15:12:34 +02:00
Michael Adam
7eb8125668 util: use SMB_ASSERT with panic also in non-developer builds !!!
This has been around since a long time: In non-developer builds,
we don't panic in SMB_ASSERT but happly continue with the error
condition, which is ridiculous and dangerous...
2012-05-11 20:16:38 +02:00
Michael Adam
8be7e6b7fb util: reformat the DEVELOPER definition of SMB_ASSERT 2012-05-11 20:16:38 +02:00
Andrew Bartlett
470cfb34ae lib/util: Map 0x7fffffffffffffffLL as 0x7fffffffffffffffLL in time conversion
TIME_T_MAX is not actually INT64_MAX at the moment, so check both
values and set to the magic end-of-time value.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue May  8 06:41:43 CEST 2012 on sn-devel-104
2012-05-08 06:41:43 +02:00
Jelmer Vernooij
d3b4c2c771 UTIL_TDB: lowercase name.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Thu May  3 20:18:22 CEST 2012 on sn-devel-104
2012-05-03 20:18:22 +02:00
Joseph Tam
00d5f32025 Fix bug #8877 - Syslog broken owing to mistyping of debug_settings.syslog.
Setting "syslog only = yes" did not divert log messages to syslog.  The test in
lib/util/debug.c:Debug1():747

   if( syslog_level < state.settings.syslog )

produces wrong results since .syslog is typed "bool" rather than "int".
The attached patch fixes this by typing this field correctly as "int".

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Apr 20 00:06:12 CEST 2012 on sn-devel-104
2012-04-20 00:06:12 +02:00
Andrew Bartlett
cc86f8e985 lib/util: Move map_nt_error_from_tdb to the top level
This will help with making dbwrap available as a top level library.

Andrew Bartlett
2012-04-18 12:04:59 +10:00
Andrew Bartlett
d166b79852 build: Remove sys_open wrapper 2012-04-05 02:39:08 +02:00
Andrew Bartlett
473b974a06 build: do not use HAVE_EXPLICIT_LARGEFILE_SUPPORT and *64() fucntions any more 2012-04-05 02:39:08 +02:00
Andrew Bartlett
b4e58111b9 build: Remove configure tests for *64 functions and types
We now use the standard types only.

Andrew Bartlett
2012-04-05 02:39:08 +02:00
Andrew Bartlett
b66b5f9e3f lib/util: charset modules do not exist any more
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Apr  3 08:07:42 CEST 2012 on sn-devel-104
2012-04-03 08:07:41 +02:00
Andrew Bartlett
4d53e7c2ba lib/util: Add smb_load_module that returns DEBUG(0) errors on failure
These errors are very important when trying to work out why a module
does not load, and this rework allows them to be shown when loading
vfs modules.

Andrew Bartlett
2012-04-03 14:25:12 +10:00
Jeremy Allison
786cb132e8 Fix an IPv6 breakage I introduced by adding an strlcpy truncation check. Found by Matthieu Patou <mat@samba.org>.
The truncate of the strlcpy() here was a *desired* side effect.
strlcpy()/strlcat() should never be used like that. Be more
explicit about the truncation and don't use strlcpy here.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Mar 31 07:59:16 CEST 2012 on sn-devel-104
2012-03-31 07:59:15 +02:00
Jeremy Allison
5df1c11539 Start to add truncate checks on all uses of strlcpy(). Reading lwn
has it's uses :-).

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Mar 29 20:48:15 CEST 2012 on sn-devel-104
2012-03-29 20:48:15 +02:00
Jelmer Vernooij
c0288e0612 lib/util: Remove obsolete sys_getpid() and sys_fork().
The performance of these is minimal (these days) and they can return
invalid results when used as part of applications that do not use
sys_fork().

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-24 21:55:40 +01:00
Jelmer Vernooij
55bd27935f lib/util: Allow calloc use in util.c, too.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 24 18:50:32 CET 2012 on sn-devel-104
2012-03-24 18:50:32 +01:00
Jelmer Vernooij
71d41a015a libreplace: Add getpeereid implementation. 2012-03-24 16:00:36 +01:00
Jelmer Vernooij
32fd6d639a lib/util: Remove dummy wrapper for getgrgid(). 2012-03-24 15:26:36 +01:00
Jelmer Vernooij
2a82c45f02 lib/util: Remove dummy wrapper for getgrnam(). 2012-03-24 15:25:48 +01:00
Jelmer Vernooij
43f275008f lib/util: Remove dummy wrapper for getpwuid(). 2012-03-24 15:25:05 +01:00
Jelmer Vernooij
818e0722e1 lib/util: Remove dummy wrapper for getpwnam(). 2012-03-24 15:24:15 +01:00
Jelmer Vernooij
3be6258912 lib/util: Remove dummy wrappers for setpwent/getpwent/endpwent. 2012-03-24 15:23:02 +01:00
Jelmer Vernooij
14fdc1c5cd lib/util: Move calloc_array and memalign_array to top-level libutil. 2012-03-24 15:19:09 +01:00
Jelmer Vernooij
c0c52ac1a4 lib/util: Remove prototype for removed sys_memalign. 2012-03-24 15:00:22 +01:00
Jelmer Vernooij
2d5275fae0 lib/util: Remove trivial wrapper sys_connect() around connect(). 2012-03-24 14:58:09 +01:00
Jelmer Vernooij
d4c4cb06c5 replace: Move memalign() from lib/util/system.c to libreplace. 2012-03-24 14:43:21 +01:00
Ira Cooper
b990279304 util: Add --disable-fault-handling.
On some platforms you can not debug coredumps after the default signal handler
gets done dumping core.  This allows waf to have an option to disable our
default signal handler.
2012-03-15 05:55:03 +01:00
Stefan Metzmacher
800209aad5 lib/util: only change umask during mkdir()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
bfe990af89 lib/util: cope with races between lstat and mkdir in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
e03059fc96 lib/util: use a helper variable in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
f306261119 lib/util: do an early return on error directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
bd492befc0 lib/util: remove unneeded else branch in directory_create_or_exist()
metze
2012-03-14 12:00:46 +01:00
Stefan Metzmacher
687606b452 lib/util: don't start DEBUG output with 'error '
This confused the subunit code.

metze
2012-03-14 12:00:46 +01:00
Jelmer Vernooij
ce4531ee31 tdb_wrap: Move to specific directory.
It's a bit confusing to mix low-level and high-level libraries.  We had
multiple libraries in one directory, and there were have circular
dependencies with other libraries outside that directory (in this case,
samba-hostconfig).

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Mar 10 23:13:01 CET 2012 on sn-devel-104
2012-03-10 23:13:01 +01:00
Andrew Bartlett
bc66af50ff lib/util: Add a callback facility for debug messages
This will allow dlz_bind9 to put log messages somewhere useful, which
may make it easier to debug.

Andrew Bartlett
2012-03-08 10:14:05 +01:00
Andrew Bartlett
b07d504ca4 change low FDs are handled in Samba
We now only close fds 0, 1, 2 when we are a forked daemon, and take
care not to close a file descriptor that we might need for foreground
stdin monitoring.

This should fix stdout logging in the lsa and epmapper deamons (ie in
make test).

Andrew Bartlett
2012-03-04 10:14:34 +01:00
Andrew Bartlett
6090a155f0 build: look for backtrace_symbols in libexec 2012-03-01 22:04:45 +11:00
Andrew Bartlett
057b87d0bd lib/util: Remove unused sys_inet_makeaddr()
Found by callcatcher.

Andrew Bartlett
2012-02-17 12:19:29 +01:00
Andrew Bartlett
c8c3f0c608 lib/util: Remove unused sys_gethostbyname()
Found by callcatcher.

Andrew Bartlett
2012-02-17 12:19:29 +01:00
Andrew Bartlett
367c567c5f lib/util: Remove sys_poll as it is no longer needed
sys_poll() is only needed if the signal pipe is set up and used, but as
no signal handler ever writes to the pipe, this can all be removed.

signal based events are now handled via tevent.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-02-16 15:49:21 -08:00
Andrew Bartlett
ab80995580 lib/util: Remove unused sys_select_signal()
Now sys_poll needs to be cleaned up not to refer to the pipe that is now not used.

Andrew Bartlett

Signed-off-by: Jeremy Allison <jra@samba.org>
2012-02-16 15:49:09 -08:00
Andrew Bartlett
efc210d520 lib/util: Remove unused str_format_nbt_domain()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:13 +11:00
Andrew Bartlett
fc5a214d71 charset: Remove unused strcmp_w()
Found by callcatcher.

Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:13 +11:00
Andrew Bartlett
983d205486 charset: Remove unused iconv_talloc()
Found by callcatcher: http://www.skynet.ie/~caolan/Packages/callcatcher.html

Andrew Bartlett
2012-02-10 16:45:11 +11:00
Jelmer Vernooij
d6b4701503 charset/tests: Add prototypes for test functions. 2012-02-07 01:11:07 +01:00
Volker Lendecke
a0e44c30e2 lib/util: Add hex_encode_buf
Autobuild-User: Volker Lendecke <vl@samba.org>
Autobuild-Date: Mon Feb  6 09:15:33 CET 2012 on sn-devel-104
2012-02-06 09:15:32 +01:00
Michael Adam
2b9299310f loadparm: fix a load of uninitialized memory errors found by valgrind. 2012-02-03 11:10:29 +01:00
Volker Lendecke
e9d66999c6 Introduce dump_data_file
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Jan 25 11:57:18 CET 2012 on sn-devel-104
2012-01-25 11:57:18 +01:00
Volker Lendecke
1364eb7bd7 lib/charset: Remove an unused variable
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sun Dec 25 15:07:56 CET 2011 on sn-devel-104
2011-12-25 15:07:55 +01:00
Volker Lendecke
b2eaa9afd3 s3: Fix fn signatures in charset_macosx.c 2011-12-25 13:31:58 +01:00
Andrew Tridgell
4ecac6067f runcmd: use set_close_on_exec()
this prevents a fd leak to child processes

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Dec 22 14:00:06 CET 2011 on sn-devel-104
2011-12-22 14:00:06 +01:00
Andrew Tridgell
81c564798c runcmd: use a pipe for stdin to child processes
this allows child processes to detect the exit of the parent by
looking for EOF on stdin
2011-12-22 12:26:08 +01:00
Volker Lendecke
79fe4bbf73 s3: Fix the clustering build
ctdb_private.h already defines set_close_on_exec.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Dec 17 18:41:39 CET 2011 on sn-devel-104
2011-12-17 18:41:39 +01:00
Volker Lendecke
bcd3db6264 Add support for TCP_DEFER_ACCEPT
"man tcp" on Linux says:

TCP_DEFER_ACCEPT

Allows a listener to be awakened only when data arrives on the  socket.  Takes
an integer value (seconds), this can bound the maximum number of attempts TCP
will make to complete the connection. This option should not be used in code
intended to be portable.

This might reduce the 139/445 forks a bit on high-load servers
2011-12-16 07:34:48 +01:00
Andrew Tridgell
d581c9d284 genrand: use set_close_on_exec()
this prevents a fd leak to child processes
2011-12-15 23:36:22 +01:00
Andrew Tridgell
3b56f64923 lib/util: added set_close_on_exec()
this was already in tevent_util.c, but library layering prevented us
from using it in some other libraries
2011-12-15 23:36:22 +01:00
Michael Adam
8f7f244200 lib/util/util_tdb: adhere to coding style for tdb_data_is_empty()
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Dec  6 15:22:08 CET 2011 on sn-devel-104
2011-12-06 15:22:08 +01:00
Jelmer Vernooij
05bc4de083 Revert making public of the samba-module library.
This library was tiny - containing just two public functions than were
themselves trivial. The amount of overhead this causes isn't really worth the
benefits of sharing the code with other projects like OpenChange. In addition, this code
isn't really generically useful anyway, as it can only load from the module path
set for Samba at configure time.

Adding a new library was breaking the API/ABI anyway, so OpenChange had to be
updated to cope with the new situation one way or another. I've added a simpler
(compatible) routine for loading modules to OpenChange, which is less than 100 lines of code.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec  3 08:36:33 CET 2011 on sn-devel-104
2011-12-03 08:36:30 +01:00
Gregor Beck
d74b3f941f lib/util: factor out tdb_data_is_empty
Signed-off-by: Michael Adam <obnox@samba.org>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Sat Dec  3 05:20:30 CET 2011 on sn-devel-104
2011-12-03 05:20:30 +01:00
Jeremy Allison
3e6e1aed94 Fix a bunch of "warning: variable ‘XXXX’ set but not used [-Wunused-but-set-variable]" warnings from the new gcc.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Nov 21 23:39:08 CET 2011 on sn-devel-104
2011-11-21 23:39:08 +01:00
Stefan Metzmacher
ffb846ba7c lib/util/debug: with log level = 10 we should be more verbose
log level = 10 already impacts performance, so we can turn on
more details and print the pid, [e][u|g]id and class information.

So it implies "debug pid = yes", "debug uid = yes" and "debug class = yes".

This generates a lot more useful log files.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Nov 16 12:25:02 CET 2011 on sn-devel-104
2011-11-16 12:25:01 +01:00
Björn Jacke
383a918322 s3: allow to set TCP_NODELAYACK socket option on AIX
this is the AIX way to disable delayed ACKs, the same like TCP_QUICKACK on
Linux

Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Tue Nov 15 21:00:07 CET 2011 on sn-devel-104
2011-11-15 21:00:07 +01:00
Jelmer Vernooij
56081da368 util/time: Make some functions explicitly public. 2011-11-03 17:22:40 +01:00
Jelmer Vernooij
56852bf1fc util/time: Remove unnecessary _PUBLIC_ - that's implicit for things in header files. 2011-11-03 14:34:08 +01:00
Andrew Bartlett
1e2f15f773 lib/util Add ABI to the samba-module library
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Oct 28 14:42:43 CEST 2011 on sn-devel-104
2011-10-28 14:42:43 +02:00
Andrew Bartlett
7f8f7159af lib/util Rename samba_modules_load -> samba_module_init_fns_for_subsystem
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
b256799eaf lib/util Rename samba_init_module -> samba_module_init
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
0ce09fcf7a lib/util Rename samba_init_module_fns_run -> samba_module_init_fns_run
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
1b7cc4ac7c lib/util Rename samba_init_module_fn -> samba_module_init_fn
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
87354c9a6d lib/util Split samba-modules library into public and private parts
This will allow OpenChange to get at the symbols it needs, without
exposing any more of this as a public API than we must.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
b7b798e15b lib/util Rename load_samba_modules -> samba_modules_load
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
ce0ccc2a2e lib/util Rename run_init_functions -> samba_init_module_fns_run
This is to provide a cleaner namespace in the public samba plugin
functions.

Andrew Bartlett
2011-10-28 13:10:28 +02:00
Andrew Bartlett
1935b7b6c2 lib/util Rename init_module_fn to samba_init_module_fn
This prepares for making the samba_module.h header public again, for OpenChange.

I am keen to avoid too much API namespace pollution if we can.
2011-10-28 13:10:28 +02:00
Andreas Schneider
7cb08171ce Include uid_wrapper correctly. 2011-10-27 13:32:02 +02:00
Andrew Bartlett
5cb6adb590 lib/util/charset Remove unused header smb_common.h
This should fix a compile issue on hosts without gssapi/gssapi.h.

Andrew Bartlett

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-24 13:56:45 +02:00
Stefan Metzmacher
c2b5106387 lib/util: remove the "includes.h" dependeny from xfile.c
metze
2011-10-22 09:28:27 +02:00
Stefan Metzmacher
b6026dfa94 lib/util: remove the "includes.h" dependeny from util_file.c
metze
2011-10-22 09:28:26 +02:00
Michael Adam
47aa9ed82f lib/util: skip single hex digit at the end of the input sting - fix potential segfault
The second of two digits was read without checking for the length of the input
string. For a non-zero-terminated input string, this might have caused a
segfault.

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Tue Oct 18 22:32:59 CEST 2011 on sn-devel-104
2011-10-18 22:32:59 +02:00
Michael Adam
cb47890cf2 lib/util: fix function header comment to strhex_to_str()
The description did not match the function's behaviour.
2011-10-18 20:58:26 +02:00
Michael Adam
5d91a2680e lib/util: untangle assignent from check in strhex_to_str() 2011-10-18 20:58:26 +02:00
Jeremy Allison
f4a41ce5a6 Fix const warnings. 2011-10-14 13:51:26 -07:00
Andrew Bartlett
01c934c81e lib/util: Add back control of mmap and hash size in tdb for top level build
This passes down a struct loadparm_context to allow these
parameters to be checked.  This may be s3 or s4 context, allowing the
#if _SAMBA_BUILD_ macro to go away safely.

Andrew Bartlett
2011-10-13 14:06:07 +02:00
Gregor Beck
85b145d745 s3:utils change data_blob_dup_talloc() to take a DATA_BLOB by value
Signed-off-by: Michael Adam <obnox@samba.org>
2011-10-12 22:45:53 +02:00
Andrew Bartlett
055f017b36 build: Reduce build systems to just top level waf and autoconf
The s3-waf build system is a key component of the top level build, but
with this commit is is no longer available directly.  This reduces the
number of build system combinations in master as we prepare for the
Samba 4.0 release.

Andrew Bartlett
2011-10-07 17:42:03 +11:00
Andrew Bartlett
f6b7bd4a01 lib/util: consolidate module loading
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Thu Oct  6 08:52:30 CEST 2011 on sn-devel-104
2011-10-06 08:52:30 +02:00
Andrew Bartlett
355b5e3a83 modules: standardise on samba_init_module as the hook symbol to resolve 2011-10-06 07:18:07 +02:00
Andrew Bartlett
a718b5a4f1 lib/util: Use only init_module_fn typedef in module loading 2011-10-06 07:18:07 +02:00
Andrew Bartlett
c8945279e7 lib/util: Remove unused module loading functions 2011-10-06 07:18:07 +02:00
Andrew Bartlett
7d33ec3dfe lib/util: consolidate module loading into common code
This creates a samba-modules private libary that handles the details.

Andrew Bartlett
2011-10-06 07:18:07 +02:00
Stefan Metzmacher
f2b795e9cf lib/util: make sure panic action can attach a debugger on ubuntu (>=10.10)
By default user processes can't attach a debugger to a process.
So explicitly allow that for all child processes, before calling
the panic action script.

metze
2011-10-04 10:57:56 +02:00
Kai Blin
b02bbf237c net: Don't register link local addresses with DNS 2011-09-24 21:46:06 -07:00
Andrew Bartlett
2a789c8442 build: Fix waf build on MacOS X
The -framework CoreFoundation is required by the charset_macosxfs module

The system/time.h header is required to access the replacement clock_gettime()

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri Sep 23 10:58:02 CEST 2011 on sn-devel-104
2011-09-23 10:58:02 +02:00
Andrew Bartlett
d40fe50a67 build: avoid util.h as a public header name due to conflict with MacOS 2011-09-23 09:24:03 +02:00
Stefan Metzmacher
66f8070dd3 lib/util: move some timespec helpers from source3 to the toplevel
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Sep 23 00:15:31 CEST 2011 on sn-devel-104
2011-09-23 00:15:31 +02:00
Andrew Bartlett
f9acf770e9 lib/util/charset: remove charset module loading
Now that the 'table' modules are gone, there is no reason for there to
be charset modules at all.  This builds the macosxfs and weird modules
into the binary at the appropriate times, and changes the tests to
test instead the difference between the remaining internal handlers
and iconv().

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Sep 20 06:27:06 CEST 2011 on sn-devel-104
2011-09-20 06:27:06 +02:00
Andrew Bartlett
8316577b75 lib/util/charcnv: Remove broken internal CP850 and CP464 modules
These modules are now known to be faulty, and Samba 3.6.0 didn't
include support for them, so we now require a system iconv if you wish
to support these character sets for the non-ASCII range.

Andrew Bartlett
2011-09-20 04:53:05 +02:00
Rusty Russell
376511ed4d tdb_compat: adapt to tdb2 API change.
Add the ecode arg to all the log functions, and log it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14 07:13:13 +09:30
Andrew Bartlett
86b1f45a5e lib/util/charset: the comparsion must be against our charset modules
There is little point testing this against the system iconv.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Sep 10 15:45:42 CEST 2011 on sn-devel-104
2011-09-10 15:45:42 +02:00
Andrew Bartlett
142f871cef lib/util/charset Use name of ISO-8859-1 that matches our internal implementation 2011-09-10 14:18:06 +02:00
Andrew Bartlett
0022296349 lib/util/charset: Improve toture assertions in iconv test 2011-09-10 14:18:06 +02:00
Andrew Bartlett
2085dffddb lib/util/charset Run charset sets with and without the system iconv
We need to know that we can load the samba-provided modules, and that
they are correct.  However, we must mark a number of tests as
knownfail due to errors in our internal iconv modules.

Andrew Bartlett
2011-09-10 14:18:06 +02:00
Andrew Bartlett
fc6bb5d47a lib/util/charset: add back loading of charset modules
For autoconf builds these remain as modules, for waf builds they are
built into the charset library.

This is required to provide the CP850 charset when iconv is not available.

The charset modules static for the waf builds because with proper
shared libs, there isn't the same need for these to be in seperate .so
files.  The modules are also not produced if a system iconv is found,
except for developers, to allow testing of both code paths.

Andrew Bartlett
2011-09-10 14:18:06 +02:00
Andrew Tridgell
6e25723c82 lib: added base64_decode_data_blob_talloc()
its nice to be able to allocate on other than NULL

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-09-08 03:35:27 +02:00
Volker Lendecke
1d4de78f56 Fix bug 8433, segfault in iconv.c
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Sep  1 18:25:34 CEST 2011 on sn-devel-104
2011-09-01 18:25:34 +02:00
Jelmer Vernooij
12e1fdf089 wafsamba: Require public libraries to have a pc file specified, or explicitly specified that they don't need one. 2011-08-21 03:22:05 +02:00
Simo Sorce
039ddef209 util: add function to extend anonymous shared memory 2011-08-14 20:19:02 -04:00
Simo Sorce
09ad4d47f8 lib-util: Make create_unlink_tmp argument optional
Use tmpdir() if no dir is provided.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Simo Sorce
05455b459a lib-util: Make useful function a common utility.
Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Simo Sorce
185cd4c794 libutil: use AI_ADDRCONFIG only when AI_NUMERIC is not defined
This flag prevents startup w/o ip addresses assigned to any interface.
If AI_NUMERIC is passed it should be safe to avoid it.

Signed-off-by: Andreas Schneider <asn@samba.org>
2011-08-10 18:14:02 +02:00
Andrew Bartlett
af5f494bd2 build: provide tevent-util as a public library
This is needed so that OpenChange can get at _tevent_req_nterr(), which is referenced
by generated PIDL output.

Andrew Bartlett
2011-08-08 13:34:06 +02:00
Jelmer Vernooij
ac57cfda9d libsamba-util: Build in libbitmap.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Tue Jul 26 14:45:27 CEST 2011 on sn-devel-104
2011-07-26 14:45:26 +02:00
Jelmer Vernooij
0397b2ef30 charset: Make name lowercase everywhere. 2011-07-23 22:08:10 +02:00
Andrew Bartlett
485898458a debug: log early messages to stdout, and keep it open
The --log-stdout option was compromised by the log file descriptors being
closed once the file process forked.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:09 +10:00
Andrew Bartlett
3c9d01e3e5 lib/util Change debug priority order: DEBUG_STDOUT now overrides DEBUG_FILE
Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-07-20 09:17:09 +10:00
Jeremy Allison
93dcfdea38 Second part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems.
Re-add:
	smb_ucs2_t toupper_w(smb_ucs2_t v);

and ensure it is called whenever we are operating on smb_ucs2_t
variables. I'd like to make the definition of smb_ucs2_t incompatible
with int and codepoint_t so they can't be mixed, but that's a patch
for another time.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jul 19 23:48:05 CEST 2011 on sn-devel-104
2011-07-19 23:48:05 +02:00
Jeremy Allison
ee34c25c8a First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);

and replace with their _m equivalents, as they are identical.
2011-07-19 13:19:29 -07:00
Stefan Metzmacher
dc0c8ef6bd lib/util/attr: add _UNUSED_ marco
metze
2011-07-14 20:11:22 +02:00
Andrew Tridgell
18995cde5c s4-fault: changed to use %d for PID, instead of %PID%
this matches the s3 behaviour

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-07-13 12:51:05 +02:00
Andrew Bartlett
cf406f7e7d s3-param use common struct parmlist_entry to hold parametric options
This will allow struct loadparm_service to be shared in future.

Andrew Bartlett
2011-07-08 11:23:23 +02:00
Andrew Bartlett
6e6aaacedb lib/util Move bitmap.c to lib/util 2011-07-08 11:23:23 +02:00
Stefan Metzmacher
0f006751ec s3:libsmb: remove unused clistr_push_fn()
metze
2011-07-07 19:16:28 +02:00
Stefan Metzmacher
30574a73d8 s3:libsmb: remove unused clistr_pull_fn()
metze
2011-07-07 19:16:28 +02:00
Andrew Bartlett
6543987139 libcli/smb move enum protocol_types to a common header 2011-07-06 05:32:51 +02:00
Volker Lendecke
25df2fe8e2 S3: Fix some nonempty blank lines 2011-07-03 11:31:29 +02:00
Stefan Metzmacher
c234b4b0c0 lib/util/string_wrappers: move everything into one HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS block
metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Jun 30 14:29:41 CEST 2011 on sn-devel-104
2011-06-30 14:29:41 +02:00
Volker Lendecke
a52f179951 lib: Allow NULL converted_size in convert_string_talloc 2011-06-24 21:24:17 +02:00
Andrew Bartlett
de0e011944 lib/util/charset: Remove autodetection of charset from LOCALE
In the past, our LOCALE would set the display charset of Samba.  The
display charset has now been removed.  This patch removes the support
code that detected the locale from the environment.  We cannot safely
have 'unix charset' follow the locale (at it creates files on disk and
entries in databases that must not vary), so this code is unused.

As an example, imagine a database is manipulated in the
administrator's locale, and then read by smbd starting up in the
system default locale.  Or smbd restarted by the administrator rather
than a startup script.  Both of these situations could corrupt
databases or filenames on disk.

Andrew Bartlett
2011-06-23 13:47:27 +02:00
Andrew Bartlett
125a2ff262 lib/util/charset: Remove 'display charset'
As discussed in 'CH_DISPLAY and gettext' on the samba-technical list:
http://lists.samba.org/archive/samba-technical/2011-June/078190.html

Setting this to a value other than 'unix charset' does not make sense,
as any system where the filesytem charset does not equal the terminal
charset will already have problems with programs as simple as 'ls'.
It also means that our output could not be pasted as our input in
interactive programs or onto our command line, as we never did
translate in the DISPLAY -> UNIX direction.

The d_printf() calls are retained in case we need to revisit this, and
to support display_set_stderr().

Andrew Bartlett
2011-06-23 13:47:27 +02:00
Andrew Bartlett
e00b1fa2b0 lib/util: Restore CH_UNIX as source charset for d_printf()
I'm changed this during the change to use the d_printf() code in
common, but should not have.

However, there is a puzzle: What is the right source charset?
Translated strings in our .mo and .msg files are in UTF8, but strings
such as file names on remote servers are in UNIX (whatever that is).
I can't see how this actually works properly when either CH_DISPLAY or
CH_UNIX are other than UTF8!

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:44 +10:00
Andrew Bartlett
bf83b641e2 lib/util Remove display_cd from d_printf()
The setting of the display charset is now done by
convert_string_talloc() selecting the right charset based on
CH_DISPLAY.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-06-21 15:54:38 +10:00
Andrew Bartlett
5db74b9607 lib/util Remove samba-util-common!
All of this code is now in common, so we don't need the second
'-common' library any more!

Andrew Bartlett
2011-06-21 09:36:22 +10:00
Andrew Bartlett
d18491a7bd lib/util: allow parmlist.c to compile under s3 includes.h 2011-06-21 09:36:22 +10:00
Andrew Bartlett
f83fca1c57 lib/util: Use common d_printf() in the whole codebase
This removes the lang_tdb based varient, the only user of the lang_tdb
code is SWAT, which calls that directly.

'net' and 'pam_winbind' are internationalised using gettext.

Andrew Bartlett
2011-06-21 09:35:34 +10:00
Andrew Bartlett
f3d6b742b1 lib/util Make unused d_vfprintf() static 2011-06-21 09:35:34 +10:00
Rusty Russell
d925b327f4 tdb_compat: Higher level API fixes.
My previous patches fixed up all direct TDB callers, but there are a
few utility functions and the db_context functions which are still
using the old -1 / 0 return codes.

It's clearer to fix up all the callers of these too, so everywhere is
consistent: non-zero means an error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
ca1936fbb2 tdb_compat: use tdb_open_compat.
This is a helper for the common case of opening a tdb with a logging
function, but it doesn't do all the work, since TDB1 and TDB2's log
functions are different types.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
1078eb21c4 tdb_delete: check returns for 0, not -1.
TDB2 returns a negative error number on failure.  This is compatible
if we always check for != 0 instead of == -1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
058c4f8492 tdb_fetch_compat: use instead of tdb_fetch.
This is a noop for tdb1.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:35 +02:00
Rusty Russell
0e4c358e27 tdb_compat.h: divert every tdb build and includes to tdb_compat
We change all the headers and wscript files to use tdb_compat; this
means we have one place to decide whether to use TDB1 or TDB2.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-20 11:18:34 +02:00
Andrew Tridgell
b07e4933b7 talloc: added talloc_stackframe_exists()
This can be used to tell if a talloc stackframe is currently
available. Callers can use this to decide if they will use
talloc_tos() or instead use an alternative strategy. This gives us a
way to safely have calls to talloc_tos() in common code that may end
up in external libraries, as long as all talloc_tos() calls in these
pieces of common code check first that a stackframe is available.
2011-06-17 15:25:42 +10:00
Andrew Bartlett
530e4cac2e s3-param Remove 'time offset' from smb.conf
This strange parameter is apparently very rarely used, and it seems to
me that on modern networks, if clients don't have correct clocks and
DST offsets, that many other things (Kerberos) start to fail pretty
quickly, and time and DST tables tend to be internet delivered anyway.

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Jun 11 03:54:45 CEST 2011 on sn-devel-104
2011-06-11 03:54:44 +02:00
Günther Deschner
d228fc35f3 lib/util/wrap_xattr.h: fix licence/copyright
Guenther
2011-06-10 15:11:29 +02:00
Günther Deschner
eaa4002165 lib/util/util_tdb.h: fix licence/copyright
Guenther
2011-06-10 15:11:27 +02:00
Günther Deschner
4fe4487cd9 lib/util/util_ldb.h: fix licence/copyright
Guenther
2011-06-10 15:11:26 +02:00
Günther Deschner
74610109ac lib/util/time.h: fix licence/copyright
Guenther
2011-06-10 15:11:25 +02:00
Günther Deschner
a602cb2a0a lib/util/data_blob.h: fix licence/copyright
Guenther
2011-06-10 15:11:23 +02:00
Andrew Bartlett
daf79e33c7 server_id: Change format to vnn:pid.task_id, pid.task_id or pid
This helps ensure the string cannot be ambiguous, while also ensuring
that it remains simple in the non-cluster case.

The asymmetry of reading get_my_vnn() but writing based on
NONCLUSTER_VNN is acceptable because in the non-clustered case, they
are equal, and in the clustered case we will print the full string.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
16b1c77644 lib/util Bring procid_str() into lib/util as server_id_string()
This is needed for OpenChange, which prints Samba struct server_id
values in debug messages.

Andrew Bartlett
2011-06-09 12:40:09 +02:00
Andrew Bartlett
de46ad9084 lib/util use modules_path(), data_path() and shlib_ext() from source3
This brings these helpful utility functions in common, as they are not
based on either loadparm system.

(The 'modules dir' parameter from Samba4 will shortly be removed, so
there is no loss in functionality)

Andrew Bartlett
2011-06-06 17:37:51 +10:00
Andrew Tridgell
b81eac1e2b util-net: added is_ipaddress_v6() 2011-06-06 12:26:11 +10:00
Andrew Tridgell
74a7e68925 ipv6: always try to convert as a numeric address first
This avoids unnecessary name lookups, plus it fixes a problem with
using interpret_string_addr*() with the wildcard IPv6 address
2011-06-06 12:26:10 +10:00
Herb Lewis
f090179232 Fix warning messages on Freebsd 4.6.2.
Signed-off-by: Jeremy Allison <jra@samba.org>
2011-06-02 10:10:39 -07:00
Rusty Russell
0204ae6229 lib/util/time.c: timeval_current_ofs_usec
Several places want "microseconds from current time", and several were
simply handing "usecs" values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Rusty Russell
56e72337b0 lib/util/time.c: timeval_current_ofs_msec
Several places want "milliseconds from current time", and several were
simply doing "msec * 1000" which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-06-01 10:38:47 +02:00
Andrew Bartlett
52399f3177 lib/util Move sys_memalign into lib/util/system.c 2011-05-31 02:57:19 +02:00
Sean Finney
0f8018676a Fix numerous missing dependencies in WAF build scripts
With the recent consolidation of code between s3 and s4, a number of new
dependencies have been implicitly introduced.  For example, previous s3
code gained an implicit dependency on talloc after the charset related
consolidation (lib/util/charset/charset.h now includes talloc.h).  When
building against the embedded version of talloc this isn't a problem
since the paths are automatically added to the search path, but when
building against the external libraries build failures will occur for
all components that don't directly or indirectly include talloc as
a dependency.

Since charset.h is included from util.h, which in turn is included from
includes.h, this means most of the codebase (s3 and s4) has such an
undeclared dependency.

Therefore, samba-util-common and samba-util have been added as
dependencies to the s3 and s4 code respectively, for all cases where
the source would otherwise fail to build.  Additionally, a few other
dependencies are added in specific wscript_build files to address
similar dependency-related problems.

https://bugzilla.samba.org/show_bug.cgi?id=8128

Signed-off-by: Sean Finney <seanius@seanius.net>
Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Wed May 25 19:22:13 CEST 2011 on sn-devel-104
2011-05-25 19:22:13 +02:00
Jeremy Allison
e719dfd4dc Fix our asn.1 parser to handle negative numbers.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue May 24 22:57:16 CEST 2011 on sn-devel-104
2011-05-24 22:57:16 +02:00
Andrew Bartlett
ede98c0e51 lib/util Add Volker's asn1_Integer test into code that runs in 'make test'
The comfychair test harness isn't hooked up, and with the current
infrustructure C code is better tested directly here.

Andrew Bartlett
2011-05-24 12:48:00 -07:00
Andrew Bartlett
f19ab5d334 lib/util/charset: Remove unused strcasecmp_w and strncasecmp_w
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed May 18 17:22:15 CEST 2011 on sn-devel-104
2011-05-18 17:22:15 +02:00
Andrew Bartlett
57f41ef150 lib/util/charset use talloc_stackframe() rather than talloc_tos()
This is common code, and we can't assume a talloc_stackframe() so we
must create it.

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Andrew Bartlett
3c8de7dd66 lib/util/charset Don't allow invalid 'dos charset = utf8'
No DOS client used UTF8, and this creates subtle, difficult to
disagnose breakage of schannel (domain membership).

Andrew Bartlett
2011-05-18 16:12:08 +02:00
Jeremy Allison
d25370fb47 Don't evaluate the src argument to fstrcpy/fstrcat/nstrcpy/unstrcpy twice. Prevents side-effects when src is a function call. 2011-05-17 19:01:18 +02:00
Günther Deschner
0092240401 lib/util/charset: fix the toplevel MacOS X build.
Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue May 17 16:16:59 CEST 2011 on sn-devel-104
2011-05-17 16:16:59 +02:00
Volker Lendecke
115d0ecf88 Use ZERO_STRUCTP in util_net 2011-05-14 17:57:13 +02:00
Andrew Bartlett
f18cca9a0a lib/util/charset Move built-in charset modules to the top level
This removes the 'charset' subsystem and allows these modules to be
used across the whole of Samba.

Andrew Bartlett
2011-05-13 18:50:23 +02:00
Andrew Bartlett
5db0cd55d4 lib/util/ Fix crash bug caused by gfree_debug()
The issue is that we should reset the debug_num_classes to 0 when we
un-initialise the debug system.

Andrew Bartlett
2011-05-13 18:50:23 +02:00
Rusty Russell
0d93eb8f55 tdb_wrap.h: not a public header.
It is a private library, and OpenChange has their own which they use, so
it's not for them either.

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

Autobuild-User: Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date: Tue May 10 05:21:19 CEST 2011 on sn-devel-104
2011-05-10 05:21:19 +02:00
Andrew Bartlett
f946668b7a Improve debug messages when creating socket directories
This makes clear what the permissions error and directory name actually is

Andrew Bartlett
2011-05-08 10:56:28 +02:00
Andrew Bartlett
8aae59a277 lib/util don't use enum protocol_types in ms_fnmatch_protocol
This makes it easier to compile this in the top level with s3 and s4
headers.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri May  6 08:50:52 CEST 2011 on sn-devel-104
2011-05-06 08:50:52 +02:00
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