autobuild: intermittent test failure detected

2011-03-24 Thread Andrew Tridgell
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-03-24-0845/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-0845/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-0845/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-0845/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-0845/samba4.stdout
  
The top commit at the time of the failure was:

commit 15e84a9a09c5a86416e964a3258ee35718fbf45a
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 10:59:41 2011 +1100

charcnv: removed the allow_badcharcnv and allow_bad_conv options to 
convert_string*()

we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104


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

2011-03-24 Thread Andreas Schneider
The branch, v3-6-test has been updated
   via  73a5c6c s3-epmapper: Log error if we can't register the endpoint.
   via  f104a2e s3-epmapper: Setup epm in smbd to forward np requests. 
(cherry picked from commit b38517bbdc746fe53e0bd804623b2ea7b0e98cbc)
   via  9c1b0d4 s3-epmapper: Remove unregister on shutdown.
   via  dbcd022 s3-epmd: Cleanup endpoints on service pipe disconnect. 
(cherry picked from commit da1a18cd032760c33cf4573124c5b88507b84425)
   via  aeca46f s3-epmapper: Added function to delete endpoint entries. 
(cherry picked from commit 0d97741b9b825350e3e04b5dc49b4e039bd744dc)
   via  4b69a01 s3-rpc_server: Added disconnect callback function. (cherry 
picked from commit e69d92236744bb06d60faa4f21f3cd748ec5629d)
   via  8ddc9d8 s3-rpc_server: Rename req to subreq. (cherry picked from 
commit 044eabe425f9ae6e2fcea5ec1481b33c35b173f7)
   via  6544ce0 s3-rpc_server: Implement an endpoint monitor loop. (cherry 
picked from commit 73faa82bf9ebebdff9662e60715e9fd4f1614b9f)
   via  2344898 s3-rpc_server: Added a memory context to the ep regsiter 
state. (cherry picked from commit b2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea)
   via  e4e86e4 s3-librpc: Leave the epm registration connection open. 
(cherry picked from commit 81a2046879299a051e69fd4d78b3a8e49b690f1b)
   via  18bf416 s3-epmd: Cleanup endpoint mapper correctly. (cherry picked 
from commit d6a1469f4350fa24204e11bb9aee0e33f8d21c34)
   via  b61f076 s3-epmapper: Shutdown the embedded epmapper cleanly. 
(cherry picked from commit de775244a97b011fa34e52987a76ff81a5d36fb0)
   via  b516b1b s3-epmapper: Added a cleanup function. (cherry picked from 
commit 661ac49794a0594003463e1cf3ae1bf806f24213)
   via  ca14a20 s3-epmapper: Use DCERPC_AUTH_LEVEL_CONNECT for ep ncalrpc. 
(cherry picked from commit da718a5961c3404435f9bc64bebabb71b53455eb)
   via  4326555 s3-rpc_server: Rename system_user to ncalrpc_as_system. 
(cherry picked from commit 3766f3ec0e495277c79df8eb8918cb739bc14358)
  from  d513021 s3-prototypes: remove protos of some dead functions.

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


- Log -
commit 73a5c6ce8f98f74c6c8571732eeb7c926bef8188
Author: Andreas Schneider a...@samba.org
Date:   Mon Mar 21 16:14:19 2011 +0100

s3-epmapper: Log error if we can't register the endpoint.

Autobuild-User: Simo Sorce i...@samba.org
Autobuild-Date: Wed Mar 23 18:06:54 CET 2011 on sn-devel-104
(cherry picked from commit 7f1fd07fbe99fc167eb529d482b084142c39ea8a)

commit f104a2ea923755ed3e11b25b68cee7d879d085b8
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 17 17:56:37 2011 +0100

s3-epmapper: Setup epm in smbd to forward np requests.
(cherry picked from commit b38517bbdc746fe53e0bd804623b2ea7b0e98cbc)

commit 9c1b0d4f2dae7a54ed183bb9ba4f6579c0bdf209
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 17 16:59:10 2011 +0100

s3-epmapper: Remove unregister on shutdown.

This is done automatically now.
(cherry picked from commit 73e985fe4b1b4c3e879f4d7fe7bc2f98851aee6e)

commit dbcd0220cf5863478f2bb3a179cc045e0f3a17d5
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 17 11:14:12 2011 +0100

s3-epmd: Cleanup endpoints on service pipe disconnect.
(cherry picked from commit da1a18cd032760c33cf4573124c5b88507b84425)

commit aeca46fcc485ac810ac9daaceb0f2e3884d0821a
Author: Andreas Schneider a...@samba.org
Date:   Wed Mar 16 13:42:26 2011 +0100

s3-epmapper: Added function to delete endpoint entries.
(cherry picked from commit 0d97741b9b825350e3e04b5dc49b4e039bd744dc)

commit 4b69a01b143c097f4b30d6de625f6a34748f0cb3
Author: Andreas Schneider a...@samba.org
Date:   Mon Mar 14 12:29:49 2011 +0100

s3-rpc_server: Added disconnect callback function.
(cherry picked from commit e69d92236744bb06d60faa4f21f3cd748ec5629d)

commit 8ddc9d8512f634333f104898c1eaa991785ffc1d
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 10 13:02:31 2011 +0100

s3-rpc_server: Rename req to subreq.
(cherry picked from commit 044eabe425f9ae6e2fcea5ec1481b33c35b173f7)

commit 6544ce0f0b80eb548771de34c6c10c1484d48924
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 10 10:17:51 2011 +0100

s3-rpc_server: Implement an endpoint monitor loop.
(cherry picked from commit 73faa82bf9ebebdff9662e60715e9fd4f1614b9f)

commit 2344898ab29a973f8073467647f8a67fcb361dba
Author: Andreas Schneider a...@samba.org
Date:   Wed Mar 9 10:38:00 2011 +0100

s3-rpc_server: Added a memory context to the ep regsiter state.
(cherry picked from commit b2bdc20f65f0d5fda5b9fdb9dc6222e2f219bbea)

commit e4e86e4308d20fb0d87ef6590332945c0959f736
Author: Andreas Schneider a...@samba.org
Date:   Wed Mar 9 10:17:06 2011 +0100

s3-librpc: Leave the epm registration connection open.
(cherry picked from commit 81a2046879299a051e69fd4d78b3a8e49b690f1b)

commit 

autobuild: intermittent test failure detected

2011-03-24 Thread Andrew Tridgell
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-03-24-1024/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-1024/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-1024/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-1024/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-1024/samba4.stdout
  
The top commit at the time of the failure was:

commit 15e84a9a09c5a86416e964a3258ee35718fbf45a
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 10:59:41 2011 +1100

charcnv: removed the allow_badcharcnv and allow_bad_conv options to 
convert_string*()

we shouldn't accept bad multi-byte strings, it just hides problems

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Thu Mar 24 01:47:26 CET 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Volker Lendecke
The branch, master has been updated
   via  155c4fb s3: Fix some errno assignments in SMBC_opendir_ctx
   via  9db92bb s3: Fix Coverity ID 2325: RESOURCE_LEAK
  from  15e84a9 charcnv: removed the allow_badcharcnv and allow_bad_conv 
options to convert_string*()

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


- Log -
commit 155c4fbc10ce3f47428402efd30eec732ab7a803
Author: Volker Lendecke v...@samba.org
Date:   Thu Mar 24 16:03:13 2011 +0100

s3: Fix some errno assignments in SMBC_opendir_ctx

Do the assignment as the last action to make sure it's not overwritten

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Thu Mar 24 17:31:57 CET 2011 on sn-devel-104

commit 9db92bb7f9ab9461019ebbf5839c588e2d16f229
Author: Volker Lendecke v...@samba.org
Date:   Thu Mar 24 15:59:55 2011 +0100

s3: Fix Coverity ID 2325: RESOURCE_LEAK

---

Summary of changes:
 source3/libsmb/libsmb_dir.c |   30 +-
 1 files changed, 17 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 9f249a9..d46f72a 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -383,16 +383,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
if (!context || !context-internal-initialized) {
DEBUG(4, (no valid context\n));
-   errno = EINVAL + 8192;
TALLOC_FREE(frame);
+   errno = EINVAL + 8192;
return NULL;
 
}
 
if (!fname) {
DEBUG(4, (no valid fname\n));
-   errno = EINVAL + 8193;
TALLOC_FREE(frame);
+   errno = EINVAL + 8193;
return NULL;
}
 
@@ -407,8 +407,8 @@ SMBC_opendir_ctx(SMBCCTX *context,
 password,
 options)) {
DEBUG(4, (no valid path\n));
-   errno = EINVAL + 8194;
TALLOC_FREE(frame);
+   errno = EINVAL + 8194;
return NULL;
}
 
@@ -419,16 +419,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
 /* Ensure the options are valid */
 if (SMBC_check_options(server, share, path, options)) {
 DEBUG(4, (unacceptable options (%s)\n, options));
-errno = EINVAL + 8195;
TALLOC_FREE(frame);
+errno = EINVAL + 8195;
 return NULL;
 }
 
if (!user || user[0] == (char)0) {
user = talloc_strdup(frame, smbc_getUser(context));
if (!user) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
}
@@ -436,8 +436,8 @@ SMBC_opendir_ctx(SMBCCTX *context,
dir = SMB_MALLOC_P(SMBCFILE);
 
if (!dir) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
 
@@ -461,12 +461,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
if (share[0] != (char)0 || path[0] != (char)0) {
 
-   errno = EINVAL + 8196;
if (dir) {
SAFE_FREE(dir-fname);
SAFE_FREE(dir);
}
TALLOC_FREE(frame);
+   errno = EINVAL + 8196;
return NULL;
}
 
@@ -509,16 +509,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
SAFE_FREE(dir-fname);
SAFE_FREE(dir);
}
-errno = ENOENT;
TALLOC_FREE(frame);
+errno = ENOENT;
 return NULL;
 }
 
ip_list = (struct ip_service *)memdup(
server_addr, sizeof(server_addr));
if (ip_list == NULL) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
 count = 1;
@@ -550,8 +550,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
 cli_shutdown(cli);
 
if (!workgroup || !server) {
-   errno = ENOMEM;
+   if (dir) {
+   SAFE_FREE(dir-fname);
+   SAFE_FREE(dir);
+   }

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

2011-03-24 Thread Volker Lendecke
The branch, v3-6-test has been updated
   via  2896698 s3: Fix some errno assignments in SMBC_opendir_ctx
   via  6b44ca9 s3: Fix Coverity ID 2325: RESOURCE_LEAK (cherry picked from 
commit 9db92bb7f9ab9461019ebbf5839c588e2d16f229)
  from  73a5c6c s3-epmapper: Log error if we can't register the endpoint.

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


- Log -
commit 289669878889d9440ac6b638aacb0fddf4e0e2c4
Author: Volker Lendecke v...@samba.org
Date:   Thu Mar 24 16:03:13 2011 +0100

s3: Fix some errno assignments in SMBC_opendir_ctx

Do the assignment as the last action to make sure it's not overwritten

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Thu Mar 24 17:31:57 CET 2011 on sn-devel-104
(cherry picked from commit 155c4fbc10ce3f47428402efd30eec732ab7a803)

commit 6b44ca993ad69ea219bb84b0e6a475b325605a02
Author: Volker Lendecke v...@samba.org
Date:   Thu Mar 24 15:59:55 2011 +0100

s3: Fix Coverity ID 2325: RESOURCE_LEAK
(cherry picked from commit 9db92bb7f9ab9461019ebbf5839c588e2d16f229)

---

Summary of changes:
 source3/libsmb/libsmb_dir.c |   30 +-
 1 files changed, 17 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c
index 9f249a9..d46f72a 100644
--- a/source3/libsmb/libsmb_dir.c
+++ b/source3/libsmb/libsmb_dir.c
@@ -383,16 +383,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
if (!context || !context-internal-initialized) {
DEBUG(4, (no valid context\n));
-   errno = EINVAL + 8192;
TALLOC_FREE(frame);
+   errno = EINVAL + 8192;
return NULL;
 
}
 
if (!fname) {
DEBUG(4, (no valid fname\n));
-   errno = EINVAL + 8193;
TALLOC_FREE(frame);
+   errno = EINVAL + 8193;
return NULL;
}
 
@@ -407,8 +407,8 @@ SMBC_opendir_ctx(SMBCCTX *context,
 password,
 options)) {
DEBUG(4, (no valid path\n));
-   errno = EINVAL + 8194;
TALLOC_FREE(frame);
+   errno = EINVAL + 8194;
return NULL;
}
 
@@ -419,16 +419,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
 /* Ensure the options are valid */
 if (SMBC_check_options(server, share, path, options)) {
 DEBUG(4, (unacceptable options (%s)\n, options));
-errno = EINVAL + 8195;
TALLOC_FREE(frame);
+errno = EINVAL + 8195;
 return NULL;
 }
 
if (!user || user[0] == (char)0) {
user = talloc_strdup(frame, smbc_getUser(context));
if (!user) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
}
@@ -436,8 +436,8 @@ SMBC_opendir_ctx(SMBCCTX *context,
dir = SMB_MALLOC_P(SMBCFILE);
 
if (!dir) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
 
@@ -461,12 +461,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
 
if (share[0] != (char)0 || path[0] != (char)0) {
 
-   errno = EINVAL + 8196;
if (dir) {
SAFE_FREE(dir-fname);
SAFE_FREE(dir);
}
TALLOC_FREE(frame);
+   errno = EINVAL + 8196;
return NULL;
}
 
@@ -509,16 +509,16 @@ SMBC_opendir_ctx(SMBCCTX *context,
SAFE_FREE(dir-fname);
SAFE_FREE(dir);
}
-errno = ENOENT;
TALLOC_FREE(frame);
+errno = ENOENT;
 return NULL;
 }
 
ip_list = (struct ip_service *)memdup(
server_addr, sizeof(server_addr));
if (ip_list == NULL) {
-   errno = ENOMEM;
TALLOC_FREE(frame);
+   errno = ENOMEM;
return NULL;
}
 count = 1;
@@ -550,8 +550,12 @@ SMBC_opendir_ctx(SMBCCTX *context,
 cli_shutdown(cli);
 
if (!workgroup || !server) {
-   errno = ENOMEM;
+ 

autobuild: intermittent test failure detected

2011-03-24 Thread Andrew Tridgell
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-03-24-1845/flakey.log

The samba3 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-1845/samba3.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-1845/samba3.stdout

The source4 build logs are available here:

   http://git.samba.org/autobuild.flakey/2011-03-24-1845/samba4.stderr
   http://git.samba.org/autobuild.flakey/2011-03-24-1845/samba4.stdout
  
The top commit at the time of the failure was:

commit 155c4fbc10ce3f47428402efd30eec732ab7a803
Author: Volker Lendecke v...@samba.org
Date:   Thu Mar 24 16:03:13 2011 +0100

s3: Fix some errno assignments in SMBC_opendir_ctx

Do the assignment as the last action to make sure it's not overwritten

Autobuild-User: Volker Lendecke vlen...@samba.org
Autobuild-Date: Thu Mar 24 17:31:57 CET 2011 on sn-devel-104


[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Simo Sorce
The branch, master has been updated
   via  72bd60b s3-epmapper: fix vars init and return errors
   via  edc2600 librpc: Return an error if we a broken floor.
   via  95daebe cleanup: fix some trailing spaces
   via  dbe957e s3-epmapper: Fix allocation of data on the wrong context
   via  5ebf007 s3-epmapper: Make sure we work on a description duplicate.
   via  f534dcd librpc: Added a dcerpc_binding_dup() function.
   via  e8912b9 s3-epmapper: Refactor the cleanup of endpoints.
   via  fd89e29 s3-epmapper: Use strcmp instead of strequal and check IPv6.
   via  bf1e330 s3-epmapper: Increase debug levels.
  from  155c4fb s3: Fix some errno assignments in SMBC_opendir_ctx

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


- Log -
commit 72bd60b2fee20dc85c1cc88d5d4e2efdfb74b701
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 11:49:27 2011 -0400

s3-epmapper: fix vars init and return errors

Properly initialize variables at each cycle.
Convert to the right error when returning EPMAPPER ones.

Autobuild-User: Simo Sorce i...@samba.org
Autobuild-Date: Thu Mar 24 20:43:49 CET 2011 on sn-devel-104

commit edc26007bf50ce165b8f8dfba5e1c7f86f6918e6
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:45:32 2011 +0100

librpc: Return an error if we a broken floor.

Pair-Programmed-With: Simo Sorce i...@samba.org

commit 95daebe1c339cefe87bcb5d4e2afc79a45af3b62
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 09:21:11 2011 -0400

cleanup: fix some trailing spaces

commit dbe957e48fec13aec39b7c2675cd4b7cde55d9d0
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 08:23:48 2011 -0400

s3-epmapper: Fix allocation of data on the wrong context

p-mem_ctx is the short-lived per request context, while this data is long
lived, allocate on p instead.

commit 5ebf0072336ece5acf120bcdeb6612445fa059f1
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 14:39:56 2011 +0100

s3-epmapper: Make sure we work on a description duplicate.

commit f534dcdca3184a342df2d702663088a4afba6571
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 14:39:37 2011 +0100

librpc: Added a dcerpc_binding_dup() function.

commit e8912b9ad31154adca4d2065b2986661a956a959
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:07:54 2011 +0100

s3-epmapper: Refactor the cleanup of endpoints.

commit fd89e29e7ee5065b6f4349e391c90c5f81e7c476
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:07:05 2011 +0100

s3-epmapper: Use strcmp instead of strequal and check IPv6.

commit bf1e330f69951400f12ecb17c82adadd1e901a58
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 10:44:14 2011 +0100

s3-epmapper: Increase debug levels.

---

Summary of changes:
 librpc/rpc/binding.c   |  101 +--
 librpc/rpc/rpc_common.h|2 +
 source3/rpc_server/epmapper/srv_epmapper.c |   78 -
 3 files changed, 140 insertions(+), 41 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 2a0295b..422537e 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -646,13 +646,22 @@ _PUBLIC_ const char 
*derpc_transport_string_by_transport(enum dcerpc_transport_t
return NULL;
 }
 
-_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 
-  struct epm_tower *tower, 
-  struct dcerpc_binding **b_out)
+_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
+   struct epm_tower *tower,
+   struct dcerpc_binding **b_out)
 {
NTSTATUS status;
struct dcerpc_binding *binding;
 
+   /*
+* A tower needs to have at least 4 floors to carry useful
+* information. Floor 3 is the transport identifier which defines
+* how many floors are required at least.
+*/
+   if (tower-num_floors  4) {
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
binding = talloc_zero(mem_ctx, struct dcerpc_binding);
NT_STATUS_HAVE_NO_MEMORY(binding);
 
@@ -669,15 +678,11 @@ _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX 
*mem_ctx,
return NT_STATUS_NOT_SUPPORTED;
}
 
-   if (tower-num_floors  1) {
-   return NT_STATUS_OK;
-   }
-
/* Set object uuid */
status = dcerpc_floor_get_lhs_data(tower-floors[0], binding-object);
 
if (!NT_STATUS_IS_OK(status)) {
-   DEBUG(1, (Error pulling object uuid and version: %s, 
nt_errstr(status))); 
+   DEBUG(1, (Error pulling object uuid and version: %s, 
nt_errstr(status)));

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

2011-03-24 Thread Simo Sorce
The branch, v3-6-test has been updated
   via  17fe342 s3-epmapper: fix vars init and return errors
   via  8a8f4df librpc: Return an error if we a broken floor.
   via  e41b818 cleanup: fix some trailing spaces
   via  7ae0d64 s3-epmapper: Fix allocation of data on the wrong context
   via  409e67e s3-epmapper: Make sure we work on a description duplicate.
   via  bdd17bb librpc: Added a dcerpc_binding_dup() function.
   via  5f47e57 s3-epmapper: Refactor the cleanup of endpoints.
   via  824f65c s3-epmapper: Use strcmp instead of strequal and check IPv6.
  from  2896698 s3: Fix some errno assignments in SMBC_opendir_ctx

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


- Log -
commit 17fe34287e582f804cc139a6164563699877d440
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 11:49:27 2011 -0400

s3-epmapper: fix vars init and return errors

Properly initialize variables at each cycle.
Convert to the right error when returning EPMAPPER ones.

Autobuild-User: Simo Sorce i...@samba.org
Autobuild-Date: Thu Mar 24 20:43:49 CET 2011 on sn-devel-104

commit 8a8f4dfe617d4d9625e3788c33f788e140e37f06
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:45:32 2011 +0100

librpc: Return an error if we a broken floor.

Pair-Programmed-With: Simo Sorce i...@samba.org

commit e41b8186557bef3b2205fa998be514d7c9f61f1f
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 09:21:11 2011 -0400

cleanup: fix some trailing spaces

commit 7ae0d6404ed4a02702be139329939b2d7f0c9c5d
Author: Simo Sorce i...@samba.org
Date:   Thu Mar 24 08:23:48 2011 -0400

s3-epmapper: Fix allocation of data on the wrong context

p-mem_ctx is the short-lived per request context, while this data is long
lived, allocate on p instead.

commit 409e67e780ad8b90d7d7a1a11f8c920e9a86381b
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 14:39:56 2011 +0100

s3-epmapper: Make sure we work on a description duplicate.

commit bdd17bb4b2785988f8f546ef60b54d655712a946
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 14:39:37 2011 +0100

librpc: Added a dcerpc_binding_dup() function.

commit 5f47e5763459fa2582a609074b448201854b4fa7
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:07:54 2011 +0100

s3-epmapper: Refactor the cleanup of endpoints.

commit 824f65c5e3dede8a2f29fe3bb92f89c03f3d4070
Author: Andreas Schneider a...@samba.org
Date:   Thu Mar 24 13:07:05 2011 +0100

s3-epmapper: Use strcmp instead of strequal and check IPv6.

---

Summary of changes:
 librpc/rpc/binding.c   |  101 +--
 librpc/rpc/rpc_common.h|2 +
 source3/rpc_server/epmapper/srv_epmapper.c |   62 ++---
 3 files changed, 132 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 2a0295b..422537e 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -646,13 +646,22 @@ _PUBLIC_ const char 
*derpc_transport_string_by_transport(enum dcerpc_transport_t
return NULL;
 }
 
-_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx, 
-  struct epm_tower *tower, 
-  struct dcerpc_binding **b_out)
+_PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX *mem_ctx,
+   struct epm_tower *tower,
+   struct dcerpc_binding **b_out)
 {
NTSTATUS status;
struct dcerpc_binding *binding;
 
+   /*
+* A tower needs to have at least 4 floors to carry useful
+* information. Floor 3 is the transport identifier which defines
+* how many floors are required at least.
+*/
+   if (tower-num_floors  4) {
+   return NT_STATUS_INVALID_PARAMETER;
+   }
+
binding = talloc_zero(mem_ctx, struct dcerpc_binding);
NT_STATUS_HAVE_NO_MEMORY(binding);
 
@@ -669,15 +678,11 @@ _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX 
*mem_ctx,
return NT_STATUS_NOT_SUPPORTED;
}
 
-   if (tower-num_floors  1) {
-   return NT_STATUS_OK;
-   }
-
/* Set object uuid */
status = dcerpc_floor_get_lhs_data(tower-floors[0], binding-object);
 
if (!NT_STATUS_IS_OK(status)) {
-   DEBUG(1, (Error pulling object uuid and version: %s, 
nt_errstr(status))); 
+   DEBUG(1, (Error pulling object uuid and version: %s, 
nt_errstr(status)));
return status;
}
 
@@ -702,6 +707,86 @@ _PUBLIC_ NTSTATUS dcerpc_binding_from_tower(TALLOC_CTX 
*mem_ctx,
return NT_STATUS_OK;
 }
 
+_PUBLIC_ struct dcerpc_binding *dcerpc_binding_dup(TALLOC_CTX 

[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Jeremy Allison
The branch, master has been updated
   via  042aafb Fix bug 8021 - Incorrect string termination in 
volume/volume_name for TRANS2-QUERY_FS_INFO/Info Volume.
   via  5176a0b Fix is_myname_or_ipaddr() to be robust against strange DNS 
setups.
  from  72bd60b s3-epmapper: fix vars init and return errors

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


- Log -
commit 042aafb87df6c05877b8fc7ef0d44877689d860a
Author: Volodymyr Khomenko volodymyr_khome...@dell.com
Date:   Thu Mar 24 14:20:28 2011 -0700

Fix bug 8021 - Incorrect string termination in volume/volume_name for 
TRANS2-QUERY_FS_INFO/Info Volume.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Thu Mar 24 23:07:09 CET 2011 on sn-devel-104

commit 5176a0b2af1bb16e530412faaa2f36108f312a03
Author: Jeremy Allison j...@samba.org
Date:   Thu Mar 24 12:11:02 2011 -0700

Fix is_myname_or_ipaddr() to be robust against strange DNS setups.

If IPv6 DNS names are turned on, but Samba isn't configured to
listen on an IPv6 interface, then is_myname_or_ipaddr() can return
false on a valid DNS name that it should detect is our own. If the
IPv6 addr is returned by preference, then looking at the first addr
only causes is_myname_or_ipaddr() to fail. We need to look at all the
addresses returned by the DNS lookup and check all of them against
our interface list. This is an order N^2 lookup, but there shouldn't
be enough addresses to make this a practical problem.

Jeremy.

---

Summary of changes:
 source3/lib/util_sock.c |   86 ++
 source3/smbd/trans2.c   |2 +-
 2 files changed, 57 insertions(+), 31 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index eea153a..0c7db2e 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1578,13 +1578,46 @@ const char *get_mydnsfullname(void)
 }
 
 /
+ Is this my ip address ?
+/
+
+static bool is_my_ipaddr(const char *ipaddr_str)
+{
+   struct sockaddr_storage ss;
+   struct iface_struct *nics;
+   int i, n;
+
+   if (!interpret_string_addr(ss, ipaddr_str, AI_NUMERICHOST)) {
+   return false;
+   }
+
+   if (ismyaddr((struct sockaddr *)ss)) {
+   return true;
+   }
+
+   if (is_zero_addr(ss) ||
+   is_loopback_addr((struct sockaddr *)ss)) {
+   return false;
+   }
+
+   n = get_interfaces(talloc_tos(), nics);
+   for (i=0; in; i++) {
+   if (sockaddr_equal((struct sockaddr *)nics[i].ip, (struct 
sockaddr *)ss)) {
+   TALLOC_FREE(nics);
+   return true;
+   }
+   }
+   TALLOC_FREE(nics);
+   return false;
+}
+
+/
  Is this my name ?
 /
 
 bool is_myname_or_ipaddr(const char *s)
 {
TALLOC_CTX *ctx = talloc_tos();
-   char addr[INET6_ADDRSTRLEN];
char *name = NULL;
const char *dnsname;
char *servername = NULL;
@@ -1632,45 +1665,38 @@ bool is_myname_or_ipaddr(const char *s)
return true;
}
 
-   /* Handle possible CNAME records - convert to an IP addr. */
-   if (!is_ipaddress(servername)) {
-   /* Use DNS to resolve the name, but only the first address */
-   struct sockaddr_storage ss;
-   if (interpret_string_addr(ss, servername, 0)) {
-   print_sockaddr(addr,
-   sizeof(addr),
-   ss);
-   servername = addr;
-   }
-   }
-
/* Maybe its an IP address? */
if (is_ipaddress(servername)) {
-   struct sockaddr_storage ss;
-   struct iface_struct *nics;
-   int i, n;
-
-   if (!interpret_string_addr(ss, servername, AI_NUMERICHOST)) {
-   return false;
-   }
+   return is_my_ipaddr(servername);
+   }
 
-   if (ismyaddr((struct sockaddr *)ss)) {
-   return true;
-   }
+   /* Handle possible CNAME records - convert to an IP addr. list. */
+   {
+   /* Use DNS to resolve the name, check all addresses. */
+   struct addrinfo *p = NULL;
+   struct addrinfo *res = NULL;
 
-   if (is_zero_addr(ss) ||
-   is_loopback_addr((struct sockaddr *)ss)) {
+   if (!interpret_string_addr_internal(res,
+   

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

2011-03-24 Thread Jeremy Allison
The branch, v3-6-test has been updated
   via  889cfcf Fix bug 8021 - Incorrect string termination in 
volume/volume_name for TRANS2-QUERY_FS_INFO/Info Volume.
   via  9648497 Fix is_myname_or_ipaddr() to be robust against strange DNS 
setups.
  from  17fe342 s3-epmapper: fix vars init and return errors

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


- Log -
commit 889cfcf35203b5ab82a8970ca9625701656e64f8
Author: Volodymyr Khomenko volodymyr_khome...@dell.com
Date:   Thu Mar 24 14:20:28 2011 -0700

Fix bug 8021 - Incorrect string termination in volume/volume_name for 
TRANS2-QUERY_FS_INFO/Info Volume.

Autobuild-User: Jeremy Allison j...@samba.org
Autobuild-Date: Thu Mar 24 23:07:09 CET 2011 on sn-devel-104
(cherry picked from commit 042aafb87df6c05877b8fc7ef0d44877689d860a)

commit 9648497c91c13553d04e4be1e9133eea6df31220
Author: Jeremy Allison j...@samba.org
Date:   Thu Mar 24 12:11:02 2011 -0700

Fix is_myname_or_ipaddr() to be robust against strange DNS setups.

If IPv6 DNS names are turned on, but Samba isn't configured to
listen on an IPv6 interface, then is_myname_or_ipaddr() can return
false on a valid DNS name that it should detect is our own. If the
IPv6 addr is returned by preference, then looking at the first addr
only causes is_myname_or_ipaddr() to fail. We need to look at all the
addresses returned by the DNS lookup and check all of them against
our interface list. This is an order N^2 lookup, but there shouldn't
be enough addresses to make this a practical problem.

Jeremy.
(cherry picked from commit 5176a0b2af1bb16e530412faaa2f36108f312a03)

---

Summary of changes:
 source3/lib/util_sock.c |   86 ++
 source3/smbd/trans2.c   |2 +-
 2 files changed, 57 insertions(+), 31 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 3c97495..a2b7a49 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1582,13 +1582,46 @@ const char *get_mydnsfullname(void)
 }
 
 /
+ Is this my ip address ?
+/
+
+static bool is_my_ipaddr(const char *ipaddr_str)
+{
+   struct sockaddr_storage ss;
+   struct iface_struct *nics;
+   int i, n;
+
+   if (!interpret_string_addr(ss, ipaddr_str, AI_NUMERICHOST)) {
+   return false;
+   }
+
+   if (ismyaddr((struct sockaddr *)ss)) {
+   return true;
+   }
+
+   if (is_zero_addr(ss) ||
+   is_loopback_addr((struct sockaddr *)ss)) {
+   return false;
+   }
+
+   n = get_interfaces(talloc_tos(), nics);
+   for (i=0; in; i++) {
+   if (sockaddr_equal((struct sockaddr *)nics[i].ip, (struct 
sockaddr *)ss)) {
+   TALLOC_FREE(nics);
+   return true;
+   }
+   }
+   TALLOC_FREE(nics);
+   return false;
+}
+
+/
  Is this my name ?
 /
 
 bool is_myname_or_ipaddr(const char *s)
 {
TALLOC_CTX *ctx = talloc_tos();
-   char addr[INET6_ADDRSTRLEN];
char *name = NULL;
const char *dnsname;
char *servername = NULL;
@@ -1636,45 +1669,38 @@ bool is_myname_or_ipaddr(const char *s)
return true;
}
 
-   /* Handle possible CNAME records - convert to an IP addr. */
-   if (!is_ipaddress(servername)) {
-   /* Use DNS to resolve the name, but only the first address */
-   struct sockaddr_storage ss;
-   if (interpret_string_addr(ss, servername, 0)) {
-   print_sockaddr(addr,
-   sizeof(addr),
-   ss);
-   servername = addr;
-   }
-   }
-
/* Maybe its an IP address? */
if (is_ipaddress(servername)) {
-   struct sockaddr_storage ss;
-   struct iface_struct *nics;
-   int i, n;
-
-   if (!interpret_string_addr(ss, servername, AI_NUMERICHOST)) {
-   return false;
-   }
+   return is_my_ipaddr(servername);
+   }
 
-   if (ismyaddr((struct sockaddr *)ss)) {
-   return true;
-   }
+   /* Handle possible CNAME records - convert to an IP addr. list. */
+   {
+   /* Use DNS to resolve the name, check all addresses. */
+   struct addrinfo *p = NULL;
+   struct addrinfo *res = NULL;
 
-   if (is_zero_addr(ss) ||
-   

[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Günther Deschner
The branch, master has been updated
   via  68529bc s3-charcnv: remove unused labels.
   via  4a4efc2 s3-rpc_server: remove two uneeded include 
registry/reg_parse_prs.h
   via  ba510fa s3-ldapsam: fix ldapsam_create_user() with existing posix 
accounts.
   via  63bb64d s3-netapi: use cli_get_session_key() in netapi.
  from  042aafb Fix bug 8021 - Incorrect string termination in 
volume/volume_name for TRANS2-QUERY_FS_INFO/Info Volume.

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


- Log -
commit 68529bc14efd077531086b3e8bcaf85287cfa6ba
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 23:02:36 2011 +0100

s3-charcnv: remove unused labels.

Guenther

Autobuild-User: Günther Deschner g...@samba.org
Autobuild-Date: Thu Mar 24 23:54:25 CET 2011 on sn-devel-104

commit 4a4efc20b43df25ea69239383069e1ce98ed5901
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 22:29:18 2011 +0100

s3-rpc_server: remove two uneeded include registry/reg_parse_prs.h

Guenther

commit ba510fae2369620875fac80eaba2c222f3ee234b
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 18:07:23 2011 +0100

s3-ldapsam: fix ldapsam_create_user() with existing posix accounts.

We were not taking into account the existing posix attributes and thus 
failed
while trying to add a 2nd uid attribute.

Found by Sumit.

Guenther

commit 63bb64d531bccc963e3131658f6c37887f820e87
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 22:14:20 2011 +0100

s3-netapi: use cli_get_session_key() in netapi.

Guenther

---

Summary of changes:
 source3/lib/charcnv.c |6 
 source3/lib/netapi/joindomain.c   |   40 ++---
 source3/lib/netapi/user.c |   19 -
 source3/passdb/pdb_ldap.c |2 +-
 source3/rpc_server/rpc_server.c   |1 -
 source3/rpc_server/winreg/srv_winreg_nt.c |1 -
 6 files changed, 54 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c
index 6addc90..12c708e 100644
--- a/source3/lib/charcnv.c
+++ b/source3/lib/charcnv.c
@@ -127,8 +127,6 @@ static size_t convert_string_internal(charset_t from, 
charset_t to,
i_len=srclen;
o_len=destlen;
 
- again:
-
retval = smb_iconv(descriptor, inbuf, i_len, outbuf, o_len);
if(retval==(size_t)-1) {
const char *reason=unknown error;
@@ -416,8 +414,6 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, 
charset_t to,
i_len = srclen;
o_len = destlen;
 
- again:
-
retval = smb_iconv(descriptor,
   inbuf, i_len,
   outbuf, o_len);
@@ -444,8 +440,6 @@ bool convert_string_talloc(TALLOC_CTX *ctx, charset_t from, 
charset_t to,
return false;
}
 
-  out:
-
destlen = destlen - o_len;
/* Don't shrink unless we're reclaiming a lot of
 * space. This is in the hot codepath and these
diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 6bae363..edc45ef 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -113,6 +113,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
WERROR werr;
unsigned int old_timeout = 0;
struct dcerpc_binding_handle *b;
+   DATA_BLOB session_key;
 
werr = libnetapi_open_pipe(ctx, r-in.server,
   ndr_table_wkssvc.syntax_id,
@@ -124,9 +125,16 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
b = pipe_cli-binding_handle;
 
if (r-in.password) {
+
+   status = cli_get_session_key(ctx, pipe_cli, session_key);
+   if (!NT_STATUS_IS_OK(status)) {
+   werr = ntstatus_to_werror(status);
+   goto done;
+   }
+
encode_wkssvc_join_password_buffer(ctx,
   r-in.password,
-  
pipe_cli-auth-user_session_key,
+  session_key,
   encrypted_password);
}
 
@@ -246,6 +254,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx,
WERROR werr;
unsigned int old_timeout = 0;
struct dcerpc_binding_handle *b;
+   DATA_BLOB session_key;
 
werr = libnetapi_open_pipe(ctx, r-in.server_name,
   ndr_table_wkssvc.syntax_id,
@@ -257,9 +266,16 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx,
b = pipe_cli-binding_handle;
 
if (r-in.password) {
+
+   status = 

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

2011-03-24 Thread Günther Deschner
The branch, v3-6-test has been updated
   via  abb58c0 s3-rpc_server: remove two uneeded include 
registry/reg_parse_prs.h
   via  f6b4ab7 s3-ldapsam: fix ldapsam_create_user() with existing posix 
accounts.
   via  d6a504f s3-netapi: use cli_get_session_key() in netapi.
  from  889cfcf Fix bug 8021 - Incorrect string termination in 
volume/volume_name for TRANS2-QUERY_FS_INFO/Info Volume.

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


- Log -
commit abb58c0a969a6e21c0796e2a70ac73357fd0a0d1
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 22:29:18 2011 +0100

s3-rpc_server: remove two uneeded include registry/reg_parse_prs.h

Guenther
(cherry picked from commit 4a4efc20b43df25ea69239383069e1ce98ed5901)

commit f6b4ab70fa7096613aa16d4208658a3a05975f7b
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 18:07:23 2011 +0100

s3-ldapsam: fix ldapsam_create_user() with existing posix accounts.

We were not taking into account the existing posix attributes and thus 
failed
while trying to add a 2nd uid attribute.

Found by Sumit.

Guenther
(cherry picked from commit ba510fae2369620875fac80eaba2c222f3ee234b)

commit d6a504fa8e6fb762e3004d955deb9ea86cf6e0e7
Author: Günther Deschner g...@samba.org
Date:   Thu Mar 24 22:14:20 2011 +0100

s3-netapi: use cli_get_session_key() in netapi.

Guenther
(cherry picked from commit 63bb64d531bccc963e3131658f6c37887f820e87)

---

Summary of changes:
 source3/lib/netapi/joindomain.c   |   40 ++---
 source3/lib/netapi/user.c |   19 -
 source3/passdb/pdb_ldap.c |2 +-
 source3/rpc_server/rpc_server.c   |1 -
 source3/rpc_server/winreg/srv_winreg_nt.c |1 -
 5 files changed, 54 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/netapi/joindomain.c b/source3/lib/netapi/joindomain.c
index 6bae363..edc45ef 100644
--- a/source3/lib/netapi/joindomain.c
+++ b/source3/lib/netapi/joindomain.c
@@ -113,6 +113,7 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
WERROR werr;
unsigned int old_timeout = 0;
struct dcerpc_binding_handle *b;
+   DATA_BLOB session_key;
 
werr = libnetapi_open_pipe(ctx, r-in.server,
   ndr_table_wkssvc.syntax_id,
@@ -124,9 +125,16 @@ WERROR NetJoinDomain_r(struct libnetapi_ctx *ctx,
b = pipe_cli-binding_handle;
 
if (r-in.password) {
+
+   status = cli_get_session_key(ctx, pipe_cli, session_key);
+   if (!NT_STATUS_IS_OK(status)) {
+   werr = ntstatus_to_werror(status);
+   goto done;
+   }
+
encode_wkssvc_join_password_buffer(ctx,
   r-in.password,
-  
pipe_cli-auth-user_session_key,
+  session_key,
   encrypted_password);
}
 
@@ -246,6 +254,7 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx,
WERROR werr;
unsigned int old_timeout = 0;
struct dcerpc_binding_handle *b;
+   DATA_BLOB session_key;
 
werr = libnetapi_open_pipe(ctx, r-in.server_name,
   ndr_table_wkssvc.syntax_id,
@@ -257,9 +266,16 @@ WERROR NetUnjoinDomain_r(struct libnetapi_ctx *ctx,
b = pipe_cli-binding_handle;
 
if (r-in.password) {
+
+   status = cli_get_session_key(ctx, pipe_cli, session_key);
+   if (!NT_STATUS_IS_OK(status)) {
+   werr = ntstatus_to_werror(status);
+   goto done;
+   }
+
encode_wkssvc_join_password_buffer(ctx,
   r-in.password,
-  
pipe_cli-auth-user_session_key,
+  session_key,
   encrypted_password);
}
 
@@ -436,6 +452,7 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx,
NTSTATUS status;
WERROR werr;
struct dcerpc_binding_handle *b;
+   DATA_BLOB session_key;
 
werr = libnetapi_open_pipe(ctx, r-in.server_name,
   ndr_table_wkssvc.syntax_id,
@@ -447,9 +464,16 @@ WERROR NetGetJoinableOUs_r(struct libnetapi_ctx *ctx,
b = pipe_cli-binding_handle;
 
if (r-in.password) {
+
+   status = cli_get_session_key(ctx, pipe_cli, session_key);
+   if (!NT_STATUS_IS_OK(status)) {
+   werr = ntstatus_to_werror(status);
+ 

[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Michael Adam
The branch, master has been updated
   via  8812148 s3:dbwrap_ctdb: fix non-locked fetch on persistent db's 
causing corruption
  from  68529bc s3-charcnv: remove unused labels.

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


- Log -
commit 8812148e2436b5ad9120181797e432285ccbb983
Author: Michael Adam ob...@samba.org
Date:   Fri Mar 25 00:29:42 2011 +0100

s3:dbwrap_ctdb: fix non-locked fetch on persistent db's causing corruption

When doing a non-locking fetch on a record of a persistent db when no
transaction is running, the old behaviour was to fetch locally and
do a ctdb call when the record was not found in the local db.
The call is useless for persistent dbs anyway since they are only
written to using transactions and hence kept in sync, but it is
also harmful, because a ctdb call will bump the record RSN when it
does actually migrate the record from one node to another.

Recently, ctdb has been changed to make all calls do a migration.
This uncovered the client misbehaviour for persistent dbs, because
now _each_ non-locking fetch will render the persistent db inconsistent:
A subsequent transaction which touches the record in question will
fail because the RSNs are out of sync.

This patch fixes this old bug.

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Fri Mar 25 01:26:32 CET 2011 on sn-devel-104

---

Summary of changes:
 source3/lib/dbwrap_ctdb.c |   36 ++--
 1 files changed, 34 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 67425dc..46ec6de 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -474,6 +474,34 @@ static int db_ctdb_transaction_fetch(struct db_ctdb_ctx 
*db,
return 0;
 }
 
+/**
+ * Fetch a record from a persistent database
+ * without record locking and without an active transaction.
+ *
+ * This just fetches from the local database copy.
+ * Since the databases are kept in syc cluster-wide,
+ * there is no point in doing a ctdb call to fetch the
+ * record from the lmaster. It does even harm since migration
+ * of records bump their RSN and hence render the persistent
+ * database inconsistent.
+ */
+static int db_ctdb_fetch_persistent(struct db_ctdb_ctx *db,
+   TALLOC_CTX *mem_ctx,
+   TDB_DATA key, TDB_DATA *data)
+{
+   NTSTATUS status;
+   bool found;
+
+   status = db_ctdb_ltdb_fetch(db, key, NULL, mem_ctx, data);
+
+   if (NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
+   *data = tdb_null;
+   } else if (!NT_STATUS_IS_OK(status)) {
+   return -1;
+   }
+
+   return 0;
+}
 
 static NTSTATUS db_ctdb_store_transaction(struct db_record *rec, TDB_DATA 
data, int flag);
 static NTSTATUS db_ctdb_delete_transaction(struct db_record *rec);
@@ -1075,6 +1103,10 @@ static int db_ctdb_fetch(struct db_context *db, 
TALLOC_CTX *mem_ctx,
return db_ctdb_transaction_fetch(ctx, mem_ctx, key, data);
}
 
+   if (db-persistent) {
+   return db_ctdb_fetch_persistent(ctx, mem_ctx, key, data);
+   }
+
/* try a direct fetch */
ctdb_data = tdb_fetch(ctx-wtdb-tdb, key);
 
@@ -1085,8 +1117,8 @@ static int db_ctdb_fetch(struct db_context *db, 
TALLOC_CTX *mem_ctx,
 */
if ((ctdb_data.dptr != NULL) 
(ctdb_data.dsize = sizeof(struct ctdb_ltdb_header)) 
-   (db-persistent ||
-((struct ctdb_ltdb_header *)ctdb_data.dptr)-dmaster == 
get_my_vnn())) {
+   ((struct ctdb_ltdb_header *)ctdb_data.dptr)-dmaster == 
get_my_vnn())
+   {
/* we are the dmaster - avoid the ctdb protocol op */
 
data-dsize = ctdb_data.dsize - sizeof(struct ctdb_ltdb_header);


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2011-03-24 Thread Andrew Tridgell
The branch, master has been updated
   via  f092214 charcnv: ensure convert_string_error doesn't conflict with 
s3 function
   via  0189087 s3-charcnv: fixed converted_size return in fast paths
   via  f08ec22 s3-charcnv: removed unused function
   via  b5616ad lib/util/charset rename iconv_convenience to iconv_handle
   via  7824111 s3-charcnv: convert_string_internal() should not display 
errors
   via  d85dbfb s3-string: removed the conv_silent global
   via  232fb01 s3-string: removed last use of conv_silent
   via  64258a3 s3-charcnv Add convert_string_error()
   via  2643a7b charcnv: added convert_string_error()
   via  3726192 s3-includes: fixed CONST_DISCARD() to actually discard const
   via  aaae412 unistr: moved some UCS2 macros into util_unistr
   via  5a20325 libcli: created smb_constants.h
   via  bfce962 tdb: rename convert_string() to tdb_convert_string()
   via  2588e71 s3-libsmb: work our correct length for EA strings
   via  5ed2039 s3-string: sec_len==-1 support is no longer needed
   via  4d47493 s3-dfs: removed the last user of sec_len==-1 in 
pull_*_base_talloc()
   via  3ceb353 s3-lib: make pull_ucs2_base_talloc static
   via  980064b lib: remove unused pieces of string_wrappers.h
   via  8cd4a38 lib: move the string wrappers from source3/include to 
common lib/util
   via  f705fc9 s3-string: moved fstring functions into their own file
  from  8812148 s3:dbwrap_ctdb: fix non-locked fetch on persistent db's 
causing corruption

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


- Log -
commit f0922147fec83fc4900208669e6cb0e0607757cd
Author: Andrew Tridgell tri...@samba.org
Date:   Fri Mar 25 14:34:43 2011 +1100

charcnv: ensure convert_string_error doesn't conflict with s3 function

use _handle for handle based functions

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

Autobuild-User: Andrew Tridgell tri...@samba.org
Autobuild-Date: Fri Mar 25 05:22:24 CET 2011 on sn-devel-104

commit 0189087e257f37dc52beebc49967ac763f58dec4
Author: Andrew Tridgell tri...@samba.org
Date:   Fri Mar 25 12:10:41 2011 +1100

s3-charcnv: fixed converted_size return in fast paths

commit f08ec2296edf4cc8f6f5b7a6f3f69975a8724933
Author: Andrew Tridgell tri...@samba.org
Date:   Fri Mar 25 11:41:52 2011 +1100

s3-charcnv: removed unused function

lp_failed_convert_char() is not needed any more

commit b5616adc8adbcee61bb670378f9c066225d9dcf3
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 25 08:37:00 2011 +1100

lib/util/charset rename iconv_convenience to iconv_handle

This better reflects what this structure is

Andrew Bartlett

commit 7824111d07ae12b34e03da1e72884d421a9f9f33
Author: Andrew Tridgell tri...@samba.org
Date:   Fri Mar 25 10:52:32 2011 +1100

s3-charcnv: convert_string_internal() should not display errors

debug error display happens in the convert_string() outer function

commit d85dbfb3dbb7a17c38f1f981362cc68400fa4410
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 15:43:02 2011 +1100

s3-string: removed the conv_silent global

use convert_string_error() instead

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit 232fb016a15c0536aabc3bc23607721398693037
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 15:44:03 2011 +1100

s3-string: removed last use of conv_silent

This replaces the push_ascii_nstring() implementation with a call to
convert_string_error()

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit 64258a300f3a8e1c1e0d8e7edcf71ace5a573d0e
Author: Andrew Bartlett abart...@samba.org
Date:   Fri Mar 25 09:15:06 2011 +1100

s3-charcnv Add convert_string_error()

This function returns errors rather than printing them.

Andrew Bartlett

commit 2643a7ba6b87d0378323237e143ce128dfc09837
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 15:59:26 2011 +1100

charcnv: added convert_string_error()

this will allow us to remove conv_silent

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit 37261928bec145f4cbd85f3e409063563c00ac9e
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 15:40:45 2011 +1100

s3-includes: fixed CONST_DISCARD() to actually discard const

a cast is not enough

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit aaae4123b9bcdf0a3d5d006fcb7daf10a1d95fbc
Author: Andrew Tridgell tri...@samba.org
Date:   Thu Mar 24 15:39:27 2011 +1100

unistr: moved some UCS2 macros into util_unistr

we need to move towards eliminating smb_ucs2_t. This moves a couple of
the related macros into the only file they are used in

Pair-Programmed-With: Andrew Bartlett abart...@samba.org

commit