The branch, v3-6-stable has been updated via 0356de9 WHATSNEW: Prepare release notes for 3.6.11. via af874a7 ntlm_auth(1): fix format and make examples visible (bug #9569) via 9f09687 Fix bug #9471 - SEGV when using second vfs module. via a3f5202 Fix bug #9196 - defer_open is triggered multiple times on the same request. via 2b8c53d Fix bug 9548: Correctly detect O_DIRECT (cherry picked from commit c89f3ddd5db2de099e5b871d41553637d35e4097) via 5be19ac lib/replace: Add missing check for sys/wait.h via 68082b1 lib/replace: Add ucontext configure autoconf checks. via 5e1f60f lib/replace: Include sys/ucontext.h if available. via afb78ae tevent: Fix bug 9550 - sigprocmask does not work on FreeBSD to stop further signals in a signal handler via 5bbb6b6 configure: Fix bug 9546, aio_suspend detection on FreeBSD from acd5be0 WHATSNEW: Start release notes for Samba 3.6.11.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-stable - Log ----------------------------------------------------------------- commit 0356de9521fbd72ecf0f1707563b44227a182eed Author: Karolin Seeger <ksee...@samba.org> Date: Fri Jan 18 11:23:51 2013 +0100 WHATSNEW: Prepare release notes for 3.6.11. Karolin (cherry picked from commit 090d346017d5b3afb1baaa26d3c05ecb721fbd24) commit af874a7a96dd119673d473f332cd6efa20a8df85 Author: Björn Baumbach <b...@sernet.de> Date: Tue Dec 4 10:54:05 2012 +0100 ntlm_auth(1): fix format and make examples visible (bug #9569) "<example>" is no child of "<para>". So these examples were not visible. Using a varlist instead may be not the best way but it does look nice. Signed-off-by: Björn Baumbach <b...@sernet.de> Reviewed-by: Michael Adam <ob...@samba.org> Reviewed-by: Volker Lendecke <v...@samba.org> (cherry picked from commit cabc89a1e72fc95300d4b6f8d480a7d666221b8b) (cherry picked from commit 2cd0314f1fe47ac30e0df6791ff27850b09e6d83) commit 9f096874faef1162f04f00641710aacb685b0c40 Author: Tsukasa Hamano <ham...@osstech.co.jp> Date: Thu Dec 6 13:01:33 2012 -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 <j...@samba.org> Reviewed-by: Michael Adam <ob...@samba.org> Autobuild-User(master): Michael Adam <ob...@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) commit a3f5202cfeb48b64ffe9958b35c477c9d4f68788 Author: Jeremy Allison <j...@samba.org> Date: Fri Dec 14 08:56:52 2012 -0800 Fix bug #9196 - defer_open is triggered multiple times on the same request. get_deferred_open_message_state_smb2() is buggy in that it is checking the wrong things to determine if an open is in the deferred state. It checks if (smb2req->async == NULL) which is incorrect, as we're not always async in a deferred open - remove this. It should check instead state->open_was_deferred as this is explicity set to 'true' when an open is going deferred, so add this check. Signed-off-by: Jeremy Allison <j...@samba.org> (cherry picked from commit a8658bcb67927282288af5a579e3e66d3eaaac7b) commit 2b8c53d70129a7d364de00d220a547ec7bc900b2 Author: Volker Lendecke <v...@samba.org> Date: Sat Jan 12 16:08:07 2013 +0100 Fix bug 9548: Correctly detect O_DIRECT (cherry picked from commit c89f3ddd5db2de099e5b871d41553637d35e4097) commit 5be19aca9d07397bc49f3539aa8d358f561430b0 Author: Jeremy Allison <j...@samba.org> Date: Mon Jan 14 15:06:12 2013 -0800 lib/replace: Add missing check for sys/wait.h Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 8de4edd42cf16bd761a6acc2c8b5656d088969a7) commit 68082b1fc0b23921dd0ffc86d07f3f37f09224ea Author: Jeremy Allison <j...@samba.org> Date: Tue Jan 15 10:16:27 2013 -0800 lib/replace: Add ucontext configure autoconf checks. Signed-off-by: Jeremy Allison <j...@samba.org> (cherry picked from commit d78f760280473c35b33d4f17d31528dd6269405a) commit 5e1f60fbd3b7094d8790d3f089b3d38dd7490227 Author: Jeremy Allison <j...@samba.org> Date: Mon Jan 14 15:21:52 2013 -0800 lib/replace: Include sys/ucontext.h if available. Signed-off-by: Jeremy Allison <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> (cherry picked from commit 9a21bc35c565210767e71f4bc03a558fe61bdbc8) commit afb78ae9c048079c933eb6f6e7adcaf1ad40e7c2 Author: Jeremy Allison <j...@samba.org> Date: Mon Jan 14 15:22:11 2013 -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 <j...@samba.org> Reviewed-by: Stefan Metzmacher <me...@samba.org> Autobuild-User(master): Stefan Metzmacher <me...@samba.org> Autobuild-Date(master): Tue Jan 15 12:13:43 CET 2013 on sn-devel-104 (cherry picked from commit 64a29fdf0e3ec9138e946bab03ad28a965f3ebd0) commit 5bbb6b6a6504ac03c8a8ce38b78f851d0f063129 Author: Volker Lendecke <v...@samba.org> Date: Mon Jan 7 11:06:15 2013 +0100 configure: Fix bug 9546, aio_suspend detection on FreeBSD NULL is not defined without some includes (cherry picked from commit 653ebe132287ba66ef54675a3b58988994f0a486) ----------------------------------------------------------------------- Summary of changes: WHATSNEW.txt | 19 +++- docs-xml/manpages-3/ntlm_auth.1.xml | 195 +++++++++++++++++++---------------- lib/replace/libreplace.m4 | 36 +++++-- lib/replace/system/wait.h | 4 + lib/tevent/tevent_signal.c | 29 +++++ lib/util/debug.c | 2 +- source3/configure.in | 2 +- source3/smbd/smb2_create.c | 6 +- 8 files changed, 188 insertions(+), 105 deletions(-) Changeset truncated at 500 lines: diff --git a/WHATSNEW.txt b/WHATSNEW.txt index 9b7c8bb..6599766 100644 --- a/WHATSNEW.txt +++ b/WHATSNEW.txt @@ -8,12 +8,29 @@ This is is the latest stable release of Samba 3.6. Major enhancements in Samba 3.6.11 include: -o +o defer_open is triggered multiple times on the same request (bug #9196). +o Fix SEGV wh_n using second vfs module (bug #9471). + Changes since 3.6.10: -------------------- o Jeremy Allison <j...@samba.org> + * BUG 9196: defer_open is triggered multiple times on the same request. + * BUG 9550: Mask off signals the correct way from the signal handler. + + +o Björn Baumbach <b...@sernet.de> + * BUG 9569: ntlm_auth.1: Fix format and make examples visible. + + +o Tsukasa Hamano <ham...@osstech.co.jp> + * BUG 9471: Fix SEGV when using second vfs module. + + +o Volker Lendecke <v...@samba.org> + * BUG 9548: Correctly detect O_DIRECT. + * BUG 9546: Fix aio_suspend detection on FreeBSD. ###################################################################### diff --git a/docs-xml/manpages-3/ntlm_auth.1.xml b/docs-xml/manpages-3/ntlm_auth.1.xml index dcf9b42..ffbbf05 100644 --- a/docs-xml/manpages-3/ntlm_auth.1.xml +++ b/docs-xml/manpages-3/ntlm_auth.1.xml @@ -160,111 +160,132 @@ external program to the helper are:</para> <variablelist> <varlistentry> - <term>Username</term> - - <listitem><para>The username, expected to be in - Samba's <smbconfoption name="unix charset"/>. - </para> - - <para><example>Username: bob</example></para> - <para><example>Username:: Ym9i</example></para> - </listitem></varlistentry> + <term>Username</term> + <listitem><para>The username, expected to be in + Samba's <smbconfoption name="unix charset"/>. + </para> + <varlistentry> + <term>Examples:</term> + <para>Username: bob</para> + <para>Username:: Ym9i</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>NT-Domain</term> - <listitem><para>The user's domain, expected to be in - Samba's <smbconfoption name="unix charset"/>. - </para> - - <para><example>NT-Domain: WORKGROUP</example></para> - <para><example>NT-Domain:: V09SS0dST1VQ</example></para> - </listitem></varlistentry> + <term>NT-Domain</term> + <listitem><para>The user's domain, expected to be in + Samba's <smbconfoption name="unix charset"/>. + </para> + + <varlistentry> + <term>Examples:</term> + <para>NT-Domain: WORKGROUP</para> + <para>NT-Domain:: V09SS0dST1VQ</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>Full-Username</term> - <listitem><para>The fully qualified username, expected to be in - Samba's <smbconfoption name="unix charset"/> and qualified with the - <smbconfoption name="winbind separator"/>. - </para> - - <para><example>Full-Username: WORKGROUP\bob</example></para> - <para><example>Full-Username:: V09SS0dST1VQYm9i</example></para> - </listitem></varlistentry> + <term>Full-Username</term> + <listitem><para>The fully qualified username, expected to be + in Samba's <smbconfoption name="unix charset"/> and qualified + with the <smbconfoption name="winbind separator"/>.</para> + <varlistentry> + <term>Examples:</term> + <para>Full-Username: WORKGROUP\bob</para> + <para>Full-Username:: V09SS0dST1VQYm9i</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>LANMAN-Challenge</term> - - <listitem><para>The 8 byte <command>LANMAN Challenge</command> value, - generated randomly by the server, or (in cases such as - MSCHAPv2) generated in some way by both the server and - the client. - </para> - <para><example>LANMAN-Challenge: 0102030405060708</example></para> - </listitem></varlistentry> + <term>LANMAN-Challenge</term> + <listitem><para>The 8 byte <command>LANMAN Challenge</command> + value, generated randomly by the server, or (in cases such + as MSCHAPv2) generated in some way by both the server and + the client.</para> + <varlistentry> + <term>Examples:</term> + <para>LANMAN-Challenge: 0102030405060708</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>LANMAN-Response</term> - - <listitem><para>The 24 byte <command>LANMAN Response</command> value, - calculated from the user's password and the supplied - <command>LANMAN Challenge</command>. Typically, this - is provided over the network by a client wishing to authenticate. - </para> - <para><example>LANMAN-Response: 0102030405060708090A0B0C0D0E0F101112131415161718</example></para> - - </listitem></varlistentry> + <term>LANMAN-Response</term> + <listitem><para>The 24 byte <command>LANMAN Response</command> value, + calculated from the user's password and the supplied + <command>LANMAN Challenge</command>. Typically, this + is provided over the network by a client wishing to authenticate. + </para> + <varlistentry> + <term>Examples:</term> + <para>LANMAN-Response: 0102030405060708090A0B0C0D0E0F101112131415161718</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>NT-Response</term> - <listitem><para>The >= 24 byte <command>NT Response</command> - calculated from the user's password and the supplied - <command>LANMAN Challenge</command>. Typically, this is - provided over the network by a client wishing to authenticate. - </para> - <para><example>NT-Response: 0102030405060708090A0B0C0D0E0F101112131415161718</example></para> - - </listitem></varlistentry> + <term>NT-Response</term> + <listitem><para>The >= 24 byte <command>NT Response</command> + calculated from the user's password and the supplied + <command>LANMAN Challenge</command>. Typically, this is + provided over the network by a client wishing to authenticate. + </para> + <varlistentry> + <term>Examples:</term> + <para>NT-Response: 0102030405060708090A0B0C0D0E0F10111213141516171</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>Password</term> - <listitem><para>The user's password. This would be - provided by a network client, if the helper is being - used in a legacy situation that exposes plaintext - passwords in this way. - </para> - <para><example>Password: samba2</example></para> - <para><example>Password:: c2FtYmEy</example></para> - - </listitem></varlistentry> + <term>Password</term> + <listitem><para>The user's password. This would be + provided by a network client, if the helper is being + used in a legacy situation that exposes plaintext + passwords in this way.</para> + <varlistentry> + <term>Examples:</term> + <para>Password: samba2</para> + <para>Password:: c2FtYmEy</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>Request-User-Session-Key</term> - <listitem><para>Upon successful authenticaiton, return - the user session key associated with the login. - </para> - <para><example>Request-User-Session-Key: Yes</example></para> - - </listitem></varlistentry> + <term>Request-User-Session-Key</term> + <listitem><para>Upon successful authenticaiton, return + the user session key associated with the login.</para> + <varlistentry> + <term>Examples:</term> + <para>Request-User-Session-Key: Yes</para> + </varlistentry> + </listitem> + </varlistentry> <varlistentry> - <term>Request-LanMan-Session-Key</term> - <listitem><para>Upon successful authenticaiton, return - the LANMAN session key associated with the login. - </para> - <para><example>Request-LanMan-Session-Key: Yes</example></para> - - </listitem></varlistentry> - - <para><warning>Implementers should take care to base64 encode - any data (such as usernames/passwords) that may contain malicous user data, such as - a newline. They may also need to decode strings from - the helper, which likewise may have been base64 encoded.</warning></para> - </variablelist> - + <term>Request-LanMan-Session-Key</term> + <listitem><para>Upon successful authenticaiton, return + the LANMAN session key associated with the login. + </para> + <varlistentry> + <term>Examples:</term> + <para>Request-LanMan-Session-Key: Yes</para> + </varlistentry> + </listitem> + </varlistentry> + + </variablelist> </listitem> </varlistentry> - </variablelist> - </listitem> + </variablelist> + <warning><para>Implementers should take care to base64 encode + any data (such as usernames/passwords) that may contain malicous user data, such as + a newline. They may also need to decode strings from + the helper, which likewise may have been base64 encoded.</para></warning> + </listitem> </varlistentry> <varlistentry> diff --git a/lib/replace/libreplace.m4 b/lib/replace/libreplace.m4 index 808d5d1..67f8e3f 100644 --- a/lib/replace/libreplace.m4 +++ b/lib/replace/libreplace.m4 @@ -66,7 +66,7 @@ AC_FUNC_MEMCMP AC_CHECK_FUNCS([pipe strftime srandom random srand rand usleep setbuffer lstat getpgrp utime utimes]) AC_CHECK_HEADERS(stdbool.h stdint.h sys/select.h) -AC_CHECK_HEADERS(setjmp.h utime.h) +AC_CHECK_HEADERS(setjmp.h utime.h sys/wait.h) LIBREPLACE_PROVIDE_HEADER([stdint.h]) LIBREPLACE_PROVIDE_HEADER([stdbool.h]) @@ -105,6 +105,7 @@ AC_CHECK_HEADERS(stdarg.h vararg.h) AC_CHECK_HEADERS(sys/mount.h mntent.h) AC_CHECK_HEADERS(stropts.h) AC_CHECK_HEADERS(unix.h) +AC_CHECK_HEADERS(sys/ucontext.h) AC_CHECK_FUNCS(seteuid setresuid setegid setresgid chroot bzero strerror strerror_r) AC_CHECK_FUNCS(vsyslog setlinebuf mktime ftruncate chsize rename) @@ -266,6 +267,16 @@ if test x"$libreplace_cv_sig_atomic_t" = x"yes"; then fi +dnl Check if the C compiler understands volatile (it should, being ANSI). +AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [ + AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0], + libreplace_cv_volatile=yes,libreplace_cv_volatile=no)]) +if test x"$libreplace_cv_volatile" = x"yes"; then + AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) +fi + +m4_include(system/config.m4) + AC_CACHE_CHECK([for O_DIRECT flag to open(2)],libreplace_cv_HAVE_OPEN_O_DIRECT,[ AC_TRY_COMPILE([ #include <unistd.h> @@ -278,17 +289,6 @@ if test x"$libreplace_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT]) fi - -dnl Check if the C compiler understands volatile (it should, being ANSI). -AC_CACHE_CHECK([that the C compiler understands volatile],libreplace_cv_volatile, [ - AC_TRY_COMPILE([#include <sys/types.h>],[volatile int i = 0], - libreplace_cv_volatile=yes,libreplace_cv_volatile=no)]) -if test x"$libreplace_cv_volatile" = x"yes"; then - AC_DEFINE(HAVE_VOLATILE, 1, [Whether the C compiler understands volatile]) -fi - -m4_include(system/config.m4) - m4_include(dlfcn.m4) m4_include(getpass.m4) m4_include(strptime.m4) @@ -326,6 +326,18 @@ if test x"$libreplace_cv_struct_timespec" = x"yes"; then AC_DEFINE(HAVE_STRUCT_TIMESPEC,1,[Whether we have struct timespec]) fi +AC_CACHE_CHECK([for ucontext_t type],libreplace_cv_ucontext_t, [ + AC_TRY_COMPILE([ +#include <signal.h> +#if HAVE_SYS_UCONTEXT_H +#include <sys/ucontext.h> +# endif +],[ucontext_t uc; sigaddset(&uc.uc_sigmask, SIGUSR1);], + libreplace_cv_ucontext_t=yes,libreplace_cv_ucontext_t=no)]) +if test x"$libreplace_cv_ucontext_t" = x"yes"; then + AC_DEFINE(HAVE_UCONTEXT_T,1,[Whether we have ucontext_t]) +fi + AC_CHECK_FUNCS([printf memset memcpy],,[AC_MSG_ERROR([Required function not found])]) echo "LIBREPLACE_BROKEN_CHECKS: END" diff --git a/lib/replace/system/wait.h b/lib/replace/system/wait.h index f0c3bdc..146c61a 100644 --- a/lib/replace/system/wait.h +++ b/lib/replace/system/wait.h @@ -40,6 +40,10 @@ #include <setjmp.h> #endif +#ifdef HAVE_SYS_UCONTEXT_H +#include <sys/ucontext.h> +#endif + #if !defined(HAVE_SIG_ATOMIC_T_TYPE) typedef int sig_atomic_t; #endif diff --git a/lib/tevent/tevent_signal.c b/lib/tevent/tevent_signal.c index b790859..cc7fb0a 100644 --- a/lib/tevent/tevent_signal.c +++ b/lib/tevent/tevent_signal.c @@ -122,10 +122,39 @@ static void tevent_common_signal_handler_info(int signum, siginfo_t *info, if (count+1 == TEVENT_SA_INFO_QUEUE_COUNT) { /* we've filled the info array - block this signal until these ones are delivered */ +#ifdef HAVE_UCONTEXT_T + /* + * This is the only way for this to work. + * By default signum is blocked inside this + * signal handler using a temporary mask, + * but what we really need to do now is + * block it in the callers mask, so it + * stays blocked when the temporary signal + * handler mask is replaced when we return + * from here. The callers mask can be found + * in the ucontext_t passed in as the + * void *uctx argument. + */ + ucontext_t *ucp = (ucontext_t *)uctx; + sigaddset(&ucp->uc_sigmask, signum); +#else + /* + * WARNING !!! WARNING !!!! + * + * This code doesn't work. + * By default signum is blocked inside this + * signal handler, but calling sigprocmask + * modifies the temporary signal mask being + * used *inside* this handler, which will be + * replaced by the callers signal mask once + * we return from here. See Samba + * bug #9550 for details. + */ sigset_t set; sigemptyset(&set); sigaddset(&set, signum); sigprocmask(SIG_BLOCK, &set, NULL); +#endif TEVENT_SIG_INCREMENT(sig_state->sig_blocked[signum]); } } diff --git a/lib/util/debug.c b/lib/util/debug.c index 108161e..efe6988 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -953,7 +953,7 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) slprintf(header_str + hs_len, sizeof(header_str) -1 - hs_len, ", class=%s", - default_classname_table[cls]); + classname_table[cls]); } /* Print it all out at once to prevent split syslog output. */ diff --git a/source3/configure.in b/source3/configure.in index a298183..0f805ee 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -5877,7 +5877,7 @@ int main() { struct aiocb a; return aio_cancel(1, &a); }], AC_MSG_CHECKING(for aio_suspend) AC_LINK_IFELSE([#include <aio.h> -int main() { struct aiocb a; return aio_suspend(&a, 1, NULL); }], +int main() { struct aiocb a; struct timespec t; return aio_suspend(&a, 1, &t); }], [AC_DEFINE(HAVE_AIO_SUSPEND, 1, [Have aio_suspend]) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) fi diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c index 5a9044d..5b81099 100644 --- a/source3/smbd/smb2_create.c +++ b/source3/smbd/smb2_create.c @@ -893,9 +893,6 @@ bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req, if (!smb2req) { return false; } - if (!smb2req->async) { - return false; - } req = smb2req->subreq; if (!req) { return false; @@ -904,6 +901,9 @@ bool get_deferred_open_message_state_smb2(struct smbd_smb2_request *smb2req, if (!state) { return false; } + if (!state->open_was_deferred) { + return false; + } if (p_request_time) { *p_request_time = state->request_time; } -- Samba Shared Repository