[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Sun Dec 19 16:13:02 MST 2010


The branch, master has been updated
       via  49dc973 lib: Protect against tevent nterror mismatches
       via  fd49ed2 s3: "make etags" should not grow TAGS infinitely...
       via  c6b5136 s3: Fix bug 7066 -- wbcAuthenticateEx gives unix times
       via  92e138f s3: Use the right uid winbindd_raw_kerberos_login()
       via  a881d6a wb_reqtrans is not used in libwbclient
       via  c0a7c9f Move wbc_async.[ch] to its only user: smbtorture3
       via  6bfd745 libwbclient: Put the wb_reqtrans definitions into wb_reqtrans.h
       via  a159958 s3: wcache_invalidate_samlogon only needs the SID
       via  e113b1c s3: netsamlogon_clear_cached_user only needs the SID
       via  ff5f767 s3: Remove two pointless slprintf calls
       via  d39feda s3: FreeBSD has getpeereid(), use it
       via  d082701 s3: Reply correctly to FSCTL_IS_VOLUME_DIRTY
       via  356add8 s3: Fix some nonempty blank lines
       via  cf74a48 s3: Did I say this module is from hell?
       via  98a2fff s3: re-add some debugs to check_reduced_name
       via  43e42b4 s3: Fix some typos
       via  a4bcabc s3: Document wbinfo -P/--ping-dc
       via  af4a5f4 s3: Add -P as an alias for --ping-dc
       via  d60d49e s3: Fix serverid_exists
      from  1ca3534 heimdal: Fix build if using system roken.

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


- Log -----------------------------------------------------------------
commit 49dc973586b4b9b72ffcac3bbb5dc7fda0d1ad4e
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 19 14:22:28 2010 +0100

    lib: Protect against tevent nterror mismatches
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Mon Dec 20 00:12:02 CET 2010 on sn-devel-104

commit fd49ed238c5e82c8444eec35a09c32c191b76074
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Dec 19 14:00:05 2010 +0100

    s3: "make etags" should not grow TAGS infinitely...

commit c6b5136f02fc15618dc5fc0d0560ef4b3901d123
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 18 16:02:09 2010 +0100

    s3: Fix bug 7066 -- wbcAuthenticateEx gives unix times
    
    We might eventually want to change this, but right now we get unix times
    out of the winbind pipe struct

commit 92e138f920126f417a20bc49aebe0c3cbab5056d
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 11 10:29:57 2010 +0100

    s3: Use the right uid winbindd_raw_kerberos_login()

commit a881d6ab867a1d28c08a993a6212bd8bbdea6038
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 8 19:51:14 2010 +0100

    wb_reqtrans is not used in libwbclient

commit c0a7c9f99188ebb3cd27094b9364449bcc2f80d8
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 8 20:11:46 2010 +0100

    Move wbc_async.[ch] to its only user: smbtorture3

commit 6bfd745c61458308c3a05a1678cf6507d1a8a375
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 8 20:06:03 2010 +0100

    libwbclient: Put the wb_reqtrans definitions into wb_reqtrans.h

commit a159958065e195413f459a82643c780d80b6c088
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 11 14:27:54 2010 +0100

    s3: wcache_invalidate_samlogon only needs the SID

commit e113b1c64f1dfd84911050379d06d9ffc4958db3
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 11 14:19:50 2010 +0100

    s3: netsamlogon_clear_cached_user only needs the SID

commit ff5f767d0e31ea0c5311ce48d8e0387eebd84ce8
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 11 14:16:51 2010 +0100

    s3: Remove two pointless slprintf calls

commit d39fedaa69b20e8f29fff9cd9a09c1bb1ecec7be
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 10 23:02:19 2010 +0100

    s3: FreeBSD has getpeereid(), use it

commit d082701ea5131b02a49321ef29d1aa58a80ee92a
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 10 08:48:19 2010 -0700

    s3: Reply correctly to FSCTL_IS_VOLUME_DIRTY

commit 356add8a638b737cf72181beaa13342ab920ace8
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 10 19:59:06 2010 +0100

    s3: Fix some nonempty blank lines

commit cf74a4857c051b43b1f6a06b714a93a65e8a1f90
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 7 14:40:13 2010 +0100

    s3: Did I say this module is from hell?

commit 98a2fff2e5dbcc6f125136f94ff552c3fb05cc01
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Nov 30 18:21:46 2010 +0100

    s3: re-add some debugs to check_reduced_name

commit 43e42b4e77244602e6eb85f64bfc9d50d1c5f6ab
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 6 14:05:49 2010 +0100

    s3: Fix some typos

commit a4bcabc726077a2ad598c87cd10cdae14d45d99a
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 4 18:47:56 2010 +0100

    s3: Document wbinfo -P/--ping-dc

commit af4a5f4c13a60e1522c05663cc00dc339b6150ed
Author: Volker Lendecke <vl at samba.org>
Date:   Sat Dec 4 18:43:27 2010 +0100

    s3: Add -P as an alias for --ping-dc
    
    This is a much less intrusive version of the DC connectivity check
    than wbinfo -t is. Make it simple to use.

commit d60d49efb06475a3994fa65d17a72a2b930b20d4
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Dec 3 01:34:02 2010 -0700

    s3: Fix serverid_exists
    
    In the cluster case it can happen that a node just died and we did not yet have
    the time to clean up serverid.tdb. If the corresponding serverid.tdb record
    that represented a process was migrated away from the dead record, it
    represents existence of a process where it is already dead.

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

Summary of changes:
 docs-xml/manpages-3/vfs_crossrename.8.xml          |    2 +-
 docs-xml/manpages-3/wbinfo.1.xml                   |   10 +++
 lib/util/tevent_ntstatus.c                         |   26 +++++++-
 nsswitch/wbinfo.c                                  |    5 +-
 source3/Makefile.in                                |    7 +-
 source3/auth/server_info.c                         |    8 ++-
 source3/configure.in                               |   12 ++++
 source3/include/ntioctl.h                          |    1 +
 source3/include/proto.h                            |    2 +-
 source3/lib/serverid.c                             |    4 +
 source3/lib/system.c                               |    4 +
 source3/lib/util_sock.c                            |    2 +-
 .../libwbclient => source3/lib}/wb_reqtrans.c      |    2 +-
 source3/lib/wb_reqtrans.h                          |   61 ++++++++++++++++++++
 source3/libsmb/samlogon_cache.c                    |   16 ++----
 source3/modules/vfs_shadow_copy2.c                 |    2 +-
 source3/smbd/filename.c                            |    6 +-
 source3/smbd/negprot.c                             |   44 +++++++-------
 source3/smbd/nttrans.c                             |    9 +++
 source3/smbd/vfs.c                                 |    4 +-
 source3/torture/torture.c                          |    2 +-
 .../libwbclient => source3/torture}/wbc_async.c    |    2 +-
 .../libwbclient => source3/torture}/wbc_async.h    |   31 +----------
 source3/winbindd/idmap_hash/idmap_hash.c           |    2 +-
 source3/winbindd/winbindd.c                        |    2 +-
 source3/winbindd/winbindd_cache.c                  |   11 +--
 source3/winbindd/winbindd_dual.c                   |    2 +-
 source3/winbindd/winbindd_pam.c                    |   16 ++++--
 source3/winbindd/winbindd_proto.h                  |    2 +-
 source3/wscript_build                              |    6 +-
 30 files changed, 198 insertions(+), 105 deletions(-)
 rename {nsswitch/libwbclient => source3/lib}/wb_reqtrans.c (99%)
 create mode 100644 source3/lib/wb_reqtrans.h
 rename {nsswitch/libwbclient => source3/torture}/wbc_async.c (99%)
 rename {nsswitch/libwbclient => source3/torture}/wbc_async.h (82%)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/vfs_crossrename.8.xml b/docs-xml/manpages-3/vfs_crossrename.8.xml
index f5a4444..ba7c7c8 100644
--- a/docs-xml/manpages-3/vfs_crossrename.8.xml
+++ b/docs-xml/manpages-3/vfs_crossrename.8.xml
@@ -31,7 +31,7 @@
 
 	<para>The <command>vfs_crossrename</command> VFS module allows
 	server side rename operations even if source and target are on
-	differen physical devices. A "move" in Explorer is usually a
+	different physical devices. A "move" in Explorer is usually a
 	rename operation if it is inside of a single share or device.
 	Usually such a rename operation returns
 	NT_STATUS_NOT_SAME_DEVICE and the client has to move the file by
diff --git a/docs-xml/manpages-3/wbinfo.1.xml b/docs-xml/manpages-3/wbinfo.1.xml
index 720715c..f708508 100644
--- a/docs-xml/manpages-3/wbinfo.1.xml
+++ b/docs-xml/manpages-3/wbinfo.1.xml
@@ -39,6 +39,7 @@
 		<arg choice="opt">-N netbios-name</arg>
 		<arg choice="opt">--own-domain</arg>
 		<arg choice="opt">-p</arg>
+		<arg choice="opt">-P</arg>
 		<arg choice="opt">-r user</arg>
 		<arg choice="opt">--remove-uid-mapping uid,sid</arg>
 		<arg choice="opt">--remove-gid-mapping gid,sid</arg>
@@ -239,6 +240,15 @@
 		</varlistentry>
 
 		<varlistentry>
+		<term>-P|--ping-dc</term>
+		<listitem><para>Issue a no-effect command to our DC. This
+		    checks if our secure channel connection to our domain
+		    controller is still alive. It has much less impact than
+		    wbinfo -t.
+		</para></listitem>
+		</varlistentry>
+
+		<varlistentry>
 		<term>-r|--user-groups <replaceable>username</replaceable></term>
 		<listitem><para>Try to obtain the list of UNIX group ids
 		to which the user belongs.  This only works for users
diff --git a/lib/util/tevent_ntstatus.c b/lib/util/tevent_ntstatus.c
index c4dd074..764d251 100644
--- a/lib/util/tevent_ntstatus.c
+++ b/lib/util/tevent_ntstatus.c
@@ -20,12 +20,29 @@
 #include "../replace/replace.h"
 #include "tevent_ntstatus.h"
 
+#define TEVENT_NTERROR_MAGIC (0x917b5acd)
+
 bool _tevent_req_nterror(struct tevent_req *req,
 			 NTSTATUS status,
 			 const char *location)
 {
-	return _tevent_req_error(req, NT_STATUS_V(status),
-				 location);
+	uint64_t err;
+
+	if (NT_STATUS_IS_OK(status)) {
+		return false;
+	}
+
+	/*
+	 * I've put this variable here, because I'm not 100% certain
+	 * how to correctly assign a 64-bit constant and left-shift it
+	 * by 32 bits in a single expression. If anyone knows, feel
+	 * free :-)
+	 */
+	err = TEVENT_NTERROR_MAGIC;
+	err <<= 32;
+	err |= NT_STATUS_V(status);
+
+	return _tevent_req_error(req, err, location);
 }
 
 bool tevent_req_is_nterror(struct tevent_req *req, NTSTATUS *status)
@@ -44,7 +61,10 @@ bool tevent_req_is_nterror(struct tevent_req *req, NTSTATUS *status)
 		*status = NT_STATUS_NO_MEMORY;
 		break;
 	case TEVENT_REQ_USER_ERROR:
-		*status = NT_STATUS(err);
+		if ((err >> 32) != TEVENT_NTERROR_MAGIC) {
+			abort();
+		}
+		*status = NT_STATUS(err & 0xffffffff);
 		break;
 	default:
 		*status = NT_STATUS_INTERNAL_ERROR;
diff --git a/nsswitch/wbinfo.c b/nsswitch/wbinfo.c
index 801f92f..6ff66f8 100644
--- a/nsswitch/wbinfo.c
+++ b/nsswitch/wbinfo.c
@@ -1940,7 +1940,6 @@ enum {
 	OPT_VERBOSE,
 	OPT_ONLINESTATUS,
 	OPT_CHANGE_USER_PASSWORD,
-	OPT_PING_DC,
 	OPT_CCACHE_SAVE,
 	OPT_SID_TO_FULLNAME,
 	OPT_NTLMV2,
@@ -1997,7 +1996,7 @@ int main(int argc, char **argv, char **envp)
 		{ "remove-gid-mapping", 0, POPT_ARG_STRING, &string_arg, OPT_REMOVE_GID_MAPPING, "Remove gid to sid mapping in idmap", "GID,SID" },
 		{ "check-secret", 't', POPT_ARG_NONE, 0, 't', "Check shared secret" },
 		{ "change-secret", 'c', POPT_ARG_NONE, 0, 'c', "Change shared secret" },
-		{ "ping-dc", 0, POPT_ARG_NONE, 0, OPT_PING_DC,
+		{ "ping-dc", 'P', POPT_ARG_NONE, 0, 'P',
 		  "Check the NETLOGON connection" },
 		{ "trusted-domains", 'm', POPT_ARG_NONE, 0, 'm', "List trusted domains" },
 		{ "all-domains", 0, POPT_ARG_NONE, 0, OPT_LIST_ALL_DOMAINS, "List all domains (trusted and own domain)" },
@@ -2246,7 +2245,7 @@ int main(int argc, char **argv, char **envp)
 				goto done;
 			}
 			break;
-		case OPT_PING_DC:
+		case 'P':
 			if (!wbinfo_ping_dc()) {
 				d_fprintf(stderr, "Could not ping our DC\n");
 				goto done;
diff --git a/source3/Makefile.in b/source3/Makefile.in
index c1b6c8b..ce60055 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1203,8 +1203,8 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o torture/scanner.o torture/uta
 SMBTORTURE_OBJ = $(SMBTORTURE_OBJ1) $(PARAM_OBJ) $(TLDAP_OBJ) \
 	$(LIBSMB_OBJ) $(KRBCLIENT_OBJ) $(LIB_NONSMBD_OBJ) \
 	@LIBWBCLIENT_STATIC@ \
-        ../nsswitch/libwbclient/wbc_async.o \
-        ../nsswitch/libwbclient/wb_reqtrans.o \
+        torture/wbc_async.o \
+        lib/wb_reqtrans.o \
 	$(LIBMSRPC_OBJ) $(LIBMSRPC_GEN_OBJ) $(LIBCLI_ECHO_OBJ)
 
 MASKTEST_OBJ = torture/masktest.o $(PARAM_OBJ) $(LIBSMB_OBJ) $(KRBCLIENT_OBJ) \
@@ -1400,7 +1400,7 @@ WINBINDD_OBJ1 = \
 		auth/server_info_sam.o \
 		auth/user_info.o \
 		auth/pampass.o \
-		../nsswitch/libwbclient/wb_reqtrans.o
+		lib/wb_reqtrans.o
 
 WINBINDD_OBJ = \
 		$(WINBINDD_OBJ1) $(PASSDB_OBJ) $(GROUPDB_OBJ) \
@@ -3311,6 +3311,7 @@ include/build_env.h: script/build_env.sh
 proto::
 
 etags::
+	rm -f TAGS
 	find $(srcdir)/.. -name "*.[ch]" | xargs -n 100 etags --append $(ETAGS_OPTIONS)
 
 ctags::
diff --git a/source3/auth/server_info.c b/source3/auth/server_info.c
index d288a0c..01c7a96 100644
--- a/source3/auth/server_info.c
+++ b/source3/auth/server_info.c
@@ -620,9 +620,11 @@ struct netr_SamInfo3 *wbcAuthUserInfo_to_netr_SamInfo3(TALLOC_CTX *mem_ctx,
 	info3->base.last_logon = info->logon_time;
 	info3->base.last_logoff = info->logoff_time;
 	info3->base.acct_expiry = info->kickoff_time;
-	info3->base.last_password_change = info->pass_last_set_time;
-	info3->base.allow_password_change = info->pass_can_change_time;
-	info3->base.force_password_change = info->pass_must_change_time;
+	unix_to_nt_time(&info3->base.last_password_change, info->pass_last_set_time);
+	unix_to_nt_time(&info3->base.allow_password_change,
+			info->pass_can_change_time);
+	unix_to_nt_time(&info3->base.force_password_change,
+			info->pass_must_change_time);
 
 	if (info->account_name) {
 		info3->base.account_name.string	=
diff --git a/source3/configure.in b/source3/configure.in
index 5f81a19..b43d0b3 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -6353,6 +6353,18 @@ if test x"$samba_cv_HAVE_PEERCRED" = x"yes"; then
     AC_DEFINE(HAVE_PEERCRED,1,[Whether we can use SO_PEERCRED to get socket credentials])
 fi
 
+AC_CACHE_CHECK([for getpeereid],samba_cv_HAVE_GETPEEREID,[
+AC_TRY_LINK([#include <sys/types.h>
+#include <unistd.h>],
+[uid_t uid; gid_t gid; int ret;
+ ret = getpeereid(0, &uid, &gid);
+],
+samba_cv_HAVE_GETPEEREID=yes,samba_cv_HAVE_GETPEEREID=no)])
+if test x"$samba_cv_HAVE_GETPEEREID" = xyes; then
+   AC_DEFINE(HAVE_GETPEEREID,1,
+	     [Whether we have getpeereid to get socket credentials])
+fi
+
 
 #################################################
 # Check to see if we should use the included popt
diff --git a/source3/include/ntioctl.h b/source3/include/ntioctl.h
index c565b8f..41b1dce 100644
--- a/source3/include/ntioctl.h
+++ b/source3/include/ntioctl.h
@@ -38,6 +38,7 @@
 #define FSCTL_UNLOCK_VOLUME          0x0009001C
 #define FSCTL_GET_COMPRESSION        0x0009003C
 #define FSCTL_SET_COMPRESSION        0x0009C040
+#define FSCTL_IS_VOLUME_DIRTY	     0x00090078
 #define FSCTL_REQUEST_FILTER_OPLOCK  0x0009008C
 #define FSCTL_FIND_FILES_BY_SID	     0x0009008F
 #define FSCTL_FILESYS_GET_STATISTICS 0x00090090
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9583388..11060aa 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2835,7 +2835,7 @@ NTSTATUS remote_password_change(const char *remote_machine, const char *user_nam
 
 bool netsamlogon_cache_init(void);
 bool netsamlogon_cache_shutdown(void);
-void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3);
+void netsamlogon_clear_cached_user(const struct dom_sid *user_sid);
 bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3);
 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid);
 bool netsamlogon_cache_have(const struct dom_sid *user_sid);
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index dd02e51..ded7298 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -234,6 +234,10 @@ bool serverid_exists(const struct server_id *id)
 	struct serverid_key key;
 	TDB_DATA tdbkey;
 
+	if (lp_clustering() && !process_exists(*id)) {
+		return false;
+	}
+
 	db = serverid_db();
 	if (db == NULL) {
 		return false;
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 1c00ad8..02322b7 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -2630,6 +2630,10 @@ int sys_getpeereid( int s, uid_t *uid)
 	*uid = cred.uid;
 	return 0;
 #else
+#if defined(HAVE_GETPEEREID)
+	gid_t gid;
+	return getpeereid(s, uid, &gid);
+#endif
 	errno = ENOSYS;
 	return -1;
 #endif
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 6782249..64cd74c 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -159,7 +159,7 @@ int get_socket_port(int fd)
 
 	if (getsockname(fd, (struct sockaddr *)&sa, &length) < 0) {
 		int level = (errno == ENOTCONN) ? 2 : 0;
-		DEBUG(level, ("getpeername failed. Error was %s\n",
+		DEBUG(level, ("getsockname failed. Error was %s\n",
 			       strerror(errno)));
 		return -1;
 	}
diff --git a/nsswitch/libwbclient/wb_reqtrans.c b/source3/lib/wb_reqtrans.c
similarity index 99%
rename from nsswitch/libwbclient/wb_reqtrans.c
rename to source3/lib/wb_reqtrans.c
index 6dc429b..78f806d 100644
--- a/nsswitch/libwbclient/wb_reqtrans.c
+++ b/source3/lib/wb_reqtrans.c
@@ -32,7 +32,7 @@
 #include "lib/util/tevent_unix.h"
 #include "nsswitch/winbind_struct_protocol.h"
 #include "nsswitch/libwbclient/wbclient.h"
-#include "nsswitch/libwbclient/wbc_async.h"
+#include "lib/wb_reqtrans.h"
 
 /* can't use DEBUG here... */
 #define DEBUG(a,b)
diff --git a/source3/lib/wb_reqtrans.h b/source3/lib/wb_reqtrans.h
new file mode 100644
index 0000000..941edf6
--- /dev/null
+++ b/source3/lib/wb_reqtrans.h
@@ -0,0 +1,61 @@
+/*
+   Unix SMB/CIFS implementation.
+   Headers for the async winbind client library
+   Copyright (C) Volker Lendecke 2008
+
+     ** NOTE! The following LGPL license applies to the wbclient
+     ** library. This does NOT imply that all of Samba is released
+     ** under the LGPL
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef _WB_REQTRANS_H_
+#define _WB_REQTRANS_H_
+
+#include <talloc.h>
+#include <tevent.h>
+#include "nsswitch/winbind_struct_protocol.h"
+
+struct tevent_req *wb_req_read_send(TALLOC_CTX *mem_ctx,
+				    struct tevent_context *ev,
+				    int fd, size_t max_extra_data);
+ssize_t wb_req_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+			 struct winbindd_request **preq, int *err);
+
+struct tevent_req *wb_req_write_send(TALLOC_CTX *mem_ctx,
+				     struct tevent_context *ev,
+				     struct tevent_queue *queue, int fd,
+				     struct winbindd_request *wb_req);
+ssize_t wb_req_write_recv(struct tevent_req *req, int *err);
+
+struct tevent_req *wb_resp_read_send(TALLOC_CTX *mem_ctx,
+				     struct tevent_context *ev, int fd);
+ssize_t wb_resp_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+			  struct winbindd_response **presp, int *err);
+
+struct tevent_req *wb_resp_write_send(TALLOC_CTX *mem_ctx,
+				      struct tevent_context *ev,
+				      struct tevent_queue *queue, int fd,
+				      struct winbindd_response *wb_resp);
+ssize_t wb_resp_write_recv(struct tevent_req *req, int *err);
+
+struct tevent_req *wb_simple_trans_send(TALLOC_CTX *mem_ctx,
+					struct tevent_context *ev,
+					struct tevent_queue *queue, int fd,
+					struct winbindd_request *wb_req);
+int wb_simple_trans_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
+			 struct winbindd_response **presponse, int *err);
+
+#endif /*_WB_REQTRANS_H_*/
diff --git a/source3/libsmb/samlogon_cache.c b/source3/libsmb/samlogon_cache.c
index 2e7a9c6..f3ef954 100644
--- a/source3/libsmb/samlogon_cache.c
+++ b/source3/libsmb/samlogon_cache.c
@@ -99,14 +99,9 @@ bool netsamlogon_cache_shutdown(void)
  Clear cache getpwnam and getgroups entries from the winbindd cache
 ***********************************************************************/
 
-void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3)
+void netsamlogon_clear_cached_user(const struct dom_sid *user_sid)
 {
-	struct dom_sid	user_sid;
-	fstring keystr, tmp;
-
-	if (!info3) {
-		return;
-	}
+	fstring keystr;
 
 	if (!netsamlogon_cache_init()) {
 		DEBUG(0,("netsamlogon_clear_cached_user: cannot open "
@@ -114,10 +109,9 @@ void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3)
 			NETSAMLOGON_TDB));
 		return;
 	}
-	sid_compose(&user_sid, info3->base.domain_sid, info3->base.rid);
 
 	/* Prepare key as DOMAIN-SID/USER-RID string */
-	slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));
+	sid_to_fstring(keystr, user_sid);
 
 	DEBUG(10,("netsamlogon_clear_cached_user: SID [%s]\n", keystr));
 
@@ -132,7 +126,7 @@ void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3)
 bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
 {
 	TDB_DATA data;
-	fstring keystr, tmp;
+	fstring keystr;
 	bool result = false;
 	struct dom_sid	user_sid;
 	time_t t = time(NULL);
@@ -154,7 +148,7 @@ bool netsamlogon_cache_store(const char *username, struct netr_SamInfo3 *info3)
 	sid_compose(&user_sid, info3->base.domain_sid, info3->base.rid);
 
 	/* Prepare key as DOMAIN-SID/USER-RID string */
-	slprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));
+	sid_to_fstring(keystr, &user_sid);
 
 	DEBUG(10,("netsamlogon_cache_store: SID [%s]\n", keystr));
 
diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c
index f47b287..0393f30 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -674,7 +674,7 @@ static char *shadow_copy2_realpath(vfs_handle_struct *handle,
 		SHADOW2_NEXT(REALPATH, (handle, fname), char *,
 			     NULL);
 	}
-        SHADOW2_NEXT(REALPATH, (handle, fname), char *, NULL);
+        SHADOW2_NEXT(REALPATH, (handle, name), char *, NULL);
 }
 
 static const char *shadow_copy2_connectpath(struct vfs_handle_struct *handle,
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 7bc8607..bd78323 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -370,7 +370,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 	start = smb_fname->base_name;
 
 	/*
-	 * If we're providing case insentive semantics or
+	 * If we're providing case insensitive semantics or
 	 * the underlying filesystem is case insensitive,
 	 * then a case-normalized hit in the stat-cache is
 	 * authoratitive. JRA.
@@ -388,7 +388,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
 	/*
 	 * Make sure "dirpath" is an allocated string, we use this for
-	 * building the directories with asprintf and free it.
+	 * building the directories with talloc_asprintf and free it.
 	 */
 
 	if ((dirpath == NULL) && (!(dirpath = talloc_strdup(ctx,"")))) {
@@ -454,7 +454,7 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 
 		/*
 		 * A special case - if we don't have any wildcards or mangling chars and are case
-		 * sensitive or the underlying filesystem is case insentive then searching
+		 * sensitive or the underlying filesystem is case insensitive then searching
 		 * won't help.
 		 */
 
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 443fac4..9cc34d8 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -3,17 +3,17 @@
    negprot reply code
    Copyright (C) Andrew Tridgell 1992-1998
    Copyright (C) Volker Lendecke 2007
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
@@ -140,7 +140,7 @@ static void reply_lanman2(struct smb_request *req, uint16 choice)
 	struct smbd_server_connection *sconn = req->sconn;
 
 	sconn->smb1.negprot.encrypted_passwords = lp_encrypted_passwords();
-  
+
 	if (lp_security()>=SEC_USER) {
 		secword |= NEGOTIATE_SECURITY_USER_LEVEL;
 	}
@@ -291,7 +291,7 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
 
 	/* do spnego in user level security if the client
 	   supports it and we can do encrypted passwords */
-	
+
 	if (sconn->smb1.negprot.encrypted_passwords &&
 	    (lp_security() != SEC_SHARE) &&
 	    lp_use_spnego() &&
@@ -304,28 +304,28 @@ static void reply_nt1(struct smb_request *req, uint16 choice)
 		SSVAL(req->outbuf, smb_flg2,
 		      req->flags2 | FLAGS2_EXTENDED_SECURITY);
 	}
-	
+
 	capabilities |= CAP_NT_SMBS|CAP_RPC_REMOTE_APIS|CAP_UNICODE;
 
 	if (lp_unix_extensions()) {
 		capabilities |= CAP_UNIX;
 	}
-	
+
 	if (lp_large_readwrite() && (SMB_OFF_T_BITS == 64))
 		capabilities |= CAP_LARGE_READX|CAP_LARGE_WRITEX|CAP_W2K_SMBS;
-	
+
 	if (SMB_OFF_T_BITS == 64)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list