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
Volker Lendecke
f0e1a8e1e2 lib: Use server_id_str_buf in server_id_str
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-17 07:00:14 +02:00
Volker Lendecke
7a3bda54b0 lib: Add server_id_str_buf
This is usable in a DEBUG statement without talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-06-17 07:00:14 +02:00
Michael Adam
55c279f0c4 smbd: add missing newline to debug message in daemon_ready()
Wrap overly long line while touching it anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri May 23 04:03:43 CEST 2014 on sn-devel-104
2014-05-23 04:03:43 +02:00
Stefan Metzmacher
dcb8bfea61 lib/util: s/daemon/name
daemon() is a public function...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2014-05-23 01:37:10 +02:00
Garming Sam
412a387357 Add a comment regarding strwicmp only being an ASCII string compare
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:17 +02:00
Garming Sam
98dbc38efa move str_list_make_v3 out of s3 code
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-05-07 19:49:16 +02:00
David Disseldorp
5bf6ed5ebd byteorder: do not assume PowerPC is big-endian
byteorder.h currently uses reverse-indexing ASM instructions for little
endian multi-byte storage/retrieval on PowerPC. With Power8 this is an
incorrect assumption, as it can be big or little endian.

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

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
2014-05-06 18:14:13 +02:00
Alexander Bokovoy
aa8c8a7b5b add systemd integration
Add --with-systemd / --without-systemd options to check whether
libsystemd-daemon library is available and use it to report service
startup status to systemd for smbd/winbindd/nmbd and AD DC.

The problem it solves is correct reporting of the Samba services
at the point when they are ready to serve clients, important for
high availability software integration.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-04-23 02:29:08 +02:00
Andreas Schneider
1a46269599 lib: Add missing include for unistd.h in unix_privs.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andreas Schneider
68c450a423 lib: Add missing include for unistd.h in setid.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:06 +02:00
Andreas Schneider
751b2b2d2a Remove uid_wrapper related code.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Andreas Schneider
6d23354f72 lib: Change uid_wrapper to preloadable version.
This imports version 1.0.1 of uid_wrapper.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Björn Baumbach
fae7e5d771 lib-util: rename memdup to smb_memdup and fix all callers
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-04-16 20:39:08 +02:00
Volker Lendecke
1dba07db0d dlinklist: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr  2 17:11:37 CEST 2014 on sn-devel-104
2014-04-02 17:11:37 +02:00
Stefan Metzmacher
8ba775b0a3 lib/util/tests: add missing #include "torture/local/proto.h"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:44 +02:00
Stefan Metzmacher
f03653e39a lib/util: fix const warnings
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Stefan Metzmacher
cc2bc23e46 lib/util: declare smb_panic_default() as _NORETURN_
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Stefan Metzmacher
8a66947073 lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-03-25 00:45:28 +01:00
Volker Lendecke
70dfb51430 iconv: Use a static buffer in iconf not to spoil the talloc_pool
This is a buffer that is strictly used like a stack variable. This
patch makes it one and while there it fixes an error path memleak.
In the "pull_failed" case we did not talloc_free(cvtbuf). With
talloc_tos(), this does not really matter, but for code without
this it does.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-12-14 10:06:28 +01:00
Volker Lendecke
b2dfd57669 lib-util: add functions to get elapsed from given timespec structs
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-12-12 12:50:21 -08:00
Michael Adam
5aade722cc lib:util: fix a comment typo
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2013-12-11 17:54:21 +01:00
Christian Ambach
4ea92841b7 lib/util: use proper include for struct stat
use <sys/stat.h> instead of forward declaring it
This fixes the build on AIX

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Thu Nov 21 22:12:45 CET 2013 on sn-devel-104
2013-11-21 22:12:45 +01:00
Andreas Schneider
af69cb2a78 util: Remove 32bit macros breaking strict aliasing.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10269

These macros might have worked but they break strict aliasing in the
meantime and so the compiler is not able to optimize the relevant code.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Thu Nov 14 23:16:45 CET 2013 on sn-devel-104
2013-11-14 23:16:45 +01:00
Björn Baumbach
63d98ed904 CVE-2013-4476: lib-util: split out file_save_mode() from file_save()
file_save_mode() writes files with specified mode.

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

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-11-11 11:14:36 +01:00
Björn Baumbach
8eae8d28bc CVE-2013-4476: lib-util: add file_check_permissions()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10234

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-11-11 11:14:36 +01:00
Jeff Layton
fec84112f3 asn1: fix use-after-free in asn1_write
On talloc_realloc failure, asn1_write calls talloc_free on an asn1_data
pointer and then tries to immediately set the has_error flag on it.

Skip the free and just set the has_error flag.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Oct 14 16:54:35 CEST 2013 on sn-devel-104
2013-10-14 16:54:34 +02:00
Günther Deschner
2ad37cbd0e lib/util: remove unused (and not even compiled) lib/util/capability.c.
Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Oct  8 17:32:59 CEST 2013 on sn-devel-104
2013-10-08 17:32:59 +02:00
Günther Deschner
573b455de9 pkgconfig: Do not hardcode library version numbers in pc files.
We control version numbers via 'vnum' from the wscript_build files for all other
libraries.  In case of libndr we already reported a wrong 0.0.1 version via
pkgconfig while in fact the library is versioned as 0.0.2.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Thu Aug 22 20:48:44 CEST 2013 on sn-devel-104
2013-08-22 20:48:44 +02:00
Volker Lendecke
a39c956315 tevent: Add tevent_received to tevent_req_simple_recv_ntstatus
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-12 13:59:53 -07:00
Volker Lendecke
52c51752e8 lib: Remove unused "client_name"
Signed-off-by: Volker Lendecke <vl@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-12 17:25:49 +12:00
Stefan Metzmacher
baecc863de lib/util: add 'ldb' debug class
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>
2013-07-09 15:18:53 +02:00
Björn Jacke
cf87f85874 time: prefer CLOCK_BOOTTIME for clock_gettime_mono()
this clock moves on while the machine was suspended. This is what we prefer
actually.

Signed-off-by: Björn Jacke <bj@sernet.de>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Simo Sorce <idra@samba.org>
Autobuild-Date(master): Fri Jul  5 16:47:34 CEST 2013 on sn-devel-104
2013-07-05 16:47:34 +02:00
Björn Jacke
e3c2dd13d4 time: don't try to use the coarse clock
as we prefer to use the suspend aware CLOCK_BOOTTIME as monotonic clock source
we cannot deal with the mono coarse clock any more. Actually I never saw a real
performance gain with it.

Signed-off-by: Björn Jacke <bj@sernet.de>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-07-05 08:54:53 -04:00
Volker Lendecke
c71d6ecbcb genrand: Slightly simplify do_reseed
The only caller set "use_fd" to "true".

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 14 20:29:56 CEST 2013 on sn-devel-104
2013-06-14 20:29:56 +02:00
Kai Blin
0de1675e5d libcli: Remove uneeded debug message
Signed-off-by: Kai Blin <kai@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-06-01 18:48:11 +10:00
Andrew Bartlett
922fe921ce lib/util/modules.c: Remove #if SAMBA_BUILD_ == 3 now we only have the waf build
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:12 +10:00
Andrew Bartlett
2a4eaa3241 build: Rework BSD_STYLE_STATVFS check to match autoconf build
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-05-27 11:56:48 +10:00
Kai Blin
30cba0d201 debug: Add ability to dump_data per debug class
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-18 10:58:05 +02:00
Kai Blin
4b01099748 debug: Add debugclass for DNS server
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-By: Amitay Isaacs <amitay@gmail.com>
2013-05-16 21:40:08 +10:00
Gregor Beck
1ed22ba4b7 s3:smbd: add a scavenger process for disconnected durable handles
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-18 13:15:13 +02:00
Stef Walter
ca0d38596d getpass: Don't fail if stdin is not a tty
We don't need to manipulate the tty state (such as turning off
echo) when prompting for passwords if we're not reading from a tty.

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Fri Apr  5 07:34:37 CEST 2013 on sn-devel-104
2013-04-05 07:34:37 +02:00
Andrew Bartlett
7ea026e332 lib/util: Cast mode_t result to unsigned int for GNU/Solaris build
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-15 10:38:32 -07:00
Andreas Schneider
90cbfc96d1 Make sure to set umask() before calling mkstemp().
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Wed Mar  6 01:16:34 CET 2013 on sn-devel-104
2013-03-06 01:16:34 +01:00
Andreas Schneider
f9fb3faaef lib: Add prctl_set_comment to utils.
Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-03-05 23:29:46 +01:00
Stefan Metzmacher
6b948cf54b lib/util: add samba_tevent_set_debug()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:11:48 +01:00
Stefan Metzmacher
6205262d38 lib/util: allow samba_tevent_debug() to take a name as context
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-28 12:10:05 +01:00
Andreas Schneider
3ca727b2f9 lib-util: Don't leak file descriptor on error.
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2013-02-22 16:36:14 +01:00
Andrew Bartlett
f2c7f2c93d build: Remove unused includes.h reference to avoid build-time talloc dep
talloc is not a dependency of this library, but is required by includes.h.

By not including includes.h, we avoid needing to add an otherwise false talloc dep.

(this comes up if talloc.h is not installed as a system package).

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-22 08:44:58 +01:00
Stefan Metzmacher
f7aa60175a lib/util: add samba_tevent_context_init()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-19 23:47:43 +01:00
Michael Adam
762dd3cf29 lib/util/time: strip a potential trailing newline in the asctime case.
If strftime() is not available, asctime() is used, and this usually
appends a newline character to the result. This is not desired for
timestamp().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 13:58:08 +01:00
Gregor Beck
d8dd0ecc48 lib/util_tdb: factor out tdb_data_talloc_copy()
Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-19 12:10:24 +01:00
Karolin Seeger
2ed035b5a0 fault.c: Fix typo in comment.
redundent -> redundant

Signed-off-by: Karolin Seeger <kseeger@samba.org>
2013-02-18 22:07:39 +11:00
Stefan Metzmacher
65f2bba559 lib/util: improve check_password_quality() to handle utf8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-02-04 17:14:22 +01:00
Andreas Schneider
6039388fc1 util: Add a strict directory_create_or_exist function.
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-01-09 09:11:20 +01:00
Andreas Schneider
bdc2f4bd91 util: Remove unused fde_stdin in samba_runcmd.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2012-12-12 23:14:44 +01:00
Andreas Schneider
ac434c4223 util: Don't use the pid ret value uninitialized.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
2012-12-12 09:42:33 +01:00
Tsukasa Hamano
16d725b4f5 Fix bug #9471 - SEGV when using second vfs module.
Don't use default_classname_table when we obviously shoud be using
classname_table.

Reviewed by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Dec  7 17:51:50 CET 2012 on sn-devel-104
2012-12-07 17:51:50 +01:00
Andreas Schneider
27a1327b49 util: Add a UNIX platform independent samba_getpass().
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-12-03 14:35:08 +01:00
Volker Lendecke
647a0fb098 lib/util: Simplify bitmap.c a bit
This avoids the double-talloc for bitmaps

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00
Volker Lendecke
7f4d55d1b8 lib/util: Make "struct bitmap" abstract
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2012-11-07 15:32:24 +01:00
Björn Jacke
ffb608b54d util: remove accidently committed hunk
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Oct 31 19:25:30 CET 2012 on sn-devel-104
2012-10-31 19:25:30 +01:00
Björn Jacke
0342ca4062 wfabuild: fix the -errwarn compile flag test
as in the autoconf build this must be "-errwarn=%all"
2012-10-30 13:18:50 +01:00
Andrew Bartlett
3902e7332d lib/util/charset: We do not use fucntions from wchar.h any more
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep 26 02:13:10 CEST 2012 on sn-devel-104
2012-09-26 02:13:10 +02:00
Andrew Bartlett
1c5c96d7cd lib/util/charset: Try to find iconv on HP-UX 2012-09-26 00:24:20 +02:00
Andrew Bartlett
73bdb2a6c2 lib/util: Remove unbuilt file util_getent.c and BROKEN_GETGRNAM
Removing this unbuilt file allows removing BROKEN_GETGRNAM which was only
ever defined per-OS, not based on an actual test.

Andrew Bartlett
2012-09-23 14:45:17 +10:00
Björn Jacke
8299bd1814 waf: add check for BSD_STYLE_STATVFS
a leftover from bug #8777
2012-09-07 14:15:56 +02:00
Stefan Metzmacher
95f3662bbd lib/util: don't SMB_ASSERT() in process_exists_by_pid()
Just return false...

metze
2012-08-24 13:43:32 +02:00
Michael Adam
471a853e34 lib/util: add server_id_set_disconnected() and server_id_is_disconnected()
Utility functions for handling the special placeholder server-id value
for disconnected clients (to be used for durable handles).

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
3cdf441da1 lib/util: let server_id_str() skip the task_id if 0 in the cluster case too
server_id_from_string() already handles that case.

metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
d4a0aeb49a lib/util: add server_id_from_string()
metze
2012-08-17 20:07:07 +02:00
Stefan Metzmacher
8149623ad4 lib/util: add server_id_equal()
metze
2012-08-17 20:07:07 +02:00
Jeremy Allison
3e476e184d Add debugs to functions. Add pidfile_unlink(). 2012-07-19 16:08:16 -07:00
Jeremy Allison
2922fdaaf0 Move source4/smbd/pidfile into lib/util in preparation for making it in common. 2012-07-19 15:41:52 -07:00
Rusty Russell
1f8b574adb talloc_stack: abort in developer me if no stackframe on talloc_tos()
Don't tolerate leaks in developer mode.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:27 +09:30
Rusty Russell
fe72740e82 loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.
They use talloc_tos() internally: hoist that up to the callers, some
of whom don't want to us talloc_tos().

A simple patch, but hits a lot of files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 15:07:23 +09:30
Rusty Russell
a620fc0372 lib/util/modules.c: fix stackframe leak.
do_smb_load_module() doesn't free its stackframe on success.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 05:02:31 +09:30
Rusty Russell
84fb37fe37 talloc_stack: report lazy freeing (panic if DEVELOPER).
talloc_stackframe() stacks, so if you forget to free one, the outer
one will free it.  However, it's not a good idea to rely too heavily
on this behaviour: it can lead to delays in the release of memory or
destructors.

I had an elaborate hack to make sure every talloc_stackframe() was
freed in the exact same function it was allocated, however all bugs it
caught were simply lazy freeing, so this patch just checks for that.

This doesn't check for stackframes we don't free up on exit: that would
be nice, but uncovers some uncomfortable (but probably harmless) cases.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:57:31 +09:30
Rusty Russell
f9b51ff33e talloc_stack: always include the location when creating a talloc_stackframe().
Much better for debugging.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:56:31 +09:30
Rusty Russell
311281c2c5 talloc_stack: handle more than one talloc_stackframe_pool()
The only reason we make one stackframe parent of the next is so we use
our parent's pool.  That doesn't make sense if we're a new pool, and
wouldn't work anyway.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-18 04:55:31 +09:30
Andrew Bartlett
1013fab5f8 lib/util: Allocate enough space to reference blob->data[len]
Found by Thomas Hood <jdthood@gmail.com> using valgrind.

Thanks!

Andrew Bartlett
2012-07-13 08:12:17 +02:00
Rusty Russell
74bf0c6ec6 ntdb: make --disable-ntdb work properly.
As per bug #9024, make --disable-ntdb work again.

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

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Wed Jul  4 08:11:33 CEST 2012 on sn-devel-104
2012-07-04 08:11:33 +02:00
Jeremy Allison
ec9aae6251 Ensure we select the correct syscall numbers on a 32-bit Linux system. 2012-07-02 18:38:14 -07:00
Jeremy Allison
f81fd1ccc3 Try and fix the autoconf build on Solaris/Nexenta/etc.
Their AC_TRY_RUN doesn't include any current CPPFLAGS. Make
the set[res]uid checks independent of this. Needs a small
change to the waf build in order to code with the change.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jun 30 00:32:36 CEST 2012 on sn-devel-104
2012-06-30 00:32:36 +02:00
Stefan Metzmacher
3c3ed70690 lib/util: fix fd leak in anonymous_shared_allocate() if MAP_ANON is not available
metze
2012-06-29 15:21:10 +02:00
Jeremy Allison
485787f0df Move back to using per-thread credentials on Linux. Fixes the glibc native AIO lost wakeup problem.
See this post:

https://lists.samba.org/archive/samba-technical/2012-June/085101.html

for details.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 29 03:57:45 CEST 2012 on sn-devel-104
2012-06-29 03:57:45 +02:00
Jeremy Allison
821bd95156 Replace all uses of setXX[ug]id() and setgroups with samba_setXX[ug]id() calls.
Will allow thread-specific credentials to be added by modifying
the central definitions. Deliberately left the setXX[ug]id()
call in popt as this is not used in Samba.
2012-06-28 17:15:16 -07:00
Rusty Russell
fc9b298761 util_tdb: move timeout chainlock variants from source3/lib/util/util_tdb.c
We're about to use them for dbwrap.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
02bacf1f95 util: util_ntdb ntdb_fetch_int32/ntdb_store_int32 and ntdb_add_int32_atomic
Similar to the util_tdb versions, but return the error code.

ntdb_add_int32_atomic seems a clearer name than tdb_change_int32_atomic.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
348159d1e4 util: util_ntdb.c gets NTDB_ERROR => NTSTATUS map.
Very similar to the tdb version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
88ad365caf util: util_ntdb.c gains bystring functions.
Very similar to the util_tdb versions, but these return the error.
I've only implemented those functions actually used.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
8113d53bb4 util: ntdb_new() supports NTDB_CLEAR_IF_FIRST.
There are various issues with NTDB_CLEAR_IF_FIRST which makes it
better if we don't have to use it, but much of the code does, so
we fake up support here.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
735290f474 util: util_ntdb.c
The first function is ntdb_new: this is preferred over ntdb_open, as
it makes the ntdb_context returned (and all NTDB_DATA returned from
ntdb_fetch) valid talloc pointers.

The API is very similar to tdb_wrap_open().

Note that we handle $TDB_NO_FSYNC here, since ntdb doesn't do that
hack (and it's great for speeding up testing!).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-22 07:35:17 +02:00
Rusty Russell
2fc3265873 lib/util_tdb: depend directly on tdb, not tdb_compat.
Simple change, as we get rid of tdb_compat in favour of tdb directly.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:07 +02:00
Rusty Russell
6244f668a3 TDB2: make SAMBA use tdb1 again for the moment.
Otherwise the following surgery will break the SAMBA build and testsuite.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-06-19 05:38:05 +02:00
Jelmer Vernooij
ce10a7a673 lib/util: Fix typo in comment. 2012-06-15 01:18:08 +02:00
Michael Adam
89f95c0027 lib/util: fix use of a non-existent word (existant) in a comment 2012-06-12 07:21:41 +02:00
Andrew Bartlett
c2094e3131 debug: Do not constantly rename logs when max log size = 0
In Samba4, the max log size parameter is not yet connected, so maxlog is 0

This means that we would, on receipt of a -HUP, have all child
processes attempt a rename.

Now we have the -HUP mean we reopen the logs unconditionally, and then
we see if the log is too large (samba3 mode) or simply proceed assuming
that someone else has renamed the logs for us.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Jun 11 13:34:43 CEST 2012 on sn-devel-104
2012-06-11 13:34:43 +02:00
Rusty Russell
03767f5f5a samba_util: mark smb_panic as _NORETURN_.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Autobuild-User(master): Rusty Russell <rusty@rustcorp.com.au>
Autobuild-Date(master): Fri Jun  8 09:14:26 CEST 2012 on sn-devel-104
2012-06-08 09:14:26 +02:00
Björn Jacke
15cebf38c1 util: fix build on platforms without IPv6 support
something like this on World IPv6 Day II ... ;-)

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Thu Jun  7 03:09:49 CEST 2012 on sn-devel-104
2012-06-07 03:09:49 +02:00
Andrew Bartlett
e9d797e153 lib/replace: Merge remaining xattr test details from lib/util
I prefer the longer XATTR_ADDITIONAL_OPTIONS define and the NULL
rather than 0 values in the getxattr test.

Andrew Bartlett
2012-06-02 02:13:49 +02:00
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