[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Mon Apr 23 11:53:03 MDT 2012


The branch, master has been updated
       via  5b5b696 Fix bug #8882 - Broken processing of %U with vfs_full_audit when force user is set.
       via  fbaaf4b Add complete test program for Linux kernel aio inside configure.in (I discovered yesterday there are systems with only half the glibc changes needed to implement userspace kaio.
      from  5960b7b s4-libnet Always return after composite_error()

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 5b5b696c1e36dc7f81da24158e0853290084dec8
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 20 17:52:57 2012 -0700

    Fix bug #8882 - Broken processing of %U with vfs_full_audit when force user is set.
    
    When doing a "force user" we need to remember what the "sanitized_username"
    was from the original connect.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Mon Apr 23 19:52:19 CEST 2012 on sn-devel-104

commit fbaaf4b21fd7253d333261ba925e8f40122335e8
Author: Jeremy Allison <jra at samba.org>
Date:   Fri Apr 20 15:53:55 2012 -0700

    Add complete test program for Linux kernel aio inside configure.in (I discovered yesterday there are systems with only half the glibc changes needed to implement userspace kaio.

-----------------------------------------------------------------------

Summary of changes:
 source3/configure.in   |   34 ++++++++++++++++++++++++++++------
 source3/smbd/service.c |   11 +++++++++++
 2 files changed, 39 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/configure.in b/source3/configure.in
index 35bbe28..56112e9 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -5545,12 +5545,34 @@ if test x"$samba_cv_HAVE_AIO" = x"yes"; then
 # Check for Linux kernel aio support.
 	case "$host_os" in
 	*linux*)
-	    AC_MSG_CHECKING(for Linux kernel asynchronous io support)
-	    AC_CHECK_LIB(aio,io_submit,
-		[AIO_LIBS="$LIBS -laio";
-		AC_DEFINE(HAVE_LINUX_KERNEL_AIO, 1, Define to 1 if there is support for Linux kernel asynchronous io)],
-		[])
-	    if test x"$ac_cv_lib_aio_io_submit" = x"yes"; then
+	    AC_CHECK_LIB(aio,io_submit,[AIO_LIBS="$LIBS -laio"])
+	    AC_CACHE_CHECK([for Linux kernel asynchronous io support],samba_cv_HAVE_LINUX_KERNEL_AIO,[
+	    aio_LIBS=$LIBS
+	    LIBS=$AIO_LIBS
+	    AC_TRY_LINK([#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <sys/eventfd.h>
+#include <libaio.h>],
+[ struct io_event ioev;
+struct iocb *ioc;
+io_context_t ctx;
+struct timespec ts;
+int fd;
+char *buf;
+fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);
+io_queue_init(128,&ctx);
+io_prep_pwrite(ioc, 1, buf, 1, 0);
+io_prep_pread(ioc, 1, buf, 1, 0);
+io_set_eventfd(ioc, fd);
+io_set_callback(ioc, (io_callback_t)(0));
+io_submit(ctx, 1, &ioc);
+io_getevents(ctx, 1, 1, &ioev, &ts);],
+samba_cv_HAVE_LINUX_KERNEL_AIO=yes,samba_cv_HAVE_LINUX_KERNEL_AIO=no)
+		LIBS=$aio_LIBS])
+	    if test x"$samba_cv_HAVE_LINUX_KERNEL_AIO" = x"yes"; then
+		AC_DEFINE(WITH_AIO, 1, [Using asynchronous io])
 		default_shared_modules="$default_shared_modules vfs_aio_linux"
 	    fi
             ;;
diff --git a/source3/smbd/service.c b/source3/smbd/service.c
index 914cec8..6a2df18 100644
--- a/source3/smbd/service.c
+++ b/source3/smbd/service.c
@@ -439,6 +439,7 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
 		 */
 
 		char *fuser;
+		char *sanitized_username;
 		struct auth_session_info *forced_serverinfo;
 		bool guest;
 
@@ -458,6 +459,16 @@ NTSTATUS set_conn_force_user_group(connection_struct *conn, int snum)
 			return status;
 		}
 
+		/* We don't want to replace the original sanitized_username
+		   as it is the original user given in the connect attempt.
+		   This is used in '%U' substitutions. */
+		sanitized_username = discard_const_p(char,
+			forced_serverinfo->unix_info->sanitized_username);
+		TALLOC_FREE(sanitized_username);
+		forced_serverinfo->unix_info->sanitized_username =
+			talloc_move(forced_serverinfo->unix_info,
+				&conn->session_info->unix_info->sanitized_username);
+
 		TALLOC_FREE(conn->session_info);
 		conn->session_info = forced_serverinfo;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list