[SCM] Samba Shared Repository - branch master updated

2013-07-09 Thread Stefan Metzmacher
The branch, master has been updated
   via  e6a58d3 s4:rpc_server: make sure we don't terminate a connection 
with pending requests (bug #9820)
   via  2505d48 s4-winbindd: Do not terminate a connection that is still 
pending (bug #9820)
   via  df929d6 service_stream: Log if the connection termination is 
deferred or not (bug #9820)
  from  577cef8 s3-smbstatus: display [u|g]id of -1 as "-1" in connection 
list

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


- Log -
commit e6a58d370403e818bc2cfb8389751b78adcc14fd
Author: Stefan Metzmacher 
Date:   Tue Jul 9 16:38:59 2013 +0200

s4:rpc_server: make sure we don't terminate a connection with pending 
requests (bug #9820)

Sadly we may have nested event loops, which won't work correctly with
broken connections, that's why we have to do this...

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Stefan Metzmacher 
Autobuild-Date(master): Wed Jul 10 08:47:38 CEST 2013 on sn-devel-104

commit 2505d48e4fbcd8a805a88ad0b05fb1a16a588197
Author: Andrew Bartlett 
Date:   Thu Jun 27 11:28:03 2013 +1000

s4-winbindd: Do not terminate a connection that is still pending (bug #9820)

Instead, wait until the call attempts to reply, and let it terminate then

(often this happens in the attempt to then write to the broken pipe).

Andrew Bartlett

Pair-Programmed-With: Stefan Metzmacher 

Signed-off-by: Andrew Bartlett 
Signed-off-by: Stefan Metzmacher 
Reviewed-by: Andrew Bartlett 
Reviewed-by: Stefan Metzmacher 

commit df929d6feb857668ad9da277213e9fae1480ff63
Author: Andrew Bartlett 
Date:   Thu Jun 27 11:27:03 2013 +1000

service_stream: Log if the connection termination is deferred or not (bug 
#9820)

Signed-off-by: Andrew Bartlett 
Reviewed-by: Stefan Metzmacher 

---

Summary of changes:
 source4/rpc_server/dcerpc_server.c   |   55 -
 source4/rpc_server/dcerpc_server.h   |8 -
 source4/smbd/service_stream.c|6 +++-
 source4/winbind/wb_samba3_protocol.c |5 +++
 source4/winbind/wb_server.c  |   51 ++-
 source4/winbind/wb_server.h  |   10 +-
 6 files changed, 129 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/rpc_server/dcerpc_server.c 
b/source4/rpc_server/dcerpc_server.c
index 389cbe3..10e711b 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -386,6 +386,8 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_connect(struct 
dcesrv_context *dce_ctx,
return NT_STATUS_NO_MEMORY;
}
 
+   p->prev = NULL;
+   p->next = NULL;
p->dce_ctx = dce_ctx;
p->endpoint = ep;
p->contexts = NULL;
@@ -402,7 +404,7 @@ _PUBLIC_ NTSTATUS dcesrv_endpoint_connect(struct 
dcesrv_context *dce_ctx,
p->event_ctx = event_ctx;
p->msg_ctx = msg_ctx;
p->server_id = server_id;
-   p->processing = false;
+   p->terminate = NULL;
p->state_flags = state_flags;
ZERO_STRUCT(p->transport);
 
@@ -1143,6 +1145,7 @@ _PUBLIC_ NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx,
dce_ctx->lp_ctx = lp_ctx;
dce_ctx->assoc_groups_idr = idr_init(dce_ctx);
NT_STATUS_HAVE_NO_MEMORY(dce_ctx->assoc_groups_idr);
+   dce_ctx->broken_connections = NULL;
 
for (i=0;endpoint_servers[i];i++) {
const struct dcesrv_endpoint_server *ep_server;
@@ -1269,12 +1272,45 @@ const struct dcesrv_critical_sizes 
*dcerpc_module_version(void)
 
 static void dcesrv_terminate_connection(struct dcesrv_connection *dce_conn, 
const char *reason)
 {
+   struct dcesrv_context *dce_ctx = dce_conn->dce_ctx;
struct stream_connection *srv_conn;
srv_conn = talloc_get_type(dce_conn->transport.private_data,
   struct stream_connection);
 
-   stream_terminate_connection(srv_conn, reason);
+   if (dce_conn->pending_call_list == NULL) {
+   char *full_reason = talloc_asprintf(dce_conn, "dcesrv: %s", 
reason);
+
+   DLIST_REMOVE(dce_ctx->broken_connections, dce_conn);
+   stream_terminate_connection(srv_conn, full_reason ? full_reason 
: reason);
+   return;
+   }
+
+   if (dce_conn->terminate != NULL) {
+   return;
+   }
+
+   DEBUG(3,("dcesrv: terminating connection due to '%s' defered due to 
pending calls\n",
+reason));
+   dce_conn->terminate = talloc_strdup(dce_conn, reason);
+   if (dce_conn->terminate == NULL) {
+   dce_conn->terminate = "dcesrv: defered terminating connection - 
no memory";
+   }
+   DLIST_ADD_END(dce_ctx->broken_connections, dce_conn, NU

[SCM] Samba Shared Repository - branch master updated

2013-07-09 Thread Jeremy Allison
The branch, master has been updated
   via  577cef8 s3-smbstatus: display [u|g]id of -1 as "-1" in connection 
list
   via  c52e61f s3-lib: hide incomplete smbXsrv_tcon_global records
   via  53aa069 s3-lib: fix segf while reading incomplete session info (bug 
#10003)
   via  191e6b9 waf: Build with RELRO if supported by the compiler.
   via  aef8aad smbd: Fix a profile problem
  from  cd36a3e lib/param: sync debug related options with source3/param

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


- Log -
commit 577cef82c776759c9f3cad7d33057ac865c40769
Author: Björn Baumbach 
Date:   Tue Jul 9 12:32:34 2013 +0200

s3-smbstatus: display [u|g]id of -1 as "-1" in connection list

In order to avoid displayed uid or gid of "4294967295" instead of "-1", we
need to fetch the special case -1.
The id can be -1 if we are reading e.g. incomplete session information.

Signed-off-by: Björn Baumbach 
Reviewed-by: Stefan Metzmacher 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Wed Jul 10 01:18:30 CEST 2013 on sn-devel-104

commit c52e61f7ba215da28cbb7b8e328aea110ad79b11
Author: Stefan Metzmacher 
Date:   Mon Jul 8 16:31:13 2013 +0200

s3-lib: hide incomplete smbXsrv_tcon_global records

Part of fix for bug #10003

Pair-programmed-with: Björn Baumbach 

Signed-off-by: Stefan Metzmacher 
Signed-off-by: Björn Baumbach 
Reviewed-by: Jeremy Allison 

commit 53aa069b97070c73b782e2868b9b9686abe353cc
Author: Björn Baumbach 
Date:   Fri Jul 5 13:19:59 2013 +0200

s3-lib: fix segf while reading incomplete session info (bug #10003)

Pair-programmed-with: Stefan Metzmacher 

Signed-off-by: Stefan Metzmacher 
Signed-off-by: Björn Baumbach 
Reviewed-by: Jeremy Allison 

commit 191e6b9441d6789ecc16a3a80eb36ec5b410c083
Author: Andreas Schneider 
Date:   Fri Jul 5 08:13:56 2013 +0200

waf: Build with RELRO if supported by the compiler.

Make sure we create binaries with full RELocation Read-Only support. See
https://isisblogs.poly.edu/2011/06/01/relro-relocation-read-only/
for more details.

The default is to check if the compiler supports RELRO and then enable
it. Specifying '--with-relro' will make it mandatory and
'--without-relro' will disable it.

Signed-off-by: Andreas Schneider 
Reviewed-by: Jeremy Allison 

commit aef8aad638b916026651d900b91e963897b31c1a
Author: Volker Lendecke 
Date:   Tue Jul 9 11:02:39 2013 -0700

smbd: Fix a profile problem

When trying to read a profile, under certain circumstances Windows tries
to read with its machine account first. The profile previously written
was stored with an ACL that only allows access for the user and not
the machine. Windows should get an NT_STATUS_ACCESS_DENIED when using
the machine account, making it retry with the user account (which would
then succeed).

Samba under these circumstances erroneously gives
NT_STATUS_OBJECT_PATH_NOT_FOUND, which makes Windows give up and not
retry. The reasons is the "dropbox" patch in unix_convert, turning EACCESS
on the last path component to OBJECT_PATH_NOT_FOUND. This patch makes
the dropbox behaviour only kick in when we are creating a file. I think
this is an abstraction violation. unix_convert() should not have to know
about the create_disposition, but given that we have pathname resolution
separated from the core open code right now this is the best we can do.

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 buildtools/wafsamba/wafsamba.py |2 +
 source3/lib/conn_tdb.c  |   22 -
 source3/lib/sessionid_tdb.c |   15 
 source3/smbd/filename.c |3 +-
 source3/smbd/nttrans.c  |6 +++-
 source3/smbd/reply.c|   48 --
 source3/smbd/smb2_create.c  |3 +-
 source3/smbd/smbd.h |1 +
 source3/utils/status.c  |   24 ---
 wscript |   18 ++
 10 files changed, 104 insertions(+), 38 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index aaa0939..caa6fb1 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -348,6 +348,8 @@ def SAMBA_BINARY(bld, binname, source,
 if bld.env['ENABLE_PIE'] == True:
 pie_cflags += ' -fPIE'
 pie_ldflags.extend(TO_LIST('-pie'))
+if bld.env['ENABLE_RELRO'] == True:
+pie_ldflags.extend(TO_LIST('-Wl,-z,relro,-z,now'))
 
 # first create a target for building the object files for this binary
 # by separati

autobuild: intermittent test failure detected

2013-07-09 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/2013-07-09-1942/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2013-07-09-1942/samba3.stderr
   http://git.samba.org/autobuild.flakey/2013-07-09-1942/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2013-07-09-1942/samba.stderr
   http://git.samba.org/autobuild.flakey/2013-07-09-1942/samba.stdout
  
The top commit at the time of the failure was:

commit cd36a3e902813c065e14059d325f7628b06595aa
Author: Stefan Metzmacher 
Date:   Thu Jul 4 18:11:02 2013 +0200

lib/param: sync debug related options with source3/param

The most important change is "debug hires timestamp = Yes"
and "syslog = 1".

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Björn Jacke 

Autobuild-User(master): Björn Jacke 
Autobuild-Date(master): Tue Jul  9 17:15:15 CEST 2013 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2013-07-09 Thread Björn Jacke
The branch, master has been updated
   via  cd36a3e lib/param: sync debug related options with source3/param
   via  5f93822 lib/ldb-samba: only debug LDB_DEBUG_TRACE at level 10
   via  8e0752f lib/ldb-samba: make use of DBGC_LDB
   via  baecc86 lib/util: add 'ldb' debug class
  from  e6f79b9 tevent: document tevent_req_create state zeroing

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


- Log -
commit cd36a3e902813c065e14059d325f7628b06595aa
Author: Stefan Metzmacher 
Date:   Thu Jul 4 18:11:02 2013 +0200

lib/param: sync debug related options with source3/param

The most important change is "debug hires timestamp = Yes"
and "syslog = 1".

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Björn Jacke 

Autobuild-User(master): Björn Jacke 
Autobuild-Date(master): Tue Jul  9 17:15:15 CEST 2013 on sn-devel-104

commit 5f93822ede7ec3dc79a8057174342b2c6bb94a3b
Author: Stefan Metzmacher 
Date:   Tue Jul 9 13:56:35 2013 +0200

lib/ldb-samba: only debug LDB_DEBUG_TRACE at level 10

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Björn Jacke 

commit 8e0752f4d6feea35304377222d3dd487355e4120
Author: Stefan Metzmacher 
Date:   Tue Jul 9 13:56:08 2013 +0200

lib/ldb-samba: make use of DBGC_LDB

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Björn Jacke 

commit baecc863de0ceb64187c6eb3545bf28706bd84fc
Author: Stefan Metzmacher 
Date:   Tue Jul 9 13:55:44 2013 +0200

lib/util: add 'ldb' debug class

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Björn Jacke 

---

Summary of changes:
 lib/ldb-samba/ldb_wrap.c |4 +++-
 lib/param/loadparm.c |   18 +-
 lib/util/debug.c |1 +
 lib/util/debug.h |3 ++-
 4 files changed, 23 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldb_wrap.c b/lib/ldb-samba/ldb_wrap.c
index 028bd6f..65956ef 100644
--- a/lib/ldb-samba/ldb_wrap.c
+++ b/lib/ldb-samba/ldb_wrap.c
@@ -37,6 +37,8 @@
 #include "../lib/util/dlinklist.h"
 #include 
 
+#define DBGC_CLASS DBGC_LDB
+
 /*
   this is used to catch debug messages from ldb
 */
@@ -58,7 +60,7 @@ static void ldb_wrap_debug(void *context, enum 
ldb_debug_level level,
samba_level = 2;
break;
case LDB_DEBUG_TRACE:
-   samba_level = 5;
+   samba_level = 10;
break;
 
};
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 310f95a..455c5e6 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -2083,6 +2083,15 @@ struct loadparm_context *loadparm_init(TALLOC_CTX 
*mem_ctx)
 
lpcfg_do_global_parameter(lp_ctx, "log level", "0");
 
+   lpcfg_do_global_parameter(lp_ctx, "syslog", "1");
+   lpcfg_do_global_parameter(lp_ctx, "syslog only", "No");
+   lpcfg_do_global_parameter(lp_ctx, "debug timestamp", "Yes");
+   lpcfg_do_global_parameter(lp_ctx, "debug prefix timestamp", "No");
+   lpcfg_do_global_parameter(lp_ctx, "debug hires timestamp", "Yes");
+   lpcfg_do_global_parameter(lp_ctx, "debug pid", "No");
+   lpcfg_do_global_parameter(lp_ctx, "debug uid", "No");
+   lpcfg_do_global_parameter(lp_ctx, "debug class", "No");
+
lpcfg_do_global_parameter(lp_ctx, "share backend", "classic");
 
lpcfg_do_global_parameter(lp_ctx, "server role", "auto");
@@ -2302,7 +2311,14 @@ static bool lpcfg_update(struct loadparm_context *lp_ctx)
ZERO_STRUCT(settings);
/* Add any more debug-related smb.conf parameters created in
 * future here */
-   settings.timestamp_logs = true;
+   settings.syslog = lp_ctx->globals->syslog;
+   settings.syslog_only = lp_ctx->globals->bSyslogOnly;
+   settings.timestamp_logs = lp_ctx->globals->bTimestampLogs;
+   settings.debug_prefix_timestamp = 
lp_ctx->globals->bDebugPrefixTimestamp;
+   settings.debug_hires_timestamp = lp_ctx->globals->bDebugHiresTimestamp;
+   settings.debug_pid = lp_ctx->globals->bDebugPid;
+   settings.debug_uid = lp_ctx->globals->bDebugUid;
+   settings.debug_class = lp_ctx->globals->bDebugClass;
debug_set_settings(&settings);
 
/* FIXME: This is a bit of a hack, but we can't use a global, since 
diff --git a/lib/util/debug.c b/lib/util/debug.c
index 34aa76f..a46b275 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -178,6 +178,7 @@ static const char *default_classname_table[] = {
"registry",  /* DBGC_REGISTRY */
"scavenger", /* DBGC_SCAVENGER*/
"dns",   /* DBGC_DNS  */
+   "ldb",   /* DBGC_LDB  */
NULL
 };
 
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 30df787..f7ebfc0 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -81,9 +81,10 @@ bo