[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Andrew Tridgell
The branch, master has been updated
   via  9bd695c samba-tool: update tests for new 'user enable' syntax
   via  1bc1ac0 samba-tool: improved error handling in user setexpiry
   via  7b3d8b6 samba-tool: improved user enable error handling
   via  23177b5 s4:samba-tool: Move samba-tool setexpiry to samba-tool user 
setexpiry user
   via  726ee12 s4/samba-tool: Move samba-tool enableaccount to samba-tool 
user enable command.
  from  f725e2b build: fixed a problem with installing scripts in the build 
tree

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


- Log -
commit 9bd695c83f43cacfc08566f3c18db44b61f7ed75
Author: Andrew Tridgell tri...@samba.org
Date:   Wed Jun 1 17:22:15 2011 +1000

samba-tool: update tests for new 'user enable' syntax

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Wed Jun  1 10:37:50 CEST 2011 on sn-devel-104

commit 1bc1ac0d084976fccf187526f7bd8d9ad818da10
Author: Andrew Tridgell tri...@samba.org
Date:   Wed Jun 1 14:46:04 2011 +1000

samba-tool: improved error handling in user setexpiry

commit 7b3d8b6c908a37bb06e413dee406cebd29b99b3e
Author: Andrew Tridgell tri...@samba.org
Date:   Wed Jun 1 14:41:51 2011 +1000

samba-tool: improved user enable error handling

commit 23177b5f44815bc5b46943c70d37dc626ed60288
Author: Theresa Halloran theresahallo...@gmail.com
Date:   Thu May 19 16:24:00 2011 -0400

s4:samba-tool: Move samba-tool setexpiry to samba-tool user setexpiry user

Signed-off-by: Andrew Tridgell tri...@samba.org

commit 726ee12bb450821f929e05ca1c708f3e33f909cf
Author: Theresa Halloran theresahallo...@gmail.com
Date:   Thu May 19 16:17:07 2011 -0400

s4/samba-tool: Move samba-tool enableaccount to samba-tool user enable 
command.

Signed-off-by: Andrew Tridgell tri...@samba.org

---

Summary of changes:
 source4/scripting/python/samba/netcmd/__init__.py  |5 +-
 .../scripting/python/samba/netcmd/enableaccount.py |   60 -
 source4/scripting/python/samba/netcmd/setexpiry.py |   67 ---
 source4/scripting/python/samba/netcmd/user.py  |   89 +++-
 source4/scripting/python/samba/samdb.py|6 ++
 source4/setup/tests/blackbox_newuser.sh|   12 ++--
 testprogs/blackbox/test_kinit.sh   |2 +-
 testprogs/blackbox/test_pkinit.sh  |2 +-
 8 files changed, 103 insertions(+), 140 deletions(-)
 delete mode 100644 source4/scripting/python/samba/netcmd/enableaccount.py
 delete mode 100644 source4/scripting/python/samba/netcmd/setexpiry.py


Changeset truncated at 500 lines:

diff --git a/source4/scripting/python/samba/netcmd/__init__.py 
b/source4/scripting/python/samba/netcmd/__init__.py
index cf514d5..d934cf8 100644
--- a/source4/scripting/python/samba/netcmd/__init__.py
+++ b/source4/scripting/python/samba/netcmd/__init__.py
@@ -2,6 +2,7 @@
 
 # Unix SMB/CIFS implementation.
 # Copyright (C) Jelmer Vernooij jel...@samba.org 2009
+# Copyright (C) Theresa Halloran theresahallo...@gmail.com 2011
 #
 # 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
@@ -179,10 +180,6 @@ from samba.netcmd.domainlevel import cmd_domainlevel
 commands[domainlevel] = cmd_domainlevel()
 from samba.netcmd.setpassword import cmd_setpassword
 commands[setpassword] = cmd_setpassword()
-from samba.netcmd.setexpiry import cmd_setexpiry
-commands[setexpiry] = cmd_setexpiry()
-from samba.netcmd.enableaccount import cmd_enableaccount
-commands[enableaccount] = cmd_enableaccount()
 from samba.netcmd.newuser import cmd_newuser
 commands[newuser] = cmd_newuser()
 from samba.netcmd.netacl import cmd_acl
diff --git a/source4/scripting/python/samba/netcmd/enableaccount.py 
b/source4/scripting/python/samba/netcmd/enableaccount.py
deleted file mode 100644
index 3ceddb3..000
--- a/source4/scripting/python/samba/netcmd/enableaccount.py
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/usr/bin/env python
-#
-# Enables an user account on a Samba4 server
-# Copyright Jelmer Vernooij 2008
-#
-# Based on the original in EJS:
-# Copyright Andrew Tridgell 2005
-#
-# 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/.
-#
-
-import samba.getopt as 

[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Rusty Russell
The branch, master has been updated
   via  e340cd8 lib/tevent/tevent.h: minor documentation fix.
   via  c29069e libcli/cldap/cldap.c: don't hand huge values to 
tevent_timeval_add usecs
   via  0204ae6 lib/util/time.c: timeval_current_ofs_usec
   via  56e7233 lib/util/time.c: timeval_current_ofs_msec
  from  9bd695c samba-tool: update tests for new 'user enable' syntax

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


- Log -
commit e340cd83f87a9ea02cacd9af520d154652c5afb1
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Wed Jun 1 12:20:11 2011 +0930

lib/tevent/tevent.h: minor documentation fix.

The usecs arguments are (of course) microseconds, not milliseconds.
This was added by Andreas Schneider in 6c1bcdc2 (tevent: Document the
tevent helper functions.).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

Autobuild-User: Rusty Russell ru...@rustcorp.com.au
Autobuild-Date: Wed Jun  1 11:47:38 CEST 2011 on sn-devel-104

commit c29069e079018853867d643b8de604edd95c94d9
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Wed Jun 1 12:20:08 2011 +0930

libcli/cldap/cldap.c: don't hand huge values to tevent_timeval_add usecs

state-request.delay is two million here, resulting in an invalid timeval.
Since tevent doesn't have a convenient wrapper to add arbitrary usecs,
do the arithmetic here (it's the sole caller of this function).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

commit 0204ae6229bae3573b3194c3f657c8f385c0b940
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Wed Jun 1 11:24:51 2011 +0930

lib/util/time.c: timeval_current_ofs_usec

Several places want microseconds from current time, and several were
simply handing usecs values which could be over a million.

Using a helper to do this is safer and more readable.

I didn't replace any obviously correct callers (ie. constants).

I also renamed wait_nsec in source3/lib/util_sock.c; it's actually
microseconds not nanoseconds (introduced with this code in Volker's
19b783cc Async wrapper for open_socket_out_send/recv).

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

commit 56e72337b01216dc7cba418f040a5cc928e5fc6f
Author: Rusty Russell ru...@rustcorp.com.au
Date:   Wed Jun 1 11:21:15 2011 +0930

lib/util/time.c: timeval_current_ofs_msec

Several places want milliseconds from current time, and several were
simply doing msec * 1000 which can (and does in one place) result in
a usec value over 1 a million.

Using a helper to do this is safer and more readable.

Signed-off-by: Rusty Russell ru...@rustcorp.com.au

---

Summary of changes:
 lib/tevent/tevent.h|6 +++---
 lib/util/time.c|   18 ++
 lib/util/time.h|   10 ++
 libcli/cldap/cldap.c   |6 --
 source3/lib/util_sock.c|   14 +++---
 source3/libsmb/async_smb.c |3 +--
 source3/nmbd/nmbd_processlogon.c   |3 +--
 source3/rpc_client/rpc_transport_tstream.c |6 +++---
 source3/smbd/blocking.c|3 +--
 source3/smbd/fileio.c  |2 +-
 source3/smbd/smb2_lock.c   |4 +---
 source4/lib/socket/connect_multi.c |2 +-
 source4/libcli/raw/clitransport.c  |2 +-
 source4/ntvfs/posix/pvfs_lock.c|3 +--
 source4/ntvfs/posix/pvfs_open.c|2 +-
 source4/ntvfs/posix/pvfs_write.c   |2 +-
 16 files changed, 55 insertions(+), 31 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index f4eb60c..38a4a9c 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -1218,7 +1218,7 @@ struct timeval tevent_timeval_current(void);
  *
  * @param[in]  secs The seconds to set.
  *
- * @param[in]  usecsThe milliseconds to set.
+ * @param[in]  usecsThe microseconds to set.
  *
  * @return  A timeval structure with the given values.
  */
@@ -1253,7 +1253,7 @@ bool tevent_timeval_is_zero(const struct timeval *tv);
  *
  * @param[in]  secs  The seconds to add to the timeval.
  *
- * @param[in]  usecs The milliseconds to add to the timeval.
+ * @param[in]  usecs The microseconds to add to the timeval.
  *
  * @return   The timeval structure with the new time.
  */
@@ -1265,7 +1265,7 @@ struct timeval tevent_timeval_add(const struct timeval 
*tv, uint32_t secs,
  *
  * @param[in]  secs The seconds of the offset from now.
  *
- * @param[in]  usecsThe milliseconds of the offset from now.
+ * @param[in]  usecsThe microseconds of the offset from now.
  *
  * @return  

[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Andreas Schneider
The branch, master has been updated
   via  b5aeee7 s3-epmapper: Register ports on IPv4 too.
   via  4640d90 s3-rpc_server: Remove unused variable pipes_open.
   via  f086057 s3-rpc_server: Remove syntax from pipes_struct.
   via  751ecd9 s3-rpc_server: Fixed debug messages of srv_pipe_hnd.
   via  9f1b20e s3-rpc_server: Fixed debug messages for rpc_handles.
   via  89ced2c s3-rpc_server: Fix debug messages.
   via  e744222 s3-rpc_server: Don't segfault if there are not handles to 
free.
   via  438b24a s3-rpc_server: Remove guessing of the syntax id.
   via  7d800a8 s3-rpc_server: Use the correct syntax id for debugging.
   via  6b0f82e s3-rpc_server: Migrate init_pipe_handles() to new syntax.
   via  58485af s3-rpc_server: Use the context syntax id in 
api_pipe_request().
   via  c8ec695 s3-rpc_server: Use the correct syntax id in 
api_pipe_bind_req().
   via  6e8c7d0 s3-rpc_server: Use the correct context syntax.
   via  34a600a s3-rpc_server: Move the context functions to own file.
   via  e39e09f s3-rpc_server: Store the ndr syntax id in the pipe context.
   via  44fb114 s3-rpc_server: Added syntax id to pipe_rpc_fns struct.
  from  e340cd8 lib/tevent/tevent.h: minor documentation fix.

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


- Log -
commit b5aeee76c926f102c3bee396c831475b1eeb18d5
Author: Andreas Schneider a...@samba.org
Date:   Wed May 25 17:37:51 2011 +0200

s3-epmapper: Register ports on IPv4 too.

Autobuild-User: Andreas Schneider a...@cryptomilk.org
Autobuild-Date: Wed Jun  1 13:14:53 CEST 2011 on sn-devel-104

commit 4640d908f7abd0c0a96e89162adc23d1ee78b71c
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 11:35:39 2011 +0200

s3-rpc_server: Remove unused variable pipes_open.

commit f086057ce89a5a09e26b7b0f85e598951a866851
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 13:37:11 2011 +0200

s3-rpc_server: Remove syntax from pipes_struct.

commit 751ecd9bf7e3d657cad7de72f396a15357f9d26f
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 13:42:52 2011 +0200

s3-rpc_server: Fixed debug messages of srv_pipe_hnd.

commit 9f1b20e971ec0760ec2b3699f72daa54073ce656
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 13:32:22 2011 +0200

s3-rpc_server: Fixed debug messages for rpc_handles.

commit 89ced2cc49971557b23b8ae8fb804e16bed8cb6c
Author: Andreas Schneider a...@samba.org
Date:   Mon May 30 11:27:07 2011 +0200

s3-rpc_server: Fix debug messages.

commit e744222e41b7c4c9b197641d3c5c87b27daf5ce8
Author: Andreas Schneider a...@samba.org
Date:   Wed May 25 17:26:28 2011 +0200

s3-rpc_server: Don't segfault if there are not handles to free.

commit 438b24a77f5173d9ffee76009589033ece6e9dce
Author: Andreas Schneider a...@samba.org
Date:   Wed May 25 17:26:01 2011 +0200

s3-rpc_server: Remove guessing of the syntax id.

This is only a wild guess. We don't know to which rpc service the client
wants to talk until we read the the rpc bind packet.

commit 7d800a8694e7c9bef96ae006ace5807872f375d4
Author: Andreas Schneider a...@samba.org
Date:   Mon May 30 11:11:48 2011 +0200

s3-rpc_server: Use the correct syntax id for debugging.

commit 6b0f82eeab04e59657231b73fd94d33cffaadc76
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 10:53:55 2011 +0200

s3-rpc_server: Migrate init_pipe_handles() to new syntax.

commit 58485afd91dde993cd7f14ca0182f661be4b719c
Author: Andreas Schneider a...@samba.org
Date:   Mon May 30 11:02:47 2011 +0200

s3-rpc_server: Use the context syntax id in api_pipe_request().

commit c8ec695cb3646c9f38a8a54171a2bdac2b1fd5a5
Author: Andreas Schneider a...@samba.org
Date:   Wed May 25 16:58:18 2011 +0200

s3-rpc_server: Use the correct syntax id in api_pipe_bind_req().

commit 6e8c7d08344158714041bbe5b344b453d8b7c225
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 13:33:05 2011 +0200

s3-rpc_server: Use the correct context syntax.

commit 34a600a27f5b288a9185b6d32c7252b9f5a81a09
Author: Andreas Schneider a...@samba.org
Date:   Tue May 31 10:28:39 2011 +0200

s3-rpc_server: Move the context functions to own file.

commit e39e09ffb5baa527b03454c905ccd1292fa9c93f
Author: Andreas Schneider a...@samba.org
Date:   Wed May 25 16:03:43 2011 +0200

s3-rpc_server: Store the ndr syntax id in the pipe context.

The client tell us in the rpc bind to which rpc service it wants to
connect. We did set the p-syntax earlier by guessing to which pipe name
it connects, but we don't know to which rpc service it wants to bind
until we read the first packet.

commit 44fb1140bb92259f10852e24bde82a13f926ca15
Author: Andreas Schneider a...@samba.org
Date:   Mon May 30 10:40:37 2011 +0200

s3-rpc_server: Added syntax id to pipe_rpc_fns struct.


[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Volker Lendecke
The branch, master has been updated
   via  2ab34a5 Revert s3: Mark sockets in error state writable
  from  b5aeee7 s3-epmapper: Register ports on IPv4 too.

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


- Log -
commit 2ab34a57367f56e36e8a9a5876cd53de8f0cd9ce
Author: Volker Lendecke v...@samba.org
Date:   Wed Jun 1 13:46:14 2011 +0200

Revert s3: Mark sockets in error state writable

This reverts commit 5f6f71956460d6840c1433b59e20555268b622ac.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Wed Jun  1 14:56:25 CEST 2011 on sn-devel-104

---

Summary of changes:
 source3/lib/events.c |   23 ---
 1 files changed, 0 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/events.c b/source3/lib/events.c
index 499d92e..9ff1488 100644
--- a/source3/lib/events.c
+++ b/source3/lib/events.c
@@ -260,29 +260,6 @@ bool run_events_poll(struct tevent_context *ev, int 
pollrtn,
 
if (pfd-revents  (POLLIN|POLLHUP|POLLERR)) {
flags |= EVENT_FD_READ;
-
-   if ((fde-flags  EVENT_FD_READ) == 0) {
-   /*
-* This one is a bit subtle. If a socket is
-* not being asked for readability and dies
-* with POLLHUP|POLLERR, then the write
-* handler must be activated to detect the
-* dead socket with a failed write(2)
-* call. The error I've seen is winbind
-* spinning in poll trying to send something
-* to a DC on a dead socket. poll gave
-* POLLHUP|POLLERR, but because winbind at
-* this moment only had asked for socket
-* writability, it spun.
-*
-* We can't activate EVENT_FD_WRITE though
-* whenever we have an error condition via
-* POLLHUP|POLLERR, because at least smbd
-* monitors EVENT_FD_WRITE in its callback,
-* doing nothing.
-*/
-   flags |= EVENT_FD_WRITE;
-   }
}
if (pfd-revents  POLLOUT) {
flags |= EVENT_FD_WRITE;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Michael Adam
The branch, master has been updated
   via  234a4fb s3:net-man: registry enumerate_recursive
   via  92a8ccf s3:net-man: registry deletekey  deletekey_recursive
   via  740a74d s3:net-man: missing dot
  from  2ab34a5 Revert s3: Mark sockets in error state writable

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


- Log -
commit 234a4fb1b3b36cec43ab703dd3b85799a1fcdf9f
Author: Gregor Beck gb...@sernet.de
Date:   Tue May 31 18:26:12 2011 +0200

s3:net-man: registry enumerate_recursive

Signed-off-by: Michael Adam ob...@samba.org

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Wed Jun  1 17:16:05 CEST 2011 on sn-devel-104

commit 92a8ccf00880b37bfaf775d874f79a8764b70b20
Author: Gregor Beck gb...@sernet.de
Date:   Tue May 31 18:25:53 2011 +0200

s3:net-man: registry deletekey  deletekey_recursive

Signed-off-by: Michael Adam ob...@samba.org

commit 740a74dcfb800a63f6225eb8bfa755d42b344f05
Author: Gregor Beck gb...@sernet.de
Date:   Tue May 31 18:15:38 2011 +0200

s3:net-man: missing dot

Signed-off-by: Michael Adam ob...@samba.org

---

Summary of changes:
 docs-xml/manpages-3/net.8.xml |   17 -
 1 files changed, 16 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml
index 18c74ef..fac9ba6 100644
--- a/docs-xml/manpages-3/net.8.xml
+++ b/docs-xml/manpages-3/net.8.xml
@@ -1854,8 +1854,10 @@ Manipulate Samba's registry.
 paraThe registry commands are:
 simplelist
 membernet registry enumerate   - Enumerate registry keys and values./member
+membernet registry enumerate_recursive - Enumerate registry key and its 
subkeys./member
 membernet registry createkey   - Create a new registry key./member
 membernet registry deletekey   - Delete a registry key./member
+membernet registry deletekey_recursive - Delete a registry key with 
subkeys./member
 membernet registry getvalue- Print a registry value./member
 membernet registry getvalueraw - Print a registry value (raw 
format)./member
 membernet registry setvalue- Set a new registry value./member
@@ -1878,7 +1880,13 @@ string./member
 
 refsect3
   titleREGISTRY ENUMERATE replaceablekey/replaceable /title
-  paraEnumerate subkeys and values of emphasiskey/emphasis
+  paraEnumerate subkeys and values of emphasiskey/emphasis.
+  /para
+/refsect3
+
+refsect3
+  titleREGISTRY ENUMERATE_RECURSIVE replaceablekey/replaceable /title
+  paraEnumerate values of emphasiskey/emphasis and its subkeys.
   /para
 /refsect3
 
@@ -1890,6 +1898,13 @@ string./member
 
 refsect3
   titleREGISTRY DELETEKEY replaceablekey/replaceable /title
+  paraDelete the given emphasiskey/emphasis and its
+  values from the registry, if it has no subkeys.
+  /para
+/refsect3
+
+refsect3
+  titleREGISTRY DELETEKEY_RECURSIVE replaceablekey/replaceable /title
   paraDelete the given emphasiskey/emphasis and all of its
   subkeys and values from the registry.
   /para


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-6-test has been updated
   via  330d16f Improve documentation for net rpc trust
  from  91447e8 s3: Use the correct guest_login field in auth_server

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 330d16f39097208c807526ccdc4ff7ab4e7d9c48
Author: Sumit Bose sb...@redhat.com
Date:   Mon May 30 11:14:47 2011 +0200

Improve documentation for net rpc trust

Add man pages entries and fix usage output.

Signed-off-by: Günther Deschner g...@samba.org

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Mon May 30 20:05:34 CEST 2011 on sn-devel-104
(cherry picked from commit e10f27d5759b2d21c82fdb20f5641e1f6feab158)

---

Summary of changes:
 docs-xml/manpages-3/net.8.xml |  120 +
 source3/utils/net_rpc_trust.c |   29 ++-
 2 files changed, 136 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages-3/net.8.xml b/docs-xml/manpages-3/net.8.xml
index d69a3b7..18c74ef 100644
--- a/docs-xml/manpages-3/net.8.xml
+++ b/docs-xml/manpages-3/net.8.xml
@@ -795,7 +795,127 @@ appear in your system.
 paraList all interdomain trust relationships./para
 
 /refsect3
+refsect3
+titleRPC TRUSTDOM LIST/title
+
+paraList all interdomain trust relationships./para
+
+/refsect3
+/refsect2
+
+refsect2
+titleRPC TRUST/title
+
+refsect3
+titleRPC TRUST CREATE/title
+
+paraCreate a trust trust object by calling lsaCreateTrustedDomainEx2.
+The can be done on a single server or on two servers at once with the
+possibility to use a random trust password./para
+
+variablelisttitleOptions:/title
+varlistentry
+termotherserver/term
+listitemparaDomain controller of the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termotheruser/term
+listitemparaAdmin user in the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termotherdomainsid/term
+listitemparaSID of the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termother_netbios_domain/term
+listitemparaNetBIOS (short) name of the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termotherdomain/term
+listitemparaDNS (full) name of the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termtrustpw/term
+listitemparaTrust password/para/listitem
+/varlistentry
+/variablelist
 
+variablelisttitleExamples:/title
+varlistentry
+termCreate a trust object on srv1.dom1.dom for the domain dom2/term
+listitemliterallayout
+net rpc trust create \
+otherdomainsid=S-x-x-xx-xx-xx-x \
+other_netbios_domain=dom2 \
+otherdomain=dom2.dom \
+trustpw=12345678 \
+-S srv1.dom1.dom
+/literallayout/listitem
+/varlistentry
+varlistentry
+termCreate a trust relationship between dom1 and dom2/term
+listitemliterallayout
+net rpc trust create \
+otherserver=srv2.dom2.test \
+otheruser=dom2adm \
+-S srv1.dom1.dom
+/literallayout/listitem
+/varlistentry
+/variablelist
+/refsect3
+
+refsect3
+titleRPC TRUST DELETE/title
+
+paraDelete a trust trust object by calling lsaDeleteTrustedDomain.
+The can be done on a single server or on two servers at once./para
+
+variablelisttitleOptions:/title
+varlistentry
+termotherserver/term
+listitemparaDomain controller of the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termotheruser/term
+listitemparaAdmin user in the second domain/para/listitem
+/varlistentry
+
+varlistentry
+termotherdomainsid/term
+listitemparaSID of the second domain/para/listitem
+/varlistentry
+/variablelist
+
+variablelisttitleExamples:/title
+varlistentry
+termDelete a trust object on srv1.dom1.dom for the domain dom2/term
+listitemliterallayout
+net rpc trust delete \
+otherdomainsid=S-x-x-xx-xx-xx-x \
+-S srv1.dom1.dom
+/literallayout/listitem
+/varlistentry
+varlistentry
+termDelete a trust relationship between dom1 and dom2/term
+listitemliterallayout
+net rpc trust delete \
+otherserver=srv2.dom2.test \
+otheruser=dom2adm \
+-S srv1.dom1.dom
+/literallayout/listitem
+/varlistentry
+/variablelist
+/refsect3
+
+/refsect2
+
+refsect2
 refsect3
 titleRPC RIGHTS/title
 
diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c
index eee68d0..b099d52 100644
--- a/source3/utils/net_rpc_trust.c
+++ b/source3/utils/net_rpc_trust.c
@@ -419,19 +419,22 @@ static int rpc_trust_common(struct net_context *net_ctx, 
int argc,
struct other_dom_data *other_dom_data;
struct net_context *other_net_ctx = NULL;
struct dom_data dom_data[2];
+   void (*usage)(void);
+
+   switch (op) {
+   case TRUST_CREATE:
+   usage = print_trust_usage;
+   break;
+   case TRUST_DELETE:
+   usage = print_trust_delete_usage;
+   

[SCM] Samba Shared Repository - branch v3-6-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-6-test has been updated
   via  28f0326 s3:smbcacls: fix parsing of multiple flags
  from  330d16f Improve documentation for net rpc trust

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 28f0326b22483cce6cb86cfa9772bc5d4e3b7c5f
Author: Gregor Beck gb...@sernet.de
Date:   Thu May 26 10:15:56 2011 +0200

s3:smbcacls: fix parsing of multiple flags

Signed-off-by: Michael Adam ob...@samba.org
(cherry picked from commit c967e8fae5babf6e337c0e2b85fc42eccfe9e4c4)

Fix bug #8192

---

Summary of changes:
 source3/utils/smbcacls.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/smbcacls.c b/source3/utils/smbcacls.c
index 2fd9a53..1d5789d 100644
--- a/source3/utils/smbcacls.c
+++ b/source3/utils/smbcacls.c
@@ -360,7 +360,12 @@ static bool parse_ace_flags(const char *str, unsigned int 
*pflags)
return false;
}
 
-   if (*p != '|'  *p != '\0') {
+   switch (*p) {
+   case '|':
+   p++;
+   case '\0':
+   continue;
+   default:
return false;
}
}


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-6-test has been updated
   via  4361092 s3: Safely mark our sconn as smb2 if we have that protocol
  from  28f0326 s3:smbcacls: fix parsing of multiple flags

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit 43610924c0052d8ea2defb54493677607a06332a
Author: Volker Lendecke v...@samba.org
Date:   Mon May 30 16:30:54 2011 +0200

s3: Safely mark our sconn as smb2 if we have that protocol

Otherwise smbd will crash at an unclean exit. Without this conn_close_all 
will
do a close_cnum() on all connection_struct's. In smb2, those are talloc
children of the smbd_smb2_tcon's. sconn is talloc_free'ed after the
conn_close_all, but the smbd_smb2_tcon destructor will still reference
tcon-compat_conn, referencing then free'ed (and null'ed out) memory.

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Mon May 30 22:49:53 CEST 2011 on sn-devel-104
(cherry picked from commit c981d4fa1269569a1c2db4bf72a67a357aacd69f)

Fix bug #8199 (potential crash in smbd handling smb2).

---

Summary of changes:
 source3/smbd/smb2_negprot.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index f9528f8..f639503 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -177,5 +177,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct 
smbd_smb2_request *req)
 
outdyn = security_buffer;
 
+   req-sconn-using_smb2 = true;
+
return smbd_smb2_request_done(req, outbody, outdyn);
 }


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-5-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  0ffdf22 Fix bug #7528 - Solaris with NIS autohome.
  from  ac4aca9 WHATSNEW: Start to add changes since 3.5.8.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit 0ffdf2288b1e6798e43259568818378c43b979e5
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 20:38:48 2011 +0200

Fix bug #7528 - Solaris with NIS autohome.

---

Summary of changes:
 source3/lib/util.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/util.c b/source3/lib/util.c
index 46be349..238981d 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1312,6 +1312,9 @@ char *automount_lookup(TALLOC_CTX *ctx, const char 
*user_name)
if ((nis_error = yp_match(nis_domain, nis_map, user_name,
strlen(user_name), nis_result,
nis_result_len)) == 0) {
+   if (nis_result_len  0  nis_result[nis_result_len] == '\n') {
+   nis_result[nis_result_len] = '\0';
+   }
value = talloc_strdup(ctx, nis_result);
if (!value) {
return NULL;


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-6-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-6-test has been updated
   via  c5b7912 s3-winbind: BUG 8166 - Don't lockout users when offline.
  from  4361092 s3: Safely mark our sconn as smb2 if we have that protocol

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test


- Log -
commit c5b79122d9ea3945df721cb364249c5c33f35b19
Author: Jim McDonough j...@samba.org
Date:   Wed May 25 10:49:41 2011 -0400

s3-winbind: BUG 8166 - Don't lockout users when offline.

Windows does not track bad password attempts when offline.  We were locking 
users out but not honoring the lockout duration.

Autobuild-User: Jim McDonough j...@samba.org
Autobuild-Date: Wed May 25 18:11:10 CEST 2011 on sn-devel-104
(cherry picked from commit b58534f1fca27e3e72f4f4107538ec05734bd42a)

---

Summary of changes:
 source3/winbindd/winbindd_pam.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index 412ec83..6b87482 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -993,7 +993,10 @@ static NTSTATUS winbindd_dual_pam_auth_cached(struct 
winbindd_domain *domain,
 
}
 
-   /* User does *NOT* know the correct password, modify info3 accordingly 
*/
+   /* User does *NOT* know the correct password, modify info3 accordingly, 
but only if online */
+   if (domain-online == false) {
+   goto failed;
+   }
 
/* failure of this is not critical */
result = get_max_bad_attempts_from_lockout_policy(domain, 
state-mem_ctx, max_allowed_bad_attempts);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch v3-5-test updated

2011-06-01 Thread Karolin Seeger
The branch, v3-5-test has been updated
   via  a73963dd s3-winbind: BUG 8166 - Don't lockout users when offline.
  from  0ffdf22 Fix bug #7528 - Solaris with NIS autohome.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test


- Log -
commit a73963dd49d33bcfdd5cbc310dad0f895683eadf
Author: Jim McDonough j...@samba.org
Date:   Wed May 25 10:49:41 2011 -0400

s3-winbind: BUG 8166 - Don't lockout users when offline.

Windows does not track bad password attempts when offline.  We were locking 
users out but not honoring the lockout duration.

Autobuild-User: Jim McDonough j...@samba.org
Autobuild-Date: Wed May 25 18:11:10 CEST 2011 on sn-devel-104
(cherry picked from commit b58534f1fca27e3e72f4f4107538ec05734bd42a)

---

Summary of changes:
 source3/winbindd/winbindd_pam.c |5 -
 1 files changed, 4 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c
index aab3b72..df83dc6 100644
--- a/source3/winbindd/winbindd_pam.c
+++ b/source3/winbindd/winbindd_pam.c
@@ -1071,7 +1071,10 @@ static NTSTATUS winbindd_dual_pam_auth_cached(struct 
winbindd_domain *domain,
 
}
 
-   /* User does *NOT* know the correct password, modify info3 accordingly 
*/
+   /* User does *NOT* know the correct password, modify info3 accordingly, 
but only if online */
+   if (domain-online == false) {
+   goto failed;
+   }
 
/* failure of this is not critical */
result = get_max_bad_attempts_from_lockout_policy(domain, 
state-mem_ctx, max_allowed_bad_attempts);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Jeremy Allison
The branch, master has been updated
   via  febde0d Move fd_close on error path to be identical to all other 
error paths.
   via  61e8c59 TALLOC_FREE already checks for null.
   via  5a2b5b6 Fix bug #8175 - smbd deadlock.
  from  234a4fb s3:net-man: registry enumerate_recursive

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


- Log -
commit febde0de5418ec40bb08159505e88997d9eb543c
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 12:17:43 2011 -0700

Move fd_close on error path to be identical to all other error paths.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Wed Jun  1 22:30:03 CEST 2011 on sn-devel-104

commit 61e8c5949a50665158bdfd1e7624a5ad27d34a13
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 12:12:26 2011 -0700

TALLOC_FREE already checks for null.

commit 5a2b5b6cfed74e0e9c2965525995f64cdad7b7c9
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 12:11:53 2011 -0700

Fix bug #8175 - smbd deadlock.

Force the open operation (which is the expensive one anyway) to
acquire and release locks in a way compatible with the more common
do_lock check.

Jeremy.

---

Summary of changes:
 source3/smbd/open.c |  105 +++---
 1 files changed, 73 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index bb7e6c2..d4b0934 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1055,18 +1055,8 @@ static bool delay_for_exclusive_oplocks(files_struct 
*fsp,
return false;
 }
 
-static bool file_has_brlocks(files_struct *fsp)
-{
-   struct byte_range_lock *br_lck;
-
-   br_lck = brl_get_locks_readonly(fsp);
-   if (!br_lck)
-   return false;
-
-   return br_lck-num_locks  0 ? true : false;
-}
-
 static void grant_fsp_oplock_type(files_struct *fsp,
+   const struct byte_range_lock *br_lck,
int oplock_request,
bool got_level2_oplock,
bool got_a_none_oplock)
@@ -1084,7 +1074,7 @@ static void grant_fsp_oplock_type(files_struct *fsp,
DEBUG(10,(grant_fsp_oplock_type: oplock type 0x%x on file 
%s\n,
fsp-oplock_type, fsp_str_dbg(fsp)));
return;
-   } else if (lp_locking(fsp-conn-params)  file_has_brlocks(fsp)) {
+   } else if (br_lck  br_lck-num_locks  0) {
DEBUG(10,(grant_fsp_oplock_type: file %s has byte range 
locks\n,
fsp_str_dbg(fsp)));
fsp-oplock_type = NO_OPLOCK;
@@ -1562,6 +1552,55 @@ void remove_deferred_open_entry(struct file_id id, 
uint64_t mid,
}
 }
 
+/
+ Ensure we get the brlock lock followed by the share mode lock
+ in the correct order to prevent deadlocks if other smbd's are
+ using the brlock database on this file simultaneously with this open
+ (that code also gets the locks in brlock - share mode lock order).
+/
+
+static bool acquire_ordered_locks(TALLOC_CTX *mem_ctx,
+   files_struct *fsp,
+   const struct file_id id,
+   const char *connectpath,
+   const struct smb_filename *smb_fname,
+   const struct timespec *p_old_write_time,
+   struct share_mode_lock **p_lck,
+   struct byte_range_lock **p_br_lck)
+{
+   /* Ordering - we must get the br_lck for this
+  file before the share mode. */
+   if (lp_locking(fsp-conn-params)) {
+   *p_br_lck = brl_get_locks_readonly(fsp);
+   if (*p_br_lck == NULL) {
+   DEBUG(0, (Could not get br_lock\n));
+   return false;
+   }
+   /* Note - we don't need to free the returned
+  br_lck explicitly as it was allocated on talloc_tos()
+  and so will be autofreed (and release the lock)
+  once the frame context disappears.
+
+  If it was set to fsp-brlock_rec then it was
+  talloc_move'd to hang off the fsp pointer and
+  in this case is guarenteed to not be holding the
+  lock on the brlock database. */
+   }
+
+   *p_lck = get_share_mode_lock(mem_ctx,
+   id,
+   connectpath,
+   smb_fname,
+   p_old_write_time);
+
+   if (*p_lck == NULL) {
+   DEBUG(0, (Could 

autobuild: intermittent test failure detected

2011-06-01 Thread autobuild
The autobuild test system has detected an intermittent failing test in 
the current master tree.

The autobuild log of the failure is available here:

   http://git.samba.org/autobuild.flakey/2011-06-02-0025/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-06-02-0025/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-06-02-0025/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-06-02-0025/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-06-02-0025/samba4.stdout
  
The top commit at the time of the failure was:

commit febde0de5418ec40bb08159505e88997d9eb543c
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 12:17:43 2011 -0700

Move fd_close on error path to be identical to all other error paths.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Wed Jun  1 22:30:03 CEST 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Jeremy Allison
The branch, master has been updated
   via  c06a31d Fix const warnings.
   via  cbfe802 Fix const warning.
   via  24ce9d5 Fix const warning.
   via  06fb258 release_ip() is only used with CLUSTER_SUPPORT.
   via  db46a9d Fix type mixing warnings.
   via  b08bd96 Fix bug where format arguments were reversed. Please 
compile with -Wall !
  from  febde0d Move fd_close on error path to be identical to all other 
error paths.

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


- Log -
commit c06a31dd65900f183e880cb5d135584aecbcc479
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:51:55 2011 -0700

Fix const warnings.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Thu Jun  2 01:02:53 CEST 2011 on sn-devel-104

commit cbfe8029a4890355a953813f6f588ed015ac077c
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:51:21 2011 -0700

Fix const warning.

commit 24ce9d52a644a8d7aa8e2ef3de1bb8cb644db410
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:50:49 2011 -0700

Fix const warning.

commit 06fb258500d04747d18b2b327221acd79c31f44c
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:49:43 2011 -0700

release_ip() is only used with CLUSTER_SUPPORT.

commit db46a9d6348869794c0c0cf5d6c7079cdc334426
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:49:03 2011 -0700

Fix type mixing warnings.

commit b08bd96dc0919ae1194f1269c01a78194d674e9c
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 14:45:59 2011 -0700

Fix bug where format arguments were reversed. Please compile with -Wall !

---

Summary of changes:
 librpc/ndr/ndr_string.c  |4 ++--
 source3/rpc_server/rpc_handles.c |4 ++--
 source3/smbd/process.c   |2 +-
 source3/utils/net_ads.c  |2 +-
 source3/utils/net_lookup.c   |2 +-
 source3/utils/testparm.c |2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/ndr/ndr_string.c b/librpc/ndr/ndr_string.c
index cf4d972..4510a71 100644
--- a/librpc/ndr/ndr_string.c
+++ b/librpc/ndr/ndr_string.c
@@ -147,7 +147,7 @@ _PUBLIC_ enum ndr_err_code ndr_pull_string(struct ndr_pull 
*ndr, int ndr_flags,
} else {
if (!do_convert) {
as = talloc_strndup(ndr-current_mem_ctx,
-   ndr-data + ndr-offset,
+   (char *)ndr-data + ndr-offset,
conv_src_len);
if (!as) {
return ndr_pull_error(ndr, NDR_ERR_ALLOC,
@@ -231,7 +231,7 @@ _PUBLIC_ enum ndr_err_code ndr_push_string(struct ndr_push 
*ndr, int ndr_flags,
 
if (!do_convert) {
d_len = s_len;
-   dest = talloc_strndup(ndr, s, s_len);
+   dest = (uint8_t *)talloc_strndup(ndr, s, s_len);
} else if (!convert_string_talloc(ndr, CH_UNIX, chset, s, s_len,
   (void **)(void *)dest, d_len))
{
diff --git a/source3/rpc_server/rpc_handles.c b/source3/rpc_server/rpc_handles.c
index 0b30251..7fa59b6 100644
--- a/source3/rpc_server/rpc_handles.c
+++ b/source3/rpc_server/rpc_handles.c
@@ -363,9 +363,9 @@ void *_policy_handle_create(struct pipes_struct *p, struct 
policy_handle *hnd,
 
if (p-pipe_handles-count  MAX_OPEN_POLS) {
DEBUG(0, (ERROR: Too many handles (%d) for RPC connection 
%s\n,
+ (int) p-pipe_handles-count,
  get_pipe_name_from_syntax(talloc_tos(),
-   p-contexts-syntax),
- (int) p-pipe_handles-count));
+   p-contexts-syntax)));
*pstatus = NT_STATUS_INSUFFICIENT_RESOURCES;
return NULL;
}
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index dbc0a33..7d96263 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -2346,6 +2346,7 @@ static void smbd_server_echo_handler(struct event_context 
*ev,
}
 }
 
+#ifdef CLUSTER_SUPPORT
 /
 received when we should release a specific IP
 /
@@ -2375,7 +2376,6 @@ static void release_ip(const char *ip, void *priv)
}
 }
 
-#ifdef CLUSTER_SUPPORT
 static int client_get_tcp_info(int sock, struct sockaddr_storage *server,
   struct sockaddr_storage *client)
 {
diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index f712ddf..69d5b10 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -2023,7 

[SCM] Samba Shared Repository - branch master updated

2011-06-01 Thread Jeremy Allison
The branch, master has been updated
   via  e98fb2f Remove another PATH_MAX.
   via  388bba0 Remove a PATH_MAX.
  from  c06a31d Fix const warnings.

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


- Log -
commit e98fb2f2b9542de97dee3f1a3e077d5306ec27b1
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 16:40:05 2011 -0700

Remove another PATH_MAX.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Thu Jun  2 02:51:06 CEST 2011 on sn-devel-104

commit 388bba05cf2bf3674831409d781a65c1f90292fa
Author: Jeremy Allison j...@samba.org
Date:   Wed Jun 1 16:07:24 2011 -0700

Remove a PATH_MAX.

---

Summary of changes:
 nsswitch/pam_winbind.c|5 +++--
 source3/libads/kerberos.c |   39 +++
 2 files changed, 30 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/pam_winbind.c b/nsswitch/pam_winbind.c
index f7637e7..7d5b70e 100644
--- a/nsswitch/pam_winbind.c
+++ b/nsswitch/pam_winbind.c
@@ -1212,7 +1212,7 @@ out:
 static void _pam_setup_krb5_env(struct pwb_context *ctx,
struct wbcLogonUserInfo *info)
 {
-   char var[PATH_MAX];
+   char *var = NULL;
int ret;
uint32_t i;
const char *krb5ccname = NULL;
@@ -1239,7 +1239,7 @@ static void _pam_setup_krb5_env(struct pwb_context *ctx,
_pam_log_debug(ctx, LOG_DEBUG,
   request returned KRB5CCNAME: %s, krb5ccname);
 
-   if (snprintf(var, sizeof(var), KRB5CCNAME=%s, krb5ccname) == -1) {
+   if (asprintf(var, KRB5CCNAME=%s, krb5ccname) == -1) {
return;
}
 
@@ -1249,6 +1249,7 @@ static void _pam_setup_krb5_env(struct pwb_context *ctx,
 failed to set KRB5CCNAME to %s: %s,
 var, pam_strerror(ctx-pamh, ret));
}
+   free(var);
 }
 
 /**
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 0b62ebf..48a832e 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -958,22 +958,37 @@ bool create_local_private_krb5_conf_for_domain(const char 
*realm,
/* Insanity, sheer insanity. */
 
if (strequal(realm, lp_realm())) {
-   char linkpath[PATH_MAX+1];
-   int lret;
-
-   lret = readlink(SYSTEM_KRB5_CONF_PATH, linkpath, 
sizeof(linkpath)-1);
-   if (lret != -1) {
-   linkpath[lret] = '\0';
-   }
-
-   if (lret != -1 || strcmp(linkpath, fname) == 0) {
-   /* Symlink already exists. */
-   goto done;
+   SMB_STRUCT_STAT sbuf;
+
+   if (sys_lstat(SYSTEM_KRB5_CONF_PATH, sbuf, false) == 0) {
+   if (S_ISLNK(sbuf.st_ex_mode)  sbuf.st_ex_size) {
+   int lret;
+   size_t alloc_size = sbuf.st_ex_size + 1;
+   char *linkpath = TALLOC_ARRAY(talloc_tos(), 
char,
+   alloc_size);
+   if (!linkpath) {
+   goto done;
+   }
+   lret = readlink(SYSTEM_KRB5_CONF_PATH, linkpath,
+   alloc_size - 1);
+   if (lret == -1) {
+   TALLOC_FREE(linkpath);
+   goto done;
+   }
+   linkpath[lret] = '\0';
+
+   if (strcmp(linkpath, fname) == 0) {
+   /* Symlink already exists. */
+   TALLOC_FREE(linkpath);
+   goto done;
+   }
+   TALLOC_FREE(linkpath);
+   }
}
 
/* Try and replace with a symlink. */
if (symlink(fname, SYSTEM_KRB5_CONF_PATH) == -1) {
-   const char *newpath = SYSTEM_KRB5_CONF_PATH ## .saved;
+   const char *newpath = SYSTEM_KRB5_CONF_PATH .saved;
if (errno != EEXIST) {

DEBUG(0,(create_local_private_krb5_conf_for_domain: symlink 
of %s to %s failed. Errno %s\n,


-- 
Samba Shared Repository