[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-272-g57afa1e

2009-07-08 Thread Volker Lendecke
The branch, master has been updated
   via  57afa1edebe38ea48be5fc074a8284c762e35e17 (commit)
  from  e3631da15893207b196201f89648a28f889ecb5e (commit)

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


- Log -
commit 57afa1edebe38ea48be5fc074a8284c762e35e17
Author: Stefan Metzmacher me...@samba.org
Date:   Wed Jul 8 09:22:39 2009 +0200

s4:auth/ntlmssp: let _unwrap fallback to seal if sign only doesn't work

s4:auth/ntlmssp: let _unwrap fallback to seal if sign only doesn't work

Windows always uses SEAL with NTLMSSP on LDAP connection even if not 
negotiated.

metze

---

Summary of changes:
 source4/auth/ntlmssp/ntlmssp_sign.c |   63 +++---
 1 files changed, 57 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/ntlmssp/ntlmssp_sign.c 
b/source4/auth/ntlmssp/ntlmssp_sign.c
index cf9eab6..957d0a8 100644
--- a/source4/auth/ntlmssp/ntlmssp_sign.c
+++ b/source4/auth/ntlmssp/ntlmssp_sign.c
@@ -523,18 +523,69 @@ NTSTATUS gensec_ntlmssp_unwrap(struct gensec_security 
*gensec_security,
sig);
  
} else if (gensec_have_feature(gensec_security, GENSEC_FEATURE_SIGN)) {
+   struct gensec_ntlmssp_state *gensec_ntlmssp_state =
+   (struct gensec_ntlmssp_state *)gensec_security-private_data;
+   NTSTATUS status;
+   uint32_t ntlm_seqnum;
+   struct arcfour_state ntlm_state;
+   uint32_t ntlm2_seqnum_r;
+   uint8_t ntlm2_key_r[16];
+   struct arcfour_state ntlm2_state_r;
+
if (in-length  NTLMSSP_SIG_SIZE) {
return NT_STATUS_INVALID_PARAMETER;
}
sig.data = in-data;
sig.length = NTLMSSP_SIG_SIZE;
-
*out = data_blob_talloc(sig_mem_ctx, in-data + 
NTLMSSP_SIG_SIZE, in-length - NTLMSSP_SIG_SIZE);
-   
-   return gensec_ntlmssp_check_packet(gensec_security, 
sig_mem_ctx, 
-  out-data, out-length, 
-  out-data, out-length, 
-  sig);
+
+   if (gensec_ntlmssp_state-neg_flags  NTLMSSP_NEGOTIATE_NTLM2) {
+   ntlm2_seqnum_r = 
gensec_ntlmssp_state-crypt.ntlm2.recv_seq_num;
+   ntlm2_state_r = 
*gensec_ntlmssp_state-crypt.ntlm2.recv_seal_arcfour_state;
+   memcpy(ntlm2_key_r,
+  
gensec_ntlmssp_state-crypt.ntlm2.recv_sign_key.data,
+  16);
+   } else {
+   ntlm_seqnum = gensec_ntlmssp_state-crypt.ntlm.seq_num;
+   ntlm_state = 
*gensec_ntlmssp_state-crypt.ntlm.arcfour_state;
+   }
+
+   status = gensec_ntlmssp_check_packet(gensec_security, 
sig_mem_ctx,
+out-data, out-length,
+out-data, out-length,
+sig);
+   if (!NT_STATUS_IS_OK(status)) {
+   NTSTATUS check_status = status;
+   /*
+* The Windows LDAP libraries seems to have a bug
+* and always use sealing even if only signing was
+* negotiated. So we need to fallback.
+*/
+
+   if (gensec_ntlmssp_state-neg_flags  
NTLMSSP_NEGOTIATE_NTLM2) {
+   gensec_ntlmssp_state-crypt.ntlm2.recv_seq_num 
= ntlm2_seqnum_r;
+   
*gensec_ntlmssp_state-crypt.ntlm2.recv_seal_arcfour_state = ntlm2_state_r;
+   
memcpy(gensec_ntlmssp_state-crypt.ntlm2.recv_sign_key.data,
+  ntlm2_key_r, 16);
+   } else {
+   gensec_ntlmssp_state-crypt.ntlm.seq_num = 
ntlm_seqnum;
+   *gensec_ntlmssp_state-crypt.ntlm.arcfour_state 
= ntlm_state;
+   }
+
+   status = gensec_ntlmssp_unseal_packet(gensec_security,
+ sig_mem_ctx,
+ out-data,
+ out-length,
+ out-data,
+ out-length,
+ sig);
+   

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-273-g31bd627

2009-07-08 Thread Jeff Layton
The branch, master has been updated
   via  31bd62727dcba38c101ea0035f4b2898571ab149 (commit)
  from  57afa1edebe38ea48be5fc074a8284c762e35e17 (commit)

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


- Log -
commit 31bd62727dcba38c101ea0035f4b2898571ab149
Author: Shirish Pargaonkar shirishpargaon...@gmail.com
Date:   Wed Jul 8 07:43:43 2009 -0400

docs: flesh out options section of umount.cifs manpage

Signed-off-by: Shirish Pargaonkar shirishpargaon...@gmail.com
Signed-off-by: Jeff Layton jlay...@redhat.com

---

Summary of changes:
 docs-xml/manpages-3/umount.cifs.8.xml |   56 
 1 files changed, 49 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/umount.cifs.8.xml 
b/docs-xml/manpages-3/umount.cifs.8.xml
index d845d38..319c437 100644
--- a/docs-xml/manpages-3/umount.cifs.8.xml
+++ b/docs-xml/manpages-3/umount.cifs.8.xml
@@ -54,14 +54,56 @@ can rely on specifying explicit entries in /etc/fstab 
See/para
 refsect1
titleOPTIONS/title
variablelist
-varlistentry
-term--verbose/term
-listitemparaprint additional debugging 
information/para/listitem
-/varlistentry
-varlistentry
-term--no-mtab/term
+   varlistentry
+term-V/term
+listitemparaPrint version and exit./para/listitem
+   /varlistentry
+   varlistentry
+term-h/term
+listitemparaPrint help message and exit./para/listitem
+   /varlistentry
+   varlistentry
+term-r/term
+listitemparaIn case unmounting fails, try to remount
+   read-only./para/listitem
+   /varlistentry
+   varlistentry
+term-d/term
+listitemparaIn case the unmounted device was a loop device,
+also free this loop device./para/listitem
+   /varlistentry
+   varlistentry
+term-f/term
+listitemparaForce unmount (in case of an unreachable
+   server)./para/listitem
+   /varlistentry
+   varlistentry
+term-l/term
+listitemparaLazy unmount. Detach the filesystem from
+   the filesysetm hierarchy now, and
+   cleanup all references to the filesystem
+   as soon as it is not busy 
anymore./para/listitem
+   /varlistentry
+   varlistentry
+term-e/term
+listitemparaMark the mount point as expired.  If a mount
+   point is not currently in use, then an initial
+   call to unmount with this flag fails with the
+   error EAGAIN, but marks the mount point as
+   expired.  The mount point remains expired as
+   long as it isn't accessed by any process.
+   A second unmount call specifying -e unmounts
+   an expired mount point.  This flag cannot be
+   specified with either -f or -l/para/listitem
+   /varlistentry
+   varlistentry
+term-v|--verbose/term
+listitemparaVerbose Mode. Print additional debugging 
information/para/listitem
+   /varlistentry
+   varlistentry
+term-n|--no-mtab/term
 listitemparaDo not update the mtab even if unmount 
completes successfully (/proc/mounts will still display the correct 
information)/para/listitem
-/varlistentry
+   /varlistentry
 
/variablelist
 /refsect1


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-274-g6f64937

2009-07-08 Thread Jim McDonough
The branch, master has been updated
   via  6f64937ab835adbe0fea2ff38a8bd03941fc9543 (commit)
  from  31bd62727dcba38c101ea0035f4b2898571ab149 (commit)

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


- Log -
commit 6f64937ab835adbe0fea2ff38a8bd03941fc9543
Author: Jim McDonough j...@samba.org
Date:   Wed Jul 8 08:02:04 2009 -0400

Fix cifs.upcall builds on some platforms (zlib)

---

Summary of changes:
 source3/Makefile.in |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index dd133df..b70d4ff 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1519,7 +1519,7 @@ bin/cifs.upc...@exeext@: $(BINARY_PREREQS) 
$(CIFS_UPCALL_OBJ) $(LIBSMBCLIENT_OBJ
@$(CC) -o $@ $(CIFS_UPCALL_OBJ) $(DYNEXP) $(LDFLAGS) \
-lkeyutils $(LIBS) $(LIBSMBCLIENT_OBJ1) $(KRB5LIBS) \
$(LDAP_LIBS) $(LIBTALLOC_LIBS) $(LIBWBCLIENT_LIBS) \
-   $(LIBTDB_LIBS) $(NSCD_LIBS)
+   $(LIBTDB_LIBS) $(NSCD_LIBS) $(ZLIB_LIBS)
 
 bin/testp...@exeext@: $(BINARY_PREREQS) $(TESTPARM_OBJ) @BUILD_POPT@ 
@LIBTALLOC_TARGET@ @LIBTDB_TARGET@
@echo Linking $@


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-275-g7fd42d5

2009-07-08 Thread Jim McDonough
The branch, master has been updated
   via  7fd42d51c8b13d273b55823ee146967afacd7c88 (commit)
  from  6f64937ab835adbe0fea2ff38a8bd03941fc9543 (commit)

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


- Log -
commit 7fd42d51c8b13d273b55823ee146967afacd7c88
Author: Jim McDonough j...@samba.org
Date:   Wed Jul 8 13:12:26 2009 -0400

Fix make test_shlibs for libnss_wins and libnetapi (zlib)

---

Summary of changes:
 source3/Makefile.in |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index b70d4ff..4c927e7 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -2107,7 +2107,7 @@ $(LIBNETAPI_SHARED_TARGET_SONAME): $(BINARY_PREREQS) 
$(LIBNETAPI_OBJ) $(LIBNETAP
@echo Linking shared library $@
@$(SHLD_DSO) $(LIBNETAPI_OBJ) \
$(LIBTALLOC_LIBS) $(LIBTDB_LIBS) $(LIBWBCLIENT_LIBS) $(LIBS) \
-   $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) \
+   $(LDAP_LIBS) $(KRB5LIBS) $(NSCD_LIBS) $(ZLIB_LIBS) \
@sonamef...@`basename $...@`
 
 $(LIBNETAPI_SHARED_TARGET): $(LIBNETAPI_SHARED_TARGET_SONAME)
@@ -2521,7 +2521,7 @@ bin/v...@exeext@: $(BINARY_PREREQS) $(VLP_OBJ) 
@LIBTDB_TARGET@
 @WINBIND_WINS_NSS@: $(BINARY_PREREQS) $(WINBIND_WINS_NSS_OBJ) 
@LIBTALLOC_TARGET@ @LIBTDB_TARGET@
@echo Linking $@
@$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_WINS_NSS_OBJ) \
-   $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) $(LIBTALLOC_LIBS) 
$(LIBTDB_LIBS) \
+   $(LDAP_LIBS) $(KRB5LIBS) $(LIBS) $(LIBTALLOC_LIBS) 
$(LIBTDB_LIBS) $(ZLIB_LIBS) \
@sonamef...@`basename $...@`@NSSSONAMEVERSIONSUFFIX@
 
 bin/winbind_krb5_locat...@shlibext@: $(BINARY_PREREQS) 
$(WINBIND_KRB5_LOCATOR_OBJ) @LIBWBCLIENT_TARGET@


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-276-g58daaa3

2009-07-08 Thread Jeremy Allison
The branch, master has been updated
   via  58daaa3d1e7075b23c8709889be9b461c6c6c174 (commit)
  from  7fd42d51c8b13d273b55823ee146967afacd7c88 (commit)

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


- Log -
commit 58daaa3d1e7075b23c8709889be9b461c6c6c174
Author: Jeremy Allison j...@samba.org
Date:   Wed Jul 8 12:28:01 2009 -0700

When faking a create time, use the full timespec values, not time_t.
Jeremy.

---

Summary of changes:
 source3/lib/system.c |  124 +
 1 files changed, 63 insertions(+), 61 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/system.c b/source3/lib/system.c
index 9bd231a..47bb525 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -291,67 +291,6 @@ int sys_fcntl_long(int fd, int cmd, long arg)
 }
 
 /
- Return the best approximation to a 'create time' under UNIX from a stat
- structure.
-/
-
-static time_t calc_create_time(const struct stat *st)
-{
-   time_t ret, ret1;
-
-   ret = MIN(st-st_ctime, st-st_mtime);
-   ret1 = MIN(ret, st-st_atime);
-
-   if(ret1 != (time_t)0) {
-   return ret1;
-   }
-
-   /*
-* One of ctime, mtime or atime was zero (probably atime).
-* Just return MIN(ctime, mtime).
-*/
-   return ret;
-}
-
-/
- Return the 'create time' from a stat struct if it exists (birthtime) or else
- use the best approximation.
-/
-
-static struct timespec get_create_timespec(const struct stat *pst)
-{
-   struct timespec ret;
-
-   if (S_ISDIR(pst-st_mode)  lp_fake_dir_create_times()) {
-   ret.tv_sec = 315493200L;  /* 1/1/1980 */
-   ret.tv_nsec = 0;
-   return ret;
-   }
-
-#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC)
-   ret = pst-st_birthtimespec;
-#elif defined(HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
-   ret.tv_sec = pst-st_birthtime;
-   ret.tv_nsec = pst-st_birthtimenspec;
-#elif defined(HAVE_STRUCT_STAT_ST_BIRTHTIME)
-   ret.tv_sec = pst-st_birthtime;
-   ret.tv_nsec = 0;
-#else
-   ret.tv_sec = calc_create_time(pst);
-   ret.tv_nsec = 0;
-#endif
-
-   /* Deal with systems that don't initialize birthtime correctly.
-* Pointed out by SATOH Fumiyasu fumi...@osstech.jp.
-*/
-   if (null_timespec(ret)) {
-   ret.tv_sec = calc_create_time(pst);
-   ret.tv_nsec = 0;
-   }
-   return ret;
-}
-
-/
  Get/Set all the possible time fields from a stat struct as a timespec.
 /
 
@@ -460,6 +399,69 @@ static struct timespec get_ctimespec(const struct stat 
*pst)
 #endif
 }
 
+/
+ Return the best approximation to a 'create time' under UNIX from a stat
+ structure.
+/
+
+static struct timespec calc_create_time(const struct stat *st)
+{
+   struct timespec ret, ret1;
+   struct timespec c_time = get_ctimespec(st);
+   struct timespec m_time = get_mtimespec(st);
+   struct timespec a_time = get_atimespec(st);
+
+   ret = timespec_compare(c_time, m_time)  0 ? c_time : m_time;
+   ret1 = timespec_compare(ret, a_time)  0 ? ret : a_time;
+
+   if(!null_timespec(ret1)) {
+   return ret1;
+   }
+
+   /*
+* One of ctime, mtime or atime was zero (probably atime).
+* Just return MIN(ctime, mtime).
+*/
+   return ret;
+}
+
+/
+ Return the 'create time' from a stat struct if it exists (birthtime) or else
+ use the best approximation.
+/
+
+static struct timespec get_create_timespec(const struct stat *pst)
+{
+   struct timespec ret;
+
+   if (S_ISDIR(pst-st_mode)  lp_fake_dir_create_times()) {
+   ret.tv_sec = 315493200L;  /* 1/1/1980 */
+   ret.tv_nsec = 0;
+   return ret;
+   }
+
+#if defined(HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC)
+   ret = pst-st_birthtimespec;
+#elif defined(HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+   ret.tv_sec = pst-st_birthtime;
+   ret.tv_nsec = pst-st_birthtimenspec;
+#elif defined(HAVE_STRUCT_STAT_ST_BIRTHTIME)
+   ret.tv_sec = 

Build status as of Thu Jul 9 00:00:02 2009

2009-07-08 Thread build
URL: http://build.samba.org/

--- /home/build/master/cache/broken_results.txt.old 2009-07-08 
00:00:28.0 +
+++ /home/build/master/cache/broken_results.txt 2009-07-09 00:00:31.0 
+
@@ -1,12 +1,12 @@
-Build status as of Wed Jul  8 00:00:02 2009
+Build status as of Thu Jul  9 00:00:02 2009
 
 Build counts:
 Tree Total  Broken Panic 
 build_farm   0  0  0 
-ccache   24 3  0 
+ccache   25 3  0 
 distcc   0  0  0 
 ldb  25 25 0 
-libreplace   24 11 0 
+libreplace   23 11 0 
 lorikeet 0  0  0 
 pidl 20 2  0 
 ppp  10 0  0 
@@ -14,9 +14,9 @@
 samba-docs   0  0  0 
 samba-web0  0  0 
 samba_3_current 23 13 0 
-samba_3_master 24 19 3 
+samba_3_master 24 19 2 
 samba_3_next 24 22 1 
-samba_4_0_test 23 22 10
+samba_4_0_test 23 22 11
 talloc   25 25 0 
 tdb  23 23 0 
 


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-277-gc9c3d43

2009-07-08 Thread Jeremy Allison
The branch, master has been updated
   via  c9c3d4312d7281904fc4a1cc9abd4831cdf4bfb9 (commit)
  from  58daaa3d1e7075b23c8709889be9b461c6c6c174 (commit)

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


- Log -
commit c9c3d4312d7281904fc4a1cc9abd4831cdf4bfb9
Author: Jeremy Allison j...@samba.org
Date:   Wed Jul 8 17:51:35 2009 -0700

The migration to struct stat_ex broke the calculation of
create time from the existing timestamps (for systems
that need to do this). Once the write time is changed
via a sticky write, the create time might need to be
recalculated. To do this I needed to add a bool into
struct stat_ex to remember if the st_ex_btime field
was calculated, or read from the OS. Also fixed the
returning of modified write timestamps in the return
from NTCreateX, SMBattr and SMBattrE (which weren't
taking into account the modified timestamp stored
in the open file table). Attempting to fix an issue
with Excel 2003 and offline files. Volker and Metze,
please review.
Jeremy

---

Summary of changes:
 source3/include/includes.h |2 +
 source3/include/proto.h|1 +
 source3/lib/system.c   |   72 +++
 source3/smbd/nttrans.c |   18 +++
 source3/smbd/reply.c   |   28 +
 source3/smbd/trans2.c  |   21 +++--
 6 files changed, 118 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/includes.h b/source3/include/includes.h
index 2b36d18..8fb240f 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -460,6 +460,8 @@ struct stat_ex {
struct timespec st_ex_mtime;
struct timespec st_ex_ctime;
struct timespec st_ex_btime; /* birthtime */
+   /* Is birthtime real, or was it calculated ? */
+   boolst_ex_calculated_birthtime;
blksize_t   st_ex_blksize;
blkcnt_tst_ex_blocks;
 
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 0315f30..25a104d 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -911,6 +911,7 @@ ssize_t sys_recv(int fd, void *buf, size_t count, int 
flags);
 ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr 
*from, socklen_t *fromlen);
 int sys_fcntl_ptr(int fd, int cmd, void *arg);
 int sys_fcntl_long(int fd, int cmd, long arg);
+void update_stat_ex_writetime(struct stat_ex *dst, struct timespec write_ts);
 int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 47bb525..b808a36 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -404,7 +404,7 @@ static struct timespec get_ctimespec(const struct stat *pst)
  structure.
 /
 
-static struct timespec calc_create_time(const struct stat *st)
+static struct timespec calc_create_time_stat(const struct stat *st)
 {
struct timespec ret, ret1;
struct timespec c_time = get_ctimespec(st);
@@ -426,41 +426,85 @@ static struct timespec calc_create_time(const struct stat 
*st)
 }
 
 /
+ Return the best approximation to a 'create time' under UNIX from a stat_ex
+ structure.
+/
+
+static struct timespec calc_create_time_stat_ex(const struct stat_ex *st)
+{
+   struct timespec ret, ret1;
+   struct timespec c_time = st-st_ex_ctime;
+   struct timespec m_time = st-st_ex_mtime;
+   struct timespec a_time = st-st_ex_atime;
+
+   ret = timespec_compare(c_time, m_time)  0 ? c_time : m_time;
+   ret1 = timespec_compare(ret, a_time)  0 ? ret : a_time;
+
+   if(!null_timespec(ret1)) {
+   return ret1;
+   }
+
+   /*
+* One of ctime, mtime or atime was zero (probably atime).
+* Just return MIN(ctime, mtime).
+*/
+   return ret;
+}
+
+/
  Return the 'create time' from a stat struct if it exists (birthtime) or else
  use the best approximation.
 /
 
-static struct timespec get_create_timespec(const struct stat *pst)
+static void get_create_timespec(const struct stat *pst, struct stat_ex *dst)
 {
struct timespec ret;
 
if (S_ISDIR(pst-st_mode)  lp_fake_dir_create_times()) {
-   ret.tv_sec = 315493200L;  /* 1/1/1980 */
-   ret.tv_nsec = 0;
-   return ret;
+   dst-st_ex_btime.tv_sec 

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-278-g400c18a

2009-07-08 Thread Jeremy Allison
The branch, master has been updated
   via  400c18a8c4098b4ba86d32a236e5d89014774f3f (commit)
  from  c9c3d4312d7281904fc4a1cc9abd4831cdf4bfb9 (commit)

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


- Log -
commit 400c18a8c4098b4ba86d32a236e5d89014774f3f
Author: Jeremy Allison j...@samba.org
Date:   Wed Jul 8 18:05:30 2009 -0700

Rename update_stat_ex_writetime() - update_stat_ex_mtime()
to better describe what we're doing here.
Jeremy

---

Summary of changes:
 source3/include/proto.h |2 +-
 source3/lib/system.c|4 ++--
 source3/smbd/nttrans.c  |4 ++--
 source3/smbd/reply.c|4 ++--
 source3/smbd/trans2.c   |4 ++--
 5 files changed, 9 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 25a104d..f835da2 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -911,7 +911,7 @@ ssize_t sys_recv(int fd, void *buf, size_t count, int 
flags);
 ssize_t sys_recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr 
*from, socklen_t *fromlen);
 int sys_fcntl_ptr(int fd, int cmd, void *arg);
 int sys_fcntl_long(int fd, int cmd, long arg);
-void update_stat_ex_writetime(struct stat_ex *dst, struct timespec write_ts);
+void update_stat_ex_mtime(struct stat_ex *dst, struct timespec write_ts);
 int sys_stat(const char *fname,SMB_STRUCT_STAT *sbuf);
 int sys_fstat(int fd,SMB_STRUCT_STAT *sbuf);
 int sys_lstat(const char *fname,SMB_STRUCT_STAT *sbuf);
diff --git a/source3/lib/system.c b/source3/lib/system.c
index b808a36..ffc236e 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -492,10 +492,10 @@ static void get_create_timespec(const struct stat *pst, 
struct stat_ex *dst)
 /
  If we update a timestamp in a stat_ex struct we may have to recalculate
  the birthtime. For now only implement this for write time, but we may
- also need to do it for mtime and ctime. JRA.
+ also need to do it for atime and ctime. JRA.
 /
 
-void update_stat_ex_writetime(struct stat_ex *dst,
+void update_stat_ex_mtime(struct stat_ex *dst,
struct timespec write_ts)
 {
dst-st_ex_mtime = write_ts;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 4f75b9f..5d67647 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -657,7 +657,7 @@ void reply_ntcreate_and_X(struct smb_request *req)
ZERO_STRUCT(write_time_ts);
get_file_infos(fsp-file_id, NULL, write_time_ts);
if (!null_timespec(write_time_ts)) {
-   update_stat_ex_writetime(smb_fname-st, write_time_ts);
+   update_stat_ex_mtime(smb_fname-st, write_time_ts);
}
 
/* Create time. */
@@ -1148,7 +1148,7 @@ static void call_nt_transact_create(connection_struct 
*conn,
ZERO_STRUCT(write_time_ts);
get_file_infos(fsp-file_id, NULL, write_time_ts);
if (!null_timespec(write_time_ts)) {
-   update_stat_ex_writetime(smb_fname-st, write_time_ts);
+   update_stat_ex_mtime(smb_fname-st, write_time_ts);
}
 
/* Create time. */
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index e02482e..0afaf56 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -1121,7 +1121,7 @@ void reply_getatr(struct smb_request *req)
fileid = vfs_file_id_from_sbuf(conn, smb_fname-st);
get_file_infos(fileid, NULL, write_time_ts);
if (!null_timespec(write_time_ts)) {
-   update_stat_ex_writetime(smb_fname-st, 
write_time_ts);
+   update_stat_ex_mtime(smb_fname-st, 
write_time_ts);
}
}
 
@@ -1803,7 +1803,7 @@ void reply_open(struct smb_request *req)
ZERO_STRUCT(write_time_ts);
get_file_infos(fsp-file_id, NULL, write_time_ts);
if (!null_timespec(write_time_ts)) {
-   update_stat_ex_writetime(smb_fname-st, write_time_ts);
+   update_stat_ex_mtime(smb_fname-st, write_time_ts);
}
}
 
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index cb4f10f..0dd2ca2 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1463,7 +1463,7 @@ static bool get_lanman2_dir_entry(TALLOC_CTX *ctx,
fileid = vfs_file_id_from_sbuf(conn, sbuf);
get_file_infos(fileid, NULL, write_time_ts);
if (!null_timespec(write_time_ts)) {
-   update_stat_ex_writetime(sbuf, 
write_time_ts);
+  

[SCM] CTDB repository - branch master updated - ctdb-1.0.86-59-g99f239f

2009-07-08 Thread Ronnie Sahlberg
The branch, master has been updated
   via  99f239f8b96c8c0a06ac8ca8b8083be96265865a (commit)
   via  d6ddea4167ccdad05e88378ee3f22b6125969562 (commit)
   via  501a2747d839ca291b70c761098549cf6d47a158 (commit)
   via  54b4a02053a0f98f8c424e7f658890254023d39a (commit)
   via  866aa995dc029db6e510060e9e95a8ca149094ac (commit)
   via  049271c83a09afb8d6c3e5212cf9ca782956b0c6 (commit)
   via  d47dab1026deba0554f21282a59bd172209ea066 (commit)
  from  2ff6ee042080ba1c2bea76bbef3742997d84c9a8 (commit)

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


- Log -
commit 99f239f8b96c8c0a06ac8ca8b8083be96265865a
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 14:19:32 2009 +1000

recovery daemon needs to monitor when the local ctdb daemon is stopped and 
ensure that the databases gets frozen and the node enters recovery mode

commit d6ddea4167ccdad05e88378ee3f22b6125969562
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 13:07:15 2009 +1000

document the new commands ctdb stop/continue

commit 501a2747d839ca291b70c761098549cf6d47a158
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 13:20:14 2009 +1000

dont let other nodes modify the STOPPED flag for the local process when 
pushing out flags changes

commit 54b4a02053a0f98f8c424e7f658890254023d39a
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 12:22:46 2009 +1000

add two new controls, CTOP_NODE and CONTINUE_NODE
that are used to stop/continue a node instead of using modflags messages

commit 866aa995dc029db6e510060e9e95a8ca149094ac
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 11:57:20 2009 +1000

make it possible to start the daemon in STOPPED mode

commit 049271c83a09afb8d6c3e5212cf9ca782956b0c6
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 11:43:37 2009 +1000

remove the header printed for the machinereadable output for natgwlist

commit d47dab1026deba0554f21282a59bd172209ea066
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 11:38:18 2009 +1000

Add a new node flag : STOPPED
This node flag means the node is DISABLED and that all its public ip 
addresses
are failed over, but also that it has been removed from the VNNmap.

A STOPPED node should be in recovery mode active untill restarted using the 
continue command.

Adding two new commands ctdb stop ctdb continue

---

Summary of changes:
 client/ctdb_client.c   |   34 +++
 config/ctdb.init   |1 +
 doc/ctdb.1 |   38 +++-
 doc/ctdb.1.html|  150 ++-
 doc/ctdb.1.xml |   67 +++---
 doc/ctdbd.1|   23 ++--
 doc/ctdbd.1.html   |   89 +
 doc/ctdbd.1.xml|   31 +-
 include/ctdb.h |2 +
 include/ctdb_private.h |   11 +++-
 server/ctdb_control.c  |8 +++
 server/ctdb_monitor.c  |   10 +++
 server/ctdb_recover.c  |   16 +
 server/ctdb_recoverd.c |   28 +
 server/ctdb_server.c   |5 ++
 server/ctdbd.c |3 +
 tcp/tcp_connect.c  |5 ++
 tools/ctdb.c   |   83 --
 18 files changed, 449 insertions(+), 155 deletions(-)


Changeset truncated at 500 lines:

diff --git a/client/ctdb_client.c b/client/ctdb_client.c
index 2c86b3e..4ea8d04 100644
--- a/client/ctdb_client.c
+++ b/client/ctdb_client.c
@@ -3707,3 +3707,37 @@ int ctdb_ctrl_setreclock(struct ctdb_context *ctdb, 
struct timeval timeout, uint
 
return 0;
 }
+
+/*
+  stop a node
+ */
+int ctdb_ctrl_stop_node(struct ctdb_context *ctdb, struct timeval timeout, 
uint32_t destnode)
+{
+   int ret;
+
+   ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_STOP_NODE, 0, 
tdb_null, 
+  ctdb, NULL, NULL, timeout, NULL);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR,(Failed to stop node\n));
+   return -1;
+   }
+
+   return 0;
+}
+
+/*
+  continue a node
+ */
+int ctdb_ctrl_continue_node(struct ctdb_context *ctdb, struct timeval timeout, 
uint32_t destnode)
+{
+   int ret;
+
+   ret = ctdb_control(ctdb, destnode, 0, CTDB_CONTROL_CONTINUE_NODE, 0, 
tdb_null, 
+  ctdb, NULL, NULL, timeout, NULL);
+   if (ret != 0) {
+   DEBUG(DEBUG_ERR,(Failed to continue node\n));
+   return -1;
+   }
+
+   return 0;
+}
diff --git a/config/ctdb.init b/config/ctdb.init
index 95e8ccc..d69b01c 100755
--- a/config/ctdb.init
+++ b/config/ctdb.init
@@ -102,6 +102,7 @@ build_ctdb_options () {
 maybe_set -d   $CTDB_DEBUGLEVEL
 maybe_set --notification-script$CTDB_NOTIFY_SCRIPT
 maybe_set --start-as-disabled  

[SCM] CTDB repository - branch master updated - ctdb-1.0.86-61-gb75ac11

2009-07-08 Thread Ronnie Sahlberg
The branch, master has been updated
   via  b75ac1185481060ab71bd743e1e48d333d716eba (commit)
   via  1e007c833098b03dd81797c081da1ae1b10c971c (commit)
  from  99f239f8b96c8c0a06ac8ca8b8083be96265865a (commit)

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


- Log -
commit b75ac1185481060ab71bd743e1e48d333d716eba
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 14:44:03 2009 +1000

stopped nodes can not win a recmaster election

stopped nodes must yield the recmaster role

commit 1e007c833098b03dd81797c081da1ae1b10c971c
Author: Ronnie Sahlberg ronniesahlb...@gmail.com
Date:   Thu Jul 9 14:34:12 2009 +1000

change the infolevel when logging stop/continue commands

---

Summary of changes:
 server/ctdb_recover.c  |4 ++--
 server/ctdb_recoverd.c |   19 ++-
 2 files changed, 20 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 97602b9..b9a507b 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -1158,7 +1158,7 @@ int32_t ctdb_control_set_recmaster(struct ctdb_context 
*ctdb, uint32_t opcode, T
 
 int32_t ctdb_control_stop_node(struct ctdb_context *ctdb)
 {
-   DEBUG(DEBUG_ERR,(__location__  Stopping node\n));
+   DEBUG(DEBUG_INFO,(__location__  Stopping node\n));
ctdb-nodes[ctdb-pnn]-flags |= NODE_FLAGS_STOPPED;
 
return 0;
@@ -1166,7 +1166,7 @@ int32_t ctdb_control_stop_node(struct ctdb_context *ctdb)
 
 int32_t ctdb_control_continue_node(struct ctdb_context *ctdb)
 {
-   DEBUG(DEBUG_ERR,(__location__  Continue node\n));
+   DEBUG(DEBUG_INFO,(__location__  Continue node\n));
ctdb-nodes[ctdb-pnn]-flags = ~NODE_FLAGS_STOPPED;
 
return 0;
diff --git a/server/ctdb_recoverd.c b/server/ctdb_recoverd.c
index 8f6106f..d601ca6 100644
--- a/server/ctdb_recoverd.c
+++ b/server/ctdb_recoverd.c
@@ -1660,11 +1660,21 @@ static bool ctdb_election_win(struct ctdb_recoverd 
*rec, struct election_message
return false;
}   
 
+   /* we cant win if we are stopped */
+   if (rec-node_flags  NODE_FLAGS_STOPPED) {
+   return false;
+   }   
+
/* we will automatically win if the other node is banned */
if (em-node_flags  NODE_FLAGS_BANNED) {
return true;
}
 
+   /* we will automatically win if the other node is banned */
+   if (em-node_flags  NODE_FLAGS_STOPPED) {
+   return true;
+   }
+
/* try to use the most connected node */
if (cmp == 0) {
cmp = (int)myem.num_connected - (int)em-num_connected;
@@ -2831,7 +2841,14 @@ again:
goto again;
}
}
-
+   /* If the local node is stopped, verify we are not the recmaster 
+  and yield this role if so
+   */
+   if ((nodemap-nodes[pnn].flags  NODE_FLAGS_STOPPED)  (rec-recmaster 
== pnn)) {
+   DEBUG(DEBUG_ERR,(Local node is STOPPED. Yielding recmaster 
role\n));
+   force_election(rec, pnn, nodemap);
+   goto again;
+   }

/* check that we (recovery daemon) and the local ctdb daemon
   agrees on whether we are banned or not


-- 
CTDB repository


[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-286-gfbaa849

2009-07-08 Thread Tim Prouty
The branch, master has been updated
   via  fbaa8497a5c8c209de9ca86bebf8387e6d33a608 (commit)
   via  02aad05e0ed3e1d4790b323a94e43184f9c4e643 (commit)
   via  dcc97c5ad7d274e88ee2be2bbd37234030737bc2 (commit)
   via  3a7d372e2eb5ab00986aafe69ac715a68faa077f (commit)
   via  83e5ac569577566fa171b8f4288e26e5129015ab (commit)
   via  161e182b65ceda833e0bebc48ef404cdd399f8d7 (commit)
   via  1a1d10d22f7a2eebd22e76614c3c74b4d49e5c33 (commit)
   via  69c8795b672054cb6b5a85cc5f8961099425bd7a (commit)
  from  400c18a8c4098b4ba86d32a236e5d89014774f3f (commit)

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


- Log -
commit fbaa8497a5c8c209de9ca86bebf8387e6d33a608
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 20:15:02 2009 -0700

s3: Repace a char * with an smb_filename struct in reply_rmdir

commit 02aad05e0ed3e1d4790b323a94e43184f9c4e643
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 16:53:01 2009 -0700

s3: Prepare open.c to switch fsp_name to an smb_filename struct

commit dcc97c5ad7d274e88ee2be2bbd37234030737bc2
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 17:53:05 2009 -0700

s3 plumb smb_filename through smb_set_file_allocation_info()

commit 3a7d372e2eb5ab00986aafe69ac715a68faa077f
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 16:22:44 2009 -0700

s3: Change the share_mode_lock struct to store a base_name and stream_name

commit 83e5ac569577566fa171b8f4288e26e5129015ab
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 14:27:06 2009 -0700

s3: Make some arguments to (parse|unparse)_share_modes() const

commit 161e182b65ceda833e0bebc48ef404cdd399f8d7
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 14:08:04 2009 -0700

s3: Remove is_ntfs_stream_name() and split_ntfs_stream_name()

Actually I moved split_ntfs_stream_name into torture.c which is the one
consumer of it.  This could probably be changed at some point.

commit 1a1d10d22f7a2eebd22e76614c3c74b4d49e5c33
Author: Tim Prouty tpro...@samba.org
Date:   Wed Jul 8 12:24:03 2009 -0700

s3: Plumb smb_filename through dos_mode() and related funtions

commit 69c8795b672054cb6b5a85cc5f8961099425bd7a
Author: Tim Prouty tpro...@samba.org
Date:   Tue Jul 7 19:20:22 2009 -0700

s3: convert unix_mode to take an smb_filename

---

Summary of changes:
 source3/include/proto.h |   28 ++--
 source3/include/smb.h   |3 +-
 source3/lib/util.c  |   90 ---
 source3/locking/locking.c   |   97 
 source3/modules/nfs4_acls.c |   12 ++-
 source3/modules/onefs_acl.c |   15 ++-
 source3/modules/onefs_open.c|   58 
 source3/modules/onefs_streams.c |   48 --
 source3/modules/vfs_streams_xattr.c |   21 ++-
 source3/smbd/dir.c  |   48 +++---
 source3/smbd/dosmode.c  |  217 +++
 source3/smbd/fileio.c   |   34 ++---
 source3/smbd/nttrans.c  |   67 +
 source3/smbd/open.c |  124 +---
 source3/smbd/posix_acls.c   |  281 ++-
 source3/smbd/reply.c|   93 +++-
 source3/smbd/smb2_create.c  |   13 ++-
 source3/smbd/trans2.c   |  158 ++--
 source3/torture/torture.c   |   90 +++
 source3/utils/status.c  |   18 ++-
 20 files changed, 807 insertions(+), 708 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index f835da2..f887b4e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1202,8 +1202,6 @@ void *_talloc_memdup_zeronull(const void *t, const void 
*p, size_t size, const c
 void *_talloc_array_zeronull(const void *ctx, size_t el_size, unsigned count, 
const char *name);
 void *_talloc_zero_array_zeronull(const void *ctx, size_t el_size, unsigned 
count, const char *name);
 void *talloc_zeronull(const void *context, size_t size, const char *name);
-NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
-   char **pbase, char **pstream);
 bool is_valid_policy_hnd(const struct policy_handle *hnd);
 bool policy_hnd_equal(const struct policy_handle *hnd1,
  const struct policy_handle *hnd2);
@@ -3445,16 +3443,14 @@ char *share_mode_str(TALLOC_CTX *ctx, int num, const 
struct share_mode_entry *e)
 struct share_mode_lock *get_share_mode_lock(TALLOC_CTX *mem_ctx,
const struct file_id id,
const char *servicepath,
-   const char *fname,
+   const struct smb_filename 
*smb_fname,
  

[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-288-g2481ce8

2009-07-08 Thread Andrew Bartlett
The branch, master has been updated
   via  2481ce89427ef38b47fb29d16c15b77e9d2c20b9 (commit)
   via  2c873c43534d61cd411b5c8d56425fd9c2ddd128 (commit)
  from  fbaa8497a5c8c209de9ca86bebf8387e6d33a608 (commit)

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


- Log -
commit 2481ce89427ef38b47fb29d16c15b77e9d2c20b9
Author: Andrew Bartlett abart...@samba.org
Date:   Thu Jul 9 14:53:26 2009 +1000

s4:dsdb Allow unicodePwd to be set when adding a user

Windows 7 sets it's join password using the unicodePwd attribute (as a
quoted, utf16 string), and does so during the LDAPAdd of the object.
Previously, this code only handled unicodePwd for modifies.

Andrew Bartlett

commit 2c873c43534d61cd411b5c8d56425fd9c2ddd128
Author: Andrew Bartlett abart...@samba.org
Date:   Thu Jul 9 10:08:02 2009 +1000

Add const

---

Summary of changes:
 source4/dsdb/common/util.c |4 +-
 source4/dsdb/samdb/ldb_modules/password_hash.c |  169 
 2 files changed, 86 insertions(+), 87 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index 313005b..cbae2ec 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -529,7 +529,7 @@ NTTIME samdb_result_force_password_change(struct 
ldb_context *sam_ldb,
 /*
   pull a samr_Password structutre from a result set. 
 */
-struct samr_Password *samdb_result_hash(TALLOC_CTX *mem_ctx, struct 
ldb_message *msg, const char *attr)
+struct samr_Password *samdb_result_hash(TALLOC_CTX *mem_ctx, const struct 
ldb_message *msg, const char *attr)
 {
struct samr_Password *hash = NULL;
const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
@@ -543,7 +543,7 @@ struct samr_Password *samdb_result_hash(TALLOC_CTX 
*mem_ctx, struct ldb_message
 /*
   pull an array of samr_Password structutres from a result set. 
 */
-uint_t samdb_result_hashes(TALLOC_CTX *mem_ctx, struct ldb_message *msg, 
+uint_t samdb_result_hashes(TALLOC_CTX *mem_ctx, const struct ldb_message *msg, 
   const char *attr, struct samr_Password **hashes)
 {
uint_t count = 0;
diff --git a/source4/dsdb/samdb/ldb_modules/password_hash.c 
b/source4/dsdb/samdb/ldb_modules/password_hash.c
index 5a9926b..44b7ef9 100644
--- a/source4/dsdb/samdb/ldb_modules/password_hash.c
+++ b/source4/dsdb/samdb/ldb_modules/password_hash.c
@@ -1432,6 +1432,67 @@ static int setup_password_fields(struct 
setup_password_fields_io *io)
return LDB_SUCCESS;
 }
 
+static int setup_io(struct ph_context *ac, 
+   const struct ldb_message *new_msg, 
+   const struct ldb_message *searched_msg, 
+   struct setup_password_fields_io *io) 
+{ 
+   const struct ldb_val *quoted_utf16;
+   struct ldb_context *ldb = ldb_module_get_ctx(ac-module);
+
+   ZERO_STRUCTP(io);
+
+   /* Some operations below require kerberos contexts */
+   if (smb_krb5_init_context(ac,
+ ldb_get_event_context(ldb),
+ (struct loadparm_context 
*)ldb_get_opaque(ldb, loadparm),
+ io-smb_krb5_context) != 0) {
+   return LDB_ERR_OPERATIONS_ERROR;
+   }
+
+   io-ac  = ac;
+   io-domain  = ac-domain;
+
+   io-u.user_account_control  = samdb_result_uint(searched_msg, 
userAccountControl, 0);
+   io-u.sAMAccountName= samdb_result_string(searched_msg, 
samAccountName, NULL);
+   io-u.user_principal_name   = samdb_result_string(searched_msg, 
userPrincipalName, NULL);
+   io-u.is_computer   = 
ldb_msg_check_string_attribute(searched_msg, objectClass, computer);
+
+   io-n.cleartext_utf8= ldb_msg_find_ldb_val(new_msg, 
userPassword);
+   io-n.cleartext_utf16   = ldb_msg_find_ldb_val(new_msg, 
clearTextPassword);
+
+   /* this rather strange looking piece of code is there to
+  handle a ldap client setting a password remotely using the
+  unicodePwd ldap field. The syntax is that the password is
+  in UTF-16LE, with a  at either end. Unfortunately the
+  unicodePwd field is also used to store the nt hashes
+  internally in Samba, and is used in the nt hash format on
+  the wire in DRS replication, so we have a single name for
+  two distinct values. The code below leaves us with a small
+  chance (less than 1 in 2^32) of a mixup, if someone manages
+  to create a MD4 hash which starts and ends in 0x22 0x00, as
+  that would then be treated as a UTF16 password rather than
+  a nthash */
+   quoted_utf16= ldb_msg_find_ldb_val(new_msg,