Stefan Metzmacher [Wed, 16 Oct 2013 12:17:49 +0000 (14:17 +0200)]
CVE-2013-4408:async_sock: add some overflow detection to read_packet_handler()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10185
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Michael Adam [Fri, 14 Oct 2011 12:05:09 +0000 (14:05 +0200)]
libreplace: add a missing "eval" to the AC_VERIFY_C_PROTOTYPE macro
Without this eval, upon test success the corresponding actions
(like defining corresponding variables) are not taken.
Found by Timur I. Bakeyev, and based on his patch for 3.5.
(cherry picked from commit
0ef506d4f31d206c300e4f3f326edac2b60bdc15)
(cherry picked from commit
e98d3b7648fe298f03e408ab91b8b53904bab8ca)
David Disseldorp [Mon, 3 Jun 2013 11:00:31 +0000 (13:00 +0200)]
Bug 8997: change libreplace GPL source to LGPL
libreplace currently includes socket.c and getifaddrs.c both of which
are GPL licensed.
Although not required, talloc and tdb build alongside this source,
leading to some ambiguity regarding their LGPL licences.
The following copyright holders have agreed to the GPL->LGPL change:
lib/replace/getifaddrs.c
Copyright (C) Andrew Tridgell 1998
Copyright (C) Jeremy Allison 2007
Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
lib/replace/test/getifaddrs.c
lib/replace/socket.c
* Copyright (C) Michael Adam <obnox@samba.org> 2008
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
8a6743e4edcdff1c7860d150720483f19f3b33bb)
(cherry picked from commit
acae464f7fedd96bbddaed5227756328ea0fe32d)
Tsukasa Hamano [Thu, 6 Dec 2012 21:01:33 +0000 (13:01 -0800)]
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
(cherry picked from commit
16d725b4f5ed77db865e2a3c27ae0eb4accca5a8)
(cherry picked from commit
25eb1af07cc09e5e019a0702c60a763cc3266196)
(cherry picked from commit
82db35cdb426355e4b7fd7ecf1ce9d9fca59ecd3)
Volker Lendecke [Sat, 12 Jan 2013 15:08:07 +0000 (16:08 +0100)]
Fix bug 9548: Correctly detect O_DIRECT
(cherry picked from commit
c89f3ddd5db2de099e5b871d41553637d35e4097)
Jeremy Allison [Mon, 14 Jan 2013 23:06:12 +0000 (15:06 -0800)]
lib/replace: Add missing check for sys/wait.h
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
8de4edd42cf16bd761a6acc2c8b5656d088969a7)
Jeremy Allison [Tue, 15 Jan 2013 18:16:27 +0000 (10:16 -0800)]
lib/replace: Add ucontext configure autoconf checks.
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
d78f760280473c35b33d4f17d31528dd6269405a)
Jeremy Allison [Mon, 14 Jan 2013 23:21:52 +0000 (15:21 -0800)]
lib/replace: Include sys/ucontext.h if available.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
9a21bc35c565210767e71f4bc03a558fe61bdbc8)
Jeremy Allison [Mon, 14 Jan 2013 23:22:11 +0000 (15:22 -0800)]
tevent: Fix bug 9550 - sigprocmask does not work on FreeBSD to stop further signals in a signal handler
Mask off signals the correct way from the signal handler.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Jan 15 12:13:43 CET 2013 on sn-devel-104
(cherry picked from commit
64a29fdf0e3ec9138e946bab03ad28a965f3ebd0)
Stefan Metzmacher [Fri, 9 Nov 2012 07:59:36 +0000 (08:59 +0100)]
lib/addns: don't depend on the order in resp->answers[]
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
eecc1d294256210ee8c2f6ab79d21b835258a6d4)
The last 2 patches address bug #9402 - lib/addns doesn't work samba4 with a
bind9 server.
(cherry picked from commit
abb142b4db54ecf17e3b05c374e9d51c6ddc4e04)
Stefan Metzmacher [Fri, 9 Nov 2012 07:55:40 +0000 (08:55 +0100)]
lib/addns: remove pointless check for resp->num_additionals != 1
We never use resp->additionals, so there's no reason to check.
This fixes dns updates against BIND9 (used in a Samba4 domain).
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit
b59c5db5f74f56c0536635a41ae51c389109ceb5)
(cherry picked from commit
0a836951838a1aa70b1f6ade4ad09d4e6cee3c24)
Stefan Metzmacher [Tue, 13 Nov 2012 13:07:11 +0000 (14:07 +0100)]
lib/replace: replace all *printf function if we replace snprintf (bug #9390)
This fixes segfaults in log level = 10 on Solaris.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Björn Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Wed Nov 14 19:41:14 CET 2012 on sn-devel-104
(cherry picked from commit
a15da3625850d97b3da1b02308c870f820007c52)
(cherry picked from commit
364a70cc4d5aea4006ceb3dde97779242afa328c)
Jelmer Vernooij [Sun, 13 May 2012 01:21:34 +0000 (03:21 +0200)]
libreplace: Fix symbol names for snprintf/asprintf/vasprintf.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun May 13 05:16:28 CEST 2012 on sn-devel-104
(cherry picked from commit
cf67da70c9a63c4dc63f287059321d6c36d1e19e)
(cherry picked from commit
c0d91f8cdfd99286644b57b02d6b5517774081de)
Stefan Metzmacher [Fri, 2 Nov 2012 12:56:53 +0000 (13:56 +0100)]
lib/tsocket: optimize syscalls in tstream_readv_pdu_send()
Once we've got the first part of a pdu we try to optimize
readv calls for the rest of the pdu.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
7f83d75a3a666ca1bc6213433344b8017eb4932a)
Stefan Metzmacher [Fri, 2 Nov 2012 12:45:49 +0000 (13:45 +0100)]
lib/tsocket: disable the syscall optimization for recvfrom/readv by default
We only do the optimization on recvfrom/readv if the caller asked for it.
This is needed because in most cases we preferr to flush send
buffers before receiving incoming requests.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit
53aa9727b8157ca1ad6c59ef9ebbb9f519b33f1e)
Matthieu Patou [Thu, 27 Sep 2012 08:22:57 +0000 (01:22 -0700)]
lib-addns: ensure that allocated buffer are pre set to 0 (bug #9259)
It avoid bugs when one of the buffer is supposed to contain a string
that is not null terminated (ie. label->label) and that we don't force
the last byte to 0.
(similar to commit
03c4dceaab82ca2c60c9ce0e09fddd071f98087b)
(cherry picked from commit
1ecbacc354fff78c51c24cc08072881bb3f10d2b)
Joachim Schmitz [Mon, 17 Sep 2012 12:26:31 +0000 (05:26 -0700)]
libreplace: Bug 8107, Fix poll replacement to become a msleep replacement
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
7542b63188f7e73588c9abb40e36a910c87bc534)
(cherry picked from commit
6b4169a75fb3180dec1f57b0eb39312ca82cd1ac)
Björn Jacke [Sun, 16 Sep 2012 00:21:39 +0000 (02:21 +0200)]
replace: add some includes for poll.h
See bug #8107
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Sun Sep 16 04:05:08 CEST 2012 on sn-devel-104
(cherry picked from commit
520c9b0b0ae33e6e8fb78034cfff685f5491aab3)
(cherry picked from commit
ea96d79e21a549204a7f64307059ea877bfb9fd5)
(cherry picked from commit
757dc4d753275d42b8dbf2710290b3dbfb9f3cda)
Volker Lendecke [Mon, 8 Oct 2012 19:02:43 +0000 (12:02 -0700)]
tdb: Make tdb robust against improper CLEAR_IF_FIRST restart
When winbind is restarted, there is a potential crash in tdb. Following
situation: We are in a cluster with ctdb. A winbind child hangs
in a request to the DC. Cluster monitoring decides the node has a
problem. Cluster monitoring decides to kill ctdbd. winbind child
still hangs in a RPC request. winbind parent figures that ctdb is
dead and immediately commits suicide. winbind parent is restarted by
cluster management, overwriting gencache.tdb with CLEAR_IF_FIRST. The
CLEAR_IF_FIRST logic as implemented now will not see that a child still
has the tdb open, only the parent holds the ACTIVE_LOCK due to performance
reasons. During the CLEAR_IF_FIRST logic is done, there is a very small
window where we ftruncate(tfd, 0) the file and re-write a proper header
without a lock. When during this small window the winbind child comes
back, wanting to store something into gencache.tdb, that winbind child
will crash with a SIGBUS.
Sounds unlikely? See:
[2012/09/29 07:02:31.871607, 0] lib/util.c:1183(smb_panic)
PANIC (pid
1814517): internal error
[2012/09/29 07:02:31.877596, 0] lib/util.c:1287(log_stack_trace)
BACKTRACE: 35 stack frames:
#0 winbindd(log_stack_trace+0x1a) [0x7feb7d4ca18a]
#1 winbindd(smb_panic+0x2b) [0x7feb7d4ca25b]
#2 winbindd(+0x1a3cc4) [0x7feb7d4bacc4]
#3 /lib64/libc.so.6(+0x32900) [0x7feb7a929900]
#4 /lib64/libc.so.6(memcpy+0x35) [0x7feb7a97f355]
#5 /usr/lib64/libtdb.so.1(+0x6e76) [0x7feb7b0b0e76]
#6 /usr/lib64/libtdb.so.1(+0x3d37) [0x7feb7b0add37]
#7 /usr/lib64/libtdb.so.1(+0x863d) [0x7feb7b0b263d]
#8 /usr/lib64/libtdb.so.1(+0x8700) [0x7feb7b0b2700]
#9 /usr/lib64/libtdb.so.1(+0x2505) [0x7feb7b0ac505]
#10 /usr/lib64/libtdb.so.1(+0x25b7) [0x7feb7b0ac5b7]
#11 /usr/lib64/libtdb.so.1(tdb_fetch+0x13) [0x7feb7b0ac633]
#12 winbindd(gencache_set_data_blob+0x259) [0x7feb7d4d8449]
#13 winbindd(gencache_set+0x53) [0x7feb7d4d85b3]
#14 winbindd(gencache_del+0x5e) [0x7feb7d4d879e]
#15 winbindd(saf_delete+0x93) [0x7feb7d54b693]
#16 winbindd(+0xe507e) [0x7feb7d3fc07e]
#17 winbindd(+0xe85e5) [0x7feb7d3ff5e5]
#18 winbindd(+0xe65be) [0x7feb7d3fd5be]
#19 winbindd(+0xe7562) [0x7feb7d3fe562]
#20 winbindd(init_dc_connection+0x2e) [0x7feb7d3fe5be]
#21 winbindd(+0xe75d9) [0x7feb7d3fe5d9]
#22 winbindd(cm_connect_netlogon+0x58) [0x7feb7d3fe658]
#23 winbindd(_wbint_PingDc+0x61) [0x7feb7d410991]
#24 winbindd(+0x103175) [0x7feb7d41a175]
#25 winbindd(winbindd_dual_ndrcmd+0xb7) [0x7feb7d4107d7]
#26 winbindd(+0xf8609) [0x7feb7d40f609]
#27 winbindd(+0xf9075) [0x7feb7d410075]
#28 winbindd(tevent_common_loop_immediate+0xe8) [0x7feb7d4db198]
#29 winbindd(run_events_poll+0x3c) [0x7feb7d4d93fc]
#30 winbindd(+0x1c2b52) [0x7feb7d4d9b52]
#31 winbindd(_tevent_loop_once+0x90) [0x7feb7d4d9f60]
#32 winbindd(main+0x7b3) [0x7feb7d3e7aa3]
#33 /lib64/libc.so.6(__libc_start_main+0xfd) [0x7feb7a915cdd]
#34 winbindd(+0xce2a9) [0x7feb7d3e52a9]
This is in a winbind child, logfiles surrounding indicate the parent
was restarted.
This patch takes all chain locks around the CLEAR_IF_FIRST introduced
tdb_new_database.
(cherry picked from commit
15a3dfbc15de1e214e9aee57d7d83de60fe747bd)
Rusty Russell [Mon, 8 Oct 2012 18:56:47 +0000 (11:56 -0700)]
tdb: Make robust against shrinking tdbs
When probing for a size change (eg. just before tdb_expand, tdb_check,
tdb_rescue) we call tdb_oob(tdb, tdb->map_size, 1, 1). Unfortunately
this does nothing if the tdb has actually shrunk, which as Volker
demonstrated, can actually happen if a "longlived" parent crashes.
So move the map/update size/remap before the limit check.
(cherry picked from commit
e7e86fcb929e7b8e7d879349d5f7f9422126a3a2)
Jura Sasek [Tue, 24 Jul 2012 18:58:58 +0000 (20:58 +0200)]
Fix bug #9037 - Name clash in MD5 cause...
... the "net ads join" fails on T4 (sun4v) systems on Solaris 10.
(cherry picked from commit
c6673d9d2161ff1d8491f6cbc0b6ea0be03cdf4d)
Jeremy Allison [Thu, 31 May 2012 19:19:53 +0000 (21:19 +0200)]
Fix bug #8627: Crash bug in dns_create_probe.
Fix crash bug in dns_create_probe when dns_create_update fails.
(cherry picked from commit
ddad733a2166fb629157298a54a5ccc10a6b11fe)
Joseph Tam [Thu, 19 Apr 2012 18:46:16 +0000 (11:46 -0700)]
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
(cherry picked from commit
00d5f32025bf13285ab3f8ffae914107c9eca275)
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
50973b96e2e5bf1f8a434a8be986e359a9e3b3e5)
Ira Cooper [Sat, 4 Feb 2012 00:47:18 +0000 (16:47 -0800)]
s3-popt: Fix configure.developer builds on Solaris.
alloca.h needs to be included, or the build complains the implicit
definition of alloca.
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Feb 4 03:27:42 CET 2012 on sn-devel-104
(cherry picked from commit
74ca6d1ddb1c5a4fbe9ddb29566878efe1761897)
Fix bug #8743 (configure.developer build is broken).
(cherry picked from commit
9269f41229368b2614880718e710fd461b28196f)
Ira Cooper [Tue, 31 Jan 2012 20:15:36 +0000 (12:15 -0800)]
Fix bug #8729 - getpass regressions on Solaris/Illumos - 3.6 and
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Tue Jan 31 23:28:09 CET 2012 on sn-devel-104
(cherry picked from commit
a1901b55cfa658f39a33d0ea120641f56453fe4e)
(cherry picked from commit
6fdeb105904803d5402619419d4dc8bcc4423c35)
Andrew Bartlett [Mon, 9 May 2011 15:43:45 +0000 (17:43 +0200)]
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
(cherry picked from commit
5db0cd55d4db9cc71f32dc0097e2f014c22967bc)
Fix bug #8623 (Crash when trying to browse samba printers).
(cherry picked from commit
3651471288ebd05108c9cd7f1bdbb844829244fb)
Volker Lendecke [Thu, 1 Sep 2011 14:55:03 +0000 (16:55 +0200)]
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
(cherry picked from commit
1d4de78f567e908e0acc218630fceb0884b07d65)
(cherry picked from commit
7d2006ccf58555e82bc957aa62beab6420fcbc48)
Volker Lendecke [Mon, 22 Aug 2011 12:16:26 +0000 (14:16 +0200)]
s3: Fix bug 8385
Poll and select behave differently regarding error handling. When doing the
connect(2), we can not rely on poll telling us both readability and writability
upon error. Just always try a second connect(2). At least on Linux it returns 0
when it succeeded.
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Thu Aug 25 19:39:12 CEST 2011 on sn-devel-104
(cherry picked from commit
50e30afa608dfdeae8a260730ead9761ed424dad)
(cherry picked from commit
45392d05ff059987fb76d3818969177b5a5de6b0)
Andrew Tridgell [Thu, 4 Aug 2011 02:07:19 +0000 (12:07 +1000)]
talloc: check block count aftter references test
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit
73677875b46251f59b66c9713f1decc89bd2ea3e)
The last 7 patches address bug #8384 (Windows XP clients seem to crash smbd
process every once in a while).
(cherry picked from commit
8d46b29595c4da27b175b25a08b945fbeeeab3ec)
Andrew Tridgell [Fri, 29 Jul 2011 01:57:07 +0000 (11:57 +1000)]
talloc: added test suite for talloc_free_children()
this tests the fix from Simo
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Fri Jul 29 11:30:13 CEST 2011 on sn-devel-104
(cherry picked from commit
d004fd0b53fb6f3ae64f0e24cf51f4471d434574)
(cherry picked from commit
2e07c662b08f8bba5cc03efcdcc13165e392b6e8)
Jelmer Vernooij [Sun, 24 Apr 2011 00:39:14 +0000 (02:39 +0200)]
Fix license info for talloc in manpage.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sun Apr 24 03:27:54 CEST 2011 on sn-devel-104
(cherry picked from commit
fb05e82c99f0779bd44371a2bdafdd7147448dd5)
(cherry picked from commit
39b7c96517995d2b14e19a006cb18ef642cb98ff)
Matthias Dieter Wallnöfer [Thu, 24 Mar 2011 08:41:19 +0000 (09:41 +0100)]
talloc - improve doxygen comment of "talloc_move"
Express better that this should be a pointer of a pointer.
Reviewed-by: Tridge
(cherry picked from commit
6723e90d524c8e73f19c06b3ff28867a1a89b14b)
(cherry picked from commit
0c5a41da1375bab225274833ba149ba47df42aec)
Matthias Dieter Wallnöfer [Thu, 31 Mar 2011 19:32:51 +0000 (21:32 +0200)]
talloc - some documentation changes
- Fix some typos
- Document better the differences in the behaviour between talloc 1.X and 2.X.
Previously this seemed a bit spongy to me.
Reviewed-by: Jelmer + Tridge
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Mon Apr 4 11:05:42 CEST 2011 on sn-devel-104
(cherry picked from commit
513574afd759bcb3832374d3ae170f1ed0b0062b)
(cherry picked from commit
db9670dd163432d6758a81c5aa6000c13e61b14a)
Simo Sorce [Wed, 27 Jul 2011 16:02:35 +0000 (12:02 -0400)]
talloc: preserve context name on talloc_free_children()
Otherwise tc->name will end up pointing to garbage when it is not
set to a const but rather to a string allocate as child of the context itself.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
(cherry picked from commit
52182a528117c4dd9624f64b34a873c0903ad70a)
(cherry picked from commit
99495ea4d28de530fedc11c94d36bc304cf9ae4a)
Andrew Tridgell [Mon, 8 Aug 2011 08:24:32 +0000 (18:24 +1000)]
talloc: ensure the sibling linked list remains valid during a free
This ensures that the sibling list of a pointer doesn't become invalid
during a free operation. It is an alternative fix to the fix in
6f51a1f45bf4de062cce7a562477e8140630a53d, and avoids the problem of
trying to calculate the parent pointer early
This should fix the subtle spoolss talloc bug that Simo found
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Tue Aug 9 01:53:17 CEST 2011 on sn-devel-104
(cherry picked from commit
cf986f200804ce873b43c1ecf2d5e1bd08eb8a25)
(cherry picked from commit
07554082cc9d286ca0628179c9e7f7a493016a57)
Herb Lewis [Thu, 2 Jun 2011 17:10:39 +0000 (10:10 -0700)]
Fix warning messages on Freebsd 4.6.2.
Signed-off-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit
f0901792324425804592ac7032e3853b4d4c7829)
Fix bug #8365 (backport compiler warnings).
(cherry picked from commit
7039bbcd96a780965d69668d6541d316f7a4cd56)
Jeremy Allison [Mon, 1 Aug 2011 18:49:10 +0000 (11:49 -0700)]
Fix bug 7462 - Non-standard SA_RESETHAND is used in ...lib/tevent/tevent_signal.c
Make SA_RESETHAND conditional on its existance.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Aug 1 22:03:45 CEST 2011 on sn-devel-104
(cherry picked from commit
0c67efdd68b9808542c090b9fd9920e4e37d85d0)
(cherry picked from commit
4b4155c7235d8ec0c93324a782bc815ef08a7ba3)
Günther Deschner [Fri, 10 Jun 2011 13:00:10 +0000 (15:00 +0200)]
lib/util/wrap_xattr.h: fix licence/copyright
Guenther
(cherry picked from commit
d228fc35f38b77877f0fd07b415df87d4ccdb812)
(cherry picked from commit
50ba4af1d34692235387e9eed3d14effcf74754a)
Günther Deschner [Fri, 10 Jun 2011 12:59:58 +0000 (14:59 +0200)]
lib/util/util_tdb.h: fix licence/copyright
Guenther
(cherry picked from commit
eaa400216570403e67f7f06db509ce90fba02c13)
(cherry picked from commit
2bd94a7079be9ef2134316e9d99cb4b882f2f466)
Günther Deschner [Fri, 10 Jun 2011 12:59:48 +0000 (14:59 +0200)]
lib/util/util_ldb.h: fix licence/copyright
Guenther
(cherry picked from commit
4fe4487cd9391cac813ab94d7002eac6dc722f4c)
(cherry picked from commit
3f0333d1d13780f83f3fdba296d0f6d7cc756d2a)
Günther Deschner [Fri, 10 Jun 2011 12:59:35 +0000 (14:59 +0200)]
lib/util/time.h: fix licence/copyright
Guenther
(cherry picked from commit
74610109ac3140713140038d10df644024796907)
(cherry picked from commit
3475b7222b2e291be93facecff878ff9f699b875)
Günther Deschner [Fri, 10 Jun 2011 12:59:23 +0000 (14:59 +0200)]
lib/util/data_blob.h: fix licence/copyright
Guenther
(cherry picked from commit
a602cb2a0a0bc19121232444117486d8286e0af9)
(cherry picked from commit
f0a78248e9fb383dcaa9902f3184edfe0ef9eda2)
Jeremy Allison [Fri, 3 Jun 2011 17:22:44 +0000 (10:22 -0700)]
Fix bug #8197 - winbind does not properly detect when a DC connection is dead.
Only waiting for writability doesn't get fd errors back with poll.
So always begin by selecting for readability, and if we get it then
see if bytes were available to read or it really is an error condition.
If bytes were available, remove the select on read as we know we
will retrieve the error when we've finished writing and start
reading the reply (or the write will timeout or fail).
Metze and Volker please check.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Jun 6 21:53:16 CEST 2011 on sn-devel-104
(cherry picked from commit
0efcc94fb834aeb03e8edc3034aa0cdeefdc0985)
(cherry picked from commit
92248f6e51f1e46de8c1a1304b2d48914f21e841)
Jeremy Allison [Fri, 3 Jun 2011 19:31:11 +0000 (12:31 -0700)]
Fix the poll() backend to correctly respond to POLLHUP|POLLERR returns on a fd selected for TEVENT_FD_WRITE only.
Don't trigger the write handler and remove the POLLOUT flag for this fd. Report errors on TEVENT_FD_READ requests only.
Metze please check !
Jeremy.
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Fri Jun 3 22:53:52 CEST 2011 on sn-devel-104
(cherry picked from commit
dbcdf3e39c359241b743a9455ae695e14a30caa9)
(cherry picked from commit
4da2f8a8c578568d1e9a4770166c46240fce6664)
Björn Jacke [Tue, 31 May 2011 07:47:17 +0000 (09:47 +0200)]
replace: remove waring if IOV_MAX is not defined
as discussed on samba-techincal we currelty don't rely on it and we don't want
to flood this warning message during compile.
Autobuild-User: Björn Jacke <bj@sernet.de>
Autobuild-Date: Tue May 31 18:36:53 CEST 2011 on sn-devel-104
(cherry picked from commit
65f0800a34270ff0c779c9f3feb63b02d3ec800f)
Fix bug #7998 (fails to build on Hurd because of undefined IOV_MAX or
UIO_MAXIOV).
(cherry picked from commit
65a59d62f82f7a042b05f7a6f527d70c86f6e352)
Samuel Thibault [Fri, 3 Jun 2011 18:34:16 +0000 (20:34 +0200)]
Fix bug #7998.
(fails to build on Hurd because of undefined IOV_MAX or
UIO_MAXIOV)
(cherry picked from commit
af5f3ddc46b455163f0b322051230ba1886ea69e)
Jeremy Allison [Tue, 24 May 2011 19:47:31 +0000 (12:47 -0700)]
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
(cherry picked from commit
e719dfd4dc178f001a5f804fb1ac4e587574415f)
Fix bug #8163 (asn.1 library does not correctly read negative integers).
(cherry picked from commit
859d13141cd831488b60e413f7141514ae4464b5)
Jeremy Allison [Thu, 19 May 2011 19:32:15 +0000 (12:32 -0700)]
Fix bug 8153 found when building on an IPv6-only system by Kai Blin.
When building on IPv6-only, doing:
hints.ai_family = AF_INET;
getaddrinfo("0.0.0.0", NULL, &hints, &ppres)
fails as AF_INET is unavailable on an IPv6-only system. This
causes us to fallback to our replacement getaddrinfo code
which is IPv4-only.
As we're only trying to detect a specific AIX bug here,
broaden the tests to find that bug, and also test for
working getaddrinfo in an IPv6-only safe way.
(cherry picked from commit
85468960ebdb3d813bd863e57f6dca6bab61bec2)
Stefan Metzmacher [Tue, 17 May 2011 06:50:45 +0000 (08:50 +0200)]
talloc: splitout _talloc_free_children_internal()
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 17 10:49:13 CEST 2011 on sn-devel-104
(cherry picked from commit
df2cb2f672569e5d113fe2e77fdc1ee16c8b646d)
The last 9 patches address bug #8140 (talloc: valgrind false positives and other
backports).
(cherry picked from commit
7304370a2423230120a9ceebd1016966658f713f)
Stefan Metzmacher [Fri, 8 Apr 2011 10:30:46 +0000 (12:30 +0200)]
talloc: fixed a use after free error in talloc_free_children()
This is similar to commit
6f51a1f45bf4de062cce7a562477e8140630a53d.
metze
(cherry picked from commit
38633c9f0b7f86673f08903999583ad5b62c3548)
(cherry picked from commit
e3ff6f5bbe09913b45ea1aef613c8790b25a978c)
Stefan Metzmacher [Fri, 8 Apr 2011 10:27:05 +0000 (12:27 +0200)]
talloc: use _talloc_free_internal() in talloc_free_children()
metze
(cherry picked from commit
f3b855d2ff9576715afe50d75678829c6bc0842d)
(cherry picked from commit
d54493b4b43cc0d299486e571d813f90a7b22059)
Stefan Metzmacher [Mon, 16 May 2011 17:25:47 +0000 (19:25 +0200)]
talloc: test talloc_steal out of a talloc_pool
metze
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Tue May 17 09:43:01 CEST 2011 on sn-devel-104
(cherry picked from commit
37b2130ed9612a7334888ecd2fee26b0b45ac271)
(cherry picked from commit
ac6bb22a8c054e5949e07f563bf9fba46d22358d)
Stefan Metzmacher [Tue, 17 May 2011 06:20:13 +0000 (08:20 +0200)]
talloc: add memset() calls to test_pool()
This way we the pool based valgrind code.
metze
(cherry picked from commit
16cc52cf70a9918843f9761baf483338c80bf1d0)
(cherry picked from commit
ade2fe7e8fc299e01ba13a08c95598eefa5b99b5)
Stefan Metzmacher [Tue, 17 May 2011 06:19:04 +0000 (08:19 +0200)]
talloc: setup the new 'tc' before TC_UNDEFINE_GROW_CHUNK() _talloc_realloc()
metze
(cherry picked from commit
c281f2fc1a359d0d3b91b94438f11bb7c88170b5)
(cherry picked from commit
75ce3de1eb2e7042c7a4ffcb6f0f6aa2a41c19b5)
Stefan Metzmacher [Mon, 16 May 2011 18:15:59 +0000 (20:15 +0200)]
talloc: make really sure only optimize realloc if there's only one pool chunk
*talloc_pool_objectcount(pool_tc) == 2 doesn't mean the one of the objects
is the pool itself! So we better check for == 1 and calculate the chunk count.
metze
(cherry picked from commit
7102105c8954627dc30a851327cf2642ac0783d5)
(cherry picked from commit
8e95d3201adc546000ca29816c83aba6fab52b1a)
Stefan Metzmacher [Mon, 16 May 2011 18:23:13 +0000 (20:23 +0200)]
talloc: make use of _talloc_free_poolmem() in _talloc_realloc()
This should follow the same logic...
metze
(cherry picked from commit
14b662ee4f278764b9dfd620851e908d29f29fc4)
(cherry picked from commit
dc8b2979168c6688c647cdc39d321eb54bd0aa5b)
Stefan Metzmacher [Mon, 16 May 2011 17:06:07 +0000 (19:06 +0200)]
talloc: split the handling of FLAG_POOL/FLAG_POOLMEM in _talloc_free_internal
The optimization of the object_count == 1 case should only happen
for when we're not destroying the pool itself. And it should only
happen if the pool itself is still valid.
If the pool isn't valid (it has TALLOC_FLAG_FREE),
object_count == 1 does not mean that the pool is the last object,
which can happen if you use talloc_steal/move() on memory
from the pool and then free the pool itself.
Thanks to Volker for noticing this!
metze
(cherry picked from commit
2d514be1ed3b8245157a0a51186ec7f9db828202)
(cherry picked from commit
4cf761bb5a030340625172a51212b11613efea02)
Andrew Bartlett [Wed, 4 May 2011 00:28:15 +0000 (10:28 +1000)]
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
(cherry picked from commit
14750139639b3531e57a3ca3f9e481d6e458dc06)
(cherry picked from commit
a7f39847ebf29b821aab2570a2f2bd841a28e836)
Andrew Bartlett [Mon, 2 May 2011 05:23:08 +0000 (15:23 +1000)]
lib/util Move more network utility functions from source3 into lib/util
This will help with the merge of the interfaces layer.
Andrew Bartlett
(cherry picked from commit
fbea52f74a80268446f45936a0cf40400aba8565)
(cherry picked from commit
007b781b39e4bd2ddc25ab6bd2b6f9b88dfdba8b)
Andreas Schneider [Thu, 14 Apr 2011 09:59:57 +0000 (11:59 +0200)]
libsmbconf: Define a doxygen group for libsmbconf.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
e71f9a431b5ad506ab15b616597624d8833e5ff4)
Andreas Schneider [Thu, 14 Apr 2011 09:54:11 +0000 (11:54 +0200)]
libsmbconf: Document smbconf_transaction_cancel().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
1e8282f45b6e8633c2e25b6484fdb1ce3dfb053a)
Andreas Schneider [Thu, 14 Apr 2011 09:53:25 +0000 (11:53 +0200)]
libsmbconf: Document smbconf_transaction_commit().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
4e381dc571207df44d8024e7bab83ab116011bea)
Andreas Schneider [Thu, 14 Apr 2011 09:52:30 +0000 (11:52 +0200)]
libsmbconf: Document smbconf_transaction_start().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
addb4d3e2305d6ce72d4ccaef7063080acfcbcb0)
Andreas Schneider [Thu, 14 Apr 2011 09:50:05 +0000 (11:50 +0200)]
libsmbconf: Document smbconf_delete_global_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
4a06f0f5651be52f8b000c4968fb2d7617178ba2)
Andreas Schneider [Thu, 14 Apr 2011 09:49:24 +0000 (11:49 +0200)]
libsmbconf: Document smbconf_delete_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
d5adb46d31a2d0c832d139a6e5f9c7bf2a81b12c)
Andreas Schneider [Thu, 14 Apr 2011 09:48:15 +0000 (11:48 +0200)]
libsmbconf: Document smbconf_set_global_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
91feef25fda403130beba39d4554cf4873c85ba5)
Andreas Schneider [Thu, 14 Apr 2011 09:47:41 +0000 (11:47 +0200)]
libsmbconf: Document smbconf_set_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
fcee6a60428974dfef97ca701de5495d465dd1c1)
Andreas Schneider [Thu, 14 Apr 2011 09:45:14 +0000 (11:45 +0200)]
libsmbconf: Document smbconf_get_global_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
3591652d34512b5f583a922f31372ace86674c7e)
Andreas Schneider [Thu, 14 Apr 2011 09:44:22 +0000 (11:44 +0200)]
libsmbconf: Document smbconf_get_includes().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
bc8a5dfba86dd222c6d96cd7b9a31b49475ce46b)
Andreas Schneider [Thu, 14 Apr 2011 09:38:31 +0000 (11:38 +0200)]
libsmbconf: Document smbconf_delete_global_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
799cfd951a796ed75bd75f980bb26dc35b65f29f)
Andreas Schneider [Thu, 14 Apr 2011 09:37:59 +0000 (11:37 +0200)]
libsmbconf: Document smbconf_delete_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
b35b30b3e3162e9895ba6f9e7719d4e0d1ebb4ea)
Andreas Schneider [Thu, 14 Apr 2011 09:36:36 +0000 (11:36 +0200)]
libsmbconf: Document smbconf_get_global_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
247ad89ee50fd2205cc02eb2f7d8902c1b75a7ad)
Andreas Schneider [Thu, 14 Apr 2011 09:35:11 +0000 (11:35 +0200)]
libsmbconf: Document smbconf_get_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
53aa10a277262efd48489fb8eab49b5b4fdb2e39)
Andreas Schneider [Thu, 14 Apr 2011 09:32:06 +0000 (11:32 +0200)]
libsmbconf: Document smbconf_set_global_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
24af63e25f11fde79b1675f0d3c6e3b10fc69a04)
Andreas Schneider [Thu, 14 Apr 2011 09:31:17 +0000 (11:31 +0200)]
libsmbconf: Document smbconf_set_parameter().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
9adfc49801340fb9bb3a1d558387502e232efa2e)
Andreas Schneider [Thu, 14 Apr 2011 09:28:00 +0000 (11:28 +0200)]
libsmbconf: Document smbconf_delete_share().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
dc8464b73ce65744b7d57b3fd9db4a0d537fcb8b)
Andreas Schneider [Thu, 14 Apr 2011 09:27:03 +0000 (11:27 +0200)]
libsmbconf: Document smbconf_get_share().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
adc8fef73400095e387061b7ccff81059b117326)
Andreas Schneider [Thu, 14 Apr 2011 09:25:07 +0000 (11:25 +0200)]
libsmbconf: Document smbconf_create_share().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
bc30d4bd6b5dba59f284015f7d3e885e4c450db6)
Andreas Schneider [Thu, 14 Apr 2011 09:23:56 +0000 (11:23 +0200)]
libsmbconf: Document smbconf_share_exists().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
315bda5d483fcb18a242236837dedb56ad289b48)
Andreas Schneider [Thu, 14 Apr 2011 09:22:25 +0000 (11:22 +0200)]
libsmbconf: Document smbconf_get_share_names().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
32bafa560b4b76e9f01e1e82fd18168ba4266081)
Andreas Schneider [Thu, 14 Apr 2011 09:19:36 +0000 (11:19 +0200)]
libsmbconf: Document smbconf_get_config().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
8692501da1bc3823282730588546238fb795df6b)
Andreas Schneider [Thu, 14 Apr 2011 09:13:49 +0000 (11:13 +0200)]
libsmbconf: Document smbconf_drop().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
256fd665747bdb499381e6146a4a0f06f82fd8e2)
Andreas Schneider [Thu, 14 Apr 2011 09:12:27 +0000 (11:12 +0200)]
libsmbconf: Document smbconf_changed().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
1b97a85d0e077e57bc16ffc3c72c03d92474de41)
Andreas Schneider [Thu, 14 Apr 2011 09:05:09 +0000 (11:05 +0200)]
libsmbconf: Document smbconf_shutdown().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
62030ee6a7f076220fef0ef290a3c463c9cd9c46)
Andreas Schneider [Thu, 14 Apr 2011 09:04:15 +0000 (11:04 +0200)]
libsmbconf: Document smbconf_is_writeable().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
e4c38b088e0e873f2f6fac7cc0fe741161f3460a)
Andreas Schneider [Thu, 14 Apr 2011 09:02:49 +0000 (11:02 +0200)]
libsmbconf: Document smbconf_backend_requires_messaging().
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
15d285af2d933a55cf1ac3a4f878691938a825e5)
Andreas Schneider [Mon, 11 Apr 2011 15:43:10 +0000 (17:43 +0200)]
libsmbconf: Convert smbconf_get_config() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
1ff05452834487fd6243810550bc1cfd129fc49e)
Andreas Schneider [Mon, 11 Apr 2011 15:24:13 +0000 (17:24 +0200)]
libsmbconf: Convert smbconf_transaction_*() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
ea45d9def1ff704f766694a1059c15fc0301f0c0)
Andreas Schneider [Mon, 11 Apr 2011 14:01:22 +0000 (16:01 +0200)]
libsmbconf: Convert smbconf_delete_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
3d8e524e317a46c77d568df99601f545d4dead34)
Andreas Schneider [Mon, 11 Apr 2011 13:14:52 +0000 (15:14 +0200)]
libsmbconf: Convert smbconf_set_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
3fcc6ac19a30ae67f8062669a16811768c2c0abd)
Andreas Schneider [Mon, 11 Apr 2011 12:52:52 +0000 (14:52 +0200)]
libsmbconf: Convert smbconf_get_includes() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
8aa9d9ad67c2c14a5139b4d55427a048972f789e)
Andreas Schneider [Mon, 11 Apr 2011 12:20:32 +0000 (14:20 +0200)]
libsmbconf: Convert smbconf_delete_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
48a7ab68261d8cb4d2efa03e141cdff28deb6905)
Andreas Schneider [Mon, 11 Apr 2011 11:50:53 +0000 (13:50 +0200)]
libsmbconf: Convert smbconf_get_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
d3ced52e92d47e766bc1e43ef1a02ec435e2a7f5)
Andreas Schneider [Mon, 11 Apr 2011 11:23:26 +0000 (13:23 +0200)]
libsmbconf: Convert smbconf_set_parameter() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
6eae520879c0a99e6ed7eef005b359e8a3411665)
Andreas Schneider [Mon, 11 Apr 2011 09:39:03 +0000 (11:39 +0200)]
libsmbconf: Convert smbconf_delete_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
9eb03a5a0a95020e1a374167ce4425b1010ea9c7)
Andreas Schneider [Fri, 8 Apr 2011 15:20:35 +0000 (17:20 +0200)]
libsmbconf: Convert smbconf_get_share() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
347e52d94f366ae9d0d4d57b39d127b0ad2ea24e)
Andreas Schneider [Fri, 8 Apr 2011 13:48:01 +0000 (15:48 +0200)]
libsmbconf: Convert smbconf_create_share() to smbErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
5d9bbcb724a01325f9bdd469dabbb707d25480bc)
Andreas Schneider [Fri, 8 Apr 2011 12:19:15 +0000 (14:19 +0200)]
libsmbconf: Convert smbconf_get_share_names() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
feee7659cbd019f3dd1bf7bf7b4c2d9f82dd6b50)
Andreas Schneider [Fri, 8 Apr 2011 08:40:02 +0000 (10:40 +0200)]
libsmbconf: Convert smbconf_drop() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
1ed47a5889a84deb6422b3ed9c7fd5928d171827)
Andreas Schneider [Fri, 8 Apr 2011 08:28:17 +0000 (10:28 +0200)]
libsmbconf: Convert smbconf_open() to sbcErr.
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit
a686e99bf57fa09df10ce863f918850f74308150)