[SCM] CTDB repository - branch master updated - ctdb-2.1-48-g35264e4

2013-04-09 Thread Amitay Isaacs
The branch, master has been updated
   via  35264e42ade4676468cf7713fa339c784e932953 (commit)
  from  1c7adbccc69ac276d2b957ad16c3802fdb8868ca (commit)

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


- Log -
commit 35264e42ade4676468cf7713fa339c784e932953
Author: Amitay Isaacs 
Date:   Wed Mar 27 12:32:43 2013 +1100

tools/ltdbtool: Fix handling of -e option

Also, include description of -e option in usage.

Signed-off-by: Amitay Isaacs 

---

Summary of changes:
 tools/ltdbtool.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/tools/ltdbtool.c b/tools/ltdbtool.c
index b7ad5a5..add9c32 100644
--- a/tools/ltdbtool.c
+++ b/tools/ltdbtool.c
@@ -77,7 +77,9 @@ static int help(const char* cmd)
 "   -O the number of bytes to interpret as ctdb record header\n"
 "   for the output database (beware!)\n"
 "\n"
-"   -p  print header (for the dump command), defaults ot off\n"
+"   -e  Include empty records, defaults to off\n"
+"\n"
+"   -p  print header (for the dump command), defaults to off\n"
 "\n"
 "   -h  print this help\n"
 "\n"
@@ -91,8 +93,8 @@ static int help(const char* cmd)
 static int usage(const char* cmd)
 {
fprintf(stderr,
-   "Usage: %s dump [-p] [-s{0|32|64}] \n"
-   "   %s convert [-s{0|32|64}] [-o{0|32|64}]  \n"
+   "Usage: %s dump [-e] [-p] [-s{0|32|64}] \n"
+   "   %s convert [-e] [-s{0|32|64}] [-o{0|32|64}]  
\n"
"   %s {help|-h}\n"
, cmd, cmd, cmd);
return -1;
@@ -229,6 +231,7 @@ int main(int argc, char* argv[])
break;
case 'e':
keep_empty = true;
+   break;
case 'h':
return help(argv[0]);
default:


-- 
CTDB repository


[SCM] Samba Shared Repository - branch v4-0-test updated

2013-04-09 Thread Karolin Seeger
The branch, v4-0-test has been updated
   via  5d5f301 VERSION: Bump version number up to 4.0.6
   via  ed09ee7 VERSION: Disable git snapshots for the 4.0.5 release.
   via  9c6bd38 WHATSNEW: Add major enhancements.
  from  ff9d832 WHATSNEW: Add changes since 4.0.4.

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


- Log -
commit 5d5f30189c6d447994d8f15b3abddd469692643f
Author: Karolin Seeger 
Date:   Tue Apr 9 10:12:56 2013 +0200

VERSION: Bump version number up to 4.0.6

and re-enable git snapshots.

Signed-off-by: Karolin Seeger 

commit ed09ee74fcd4929c3ca11ce821b70e1d3ee0d5d8
Author: Karolin Seeger 
Date:   Tue Apr 9 10:11:23 2013 +0200

VERSION: Disable git snapshots for the 4.0.5 release.

Signed-off-by: Karolin Seeger 

commit 9c6bd3808d74991e4e11b2a006a3f4a3e4575905
Author: Karolin Seeger 
Date:   Tue Apr 9 10:08:57 2013 +0200

WHATSNEW: Add major enhancements.

And update some of the changes since 4.0.4.

Karolin

---

Summary of changes:
 VERSION  |2 +-
 WHATSNEW.txt |6 --
 2 files changed, 5 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index a999766..f7a1c23 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=0
-SAMBA_VERSION_RELEASE=5
+SAMBA_VERSION_RELEASE=6
 
 
 # If a official release has a serious bug  #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 9f55336..2f8d863 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -8,7 +8,8 @@ This is is the latest stable release of Samba 4.0.
 
 Major enhancements in Samba 4.0.5 include:
 
-o  
+o  Fix large reads/writes from some Linux clients (bug #9706).
+o  Add 'samba-tool dbcheck --reset-well-known-acls' (bugs #9740 and #9267).
 
 
 Changes since 4.0.4:
@@ -27,7 +28,7 @@ o   Jeremy Allison 
 * BUG 9519: Samba returns unexpected error on SMB posix open.
 * BUG 9642: Fix the build of vfs_afsacl.
 * BUG 9695: Backport tevent changes to bring library to version 0.9.18.
-* BUG 9706: Parameter is incorrect on Android.
+* BUG 9706: Fix large reads/writes from some Linux clients.
 * BUG 9724: is_encrypted_packet() function incorrectly used inside server.
 * BUG 9733: Fix 'smbcontrol close-share'.
 * BUG 9748: Remove unneeded fstat system call from hot read path.
@@ -62,6 +63,7 @@ o   Andrew Bartlett 
 * BUG 9728: DO NOT install samba_upgradeprovision in 4.0.x.
 * BUG 9739: PIDL: Build fixes for hosts without CPP (Solaris 11).
 * BUG 9740: Add 'samba-tool dbcheck --reset-well-known-acls'.
+* BUG 9267: Can't delegate adding computers to domain.
 
 
 o   Alexander Bokovoy 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - annotated tag samba-4.0.5 created

2013-04-09 Thread Karolin Seeger
The annotated tag, samba-4.0.5 has been created
at  b804b5f101f901b789d7fac693d5cf2285a49e9e (tag)
   tagging  ed09ee74fcd4929c3ca11ce821b70e1d3ee0d5d8 (commit)
  replaces  samba-4.0.4
 tagged by  Karolin Seeger
on  Tue Apr 9 10:17:31 2013 +0200

- Log -
samba: tag release samba-4.0.5
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iD8DBQBRY86bbzORW2Vot+oRAoEsAJ9UJfZby9bRGGY95wJCanUBGqVlBwCePmS4
VxT5osVH9kmxRfJb6jLt1wU=
=aKMd
-END PGP SIGNATURE-

Alexander Bokovoy (3):
  PIDL: fix parsing linemarkers in preprocessor output
  source3/wscript: support 'pdb_ldap' module in configure
  autoconf: rename pdb_ldap module to pdb_ldapsam

Andreas Schneider (32):
  Rename pdb_ldap to pdb_ldapsam
  waf: Fix correct linking of libreplace with cmdline-credentials.
  s3-lsasd: Don't leak file descriptors. Reviewed-by: Alexander Bokovoy 

  s3-param: Don't leak file descriptor. Reviewed-by: Alexander Bokovoy 

  s3-vfs: Don't leak file descriptor. Reviewed-by: Alexander Bokovoy 

  s3-smbd: Don't leak subcntarr array. Reviewed-by: Alexander Bokovoy 

  winbind: Don't leak memory on return. Reviewed-by: Alexander Bokovoy 

  winbind: Don't leak centry memory. Reviewed-by: Alexander Bokovoy 

  s3-libsmb: Don't leak memory on error. Reviewed-by: Alexander Bokovoy 

  s3-vfs: Don't leak file descriptor on error. Reviewed-by: Alexander 
Bokovoy 
  lib-util: Don't leak file descriptor on error. Reviewed-by: Alexander 
Bokovoy 
  s3-rpc_server: Make sure that fd is really closed on error. Reviewed-by: 
Alexander Bokovoy 
  s3-spoolss: Don't leak memory. Reviewed-by: Alexander Bokovoy 

  pdb: Fix array overrun by one. Reviewed-by: Alexander Bokovoy 

  libsmb: Fix possible null pointer dereference. Reviewed-by: Alexander 
Bokovoy 
  nmbd: Fix request data data processing.
  s3-tldap: Make sure we don't deref a null pointer. Reviewed-by: Alexander 
Bokovoy 
  librpc: Add NULL check for ndr functions for epm bindings.
  s4-libcli: Check return code of smbcli_request_setup(). Reviewed-by: 
Alexander Bokovoy 
  pyauth: Check return value of lpcfg_from_py_object(). Reviewed-by: 
Alexander Bokovoy 
  s4-libcli: Check return value of smbcli_request_setup(). Reviewed-by: 
Alexander Bokovoy 
  s4-socket: Make sure unix socket addresses are null terminated.
  pidl: Add skip option to elements.
  ndr: Add ndr_ntprinting_string_flags() function.
  idl: Add flags for strings in ntprinting idl.
  ndr: Pass down string_flags in ndr_pull_ntprinting_printer().
  s3-net: Add encoding= to 'net printing migrate'.
  s3-net: Add encoding= to 'net printing dump'.
  torture: Add ntprinting latin1 test.
  BUG 9735: Fix winbind seperator in upn to username conversion.
  epm: Increase debug level for already registered endpoints.
  BUG 9758: Don't leak the epm_Map policy handle.

Andrew Bartlett (57):
  s4-lib/socket: Return the original EMSGSIZE when sendto() and 
setsockopt() both fail
  tsocket_bsd: Attempt to increase the SO_SNDBUF if we get EMSGSIZE in 
sendto()
  selftest: skip base.dir2 tests as they just spin on modern ext4
  selftest: also skip raw.search as it also spins
  build: Do not force a specific perl from ${PERL} when running pod2man
  build: Set LD_LIBRARY_PATH in install_with_python.sh
  s4-idmap: Remove requirement that posixAccount or posixGroup be set for 
rfc2307
  selftest: Add test for rfc2307 mapping handling
  s4-dbcheck: Allow forcing an override of an old @MODULES record
  samba-tool classicupgrade: Do not print the admin password during upgrade
  scripting/samba_upgradedns: Only look for IPv4/IPv6 addresses if we 
actually them
  scripting: No longer install samba_upgradeprovision
  build: Remove the forced use of only the first part of the compiler string
  build: Do not pass CPP="" to pidl, skip the env variable entirely
  samba_upgradeprovision: Remove options to fix FS ACLs
  scripting: Make tdb_copy use the python subprocess module
  scripting: Make tdb_copy a common util function in samba.tdb_util
  samba_upgradeprovision: Do not update privileges.ldb any more (unchanged 
since 2009)
  samba_upgradeprovision: Use tdb_util.tdb_copy not shutil.copy2
  dsdb-descriptor: Spell out security descriptor flags as constants
  dsdb-descriptor: Avoid segfault copying an SD without an owner or group
  build: Rename samba_python waf node to avoid duplicate name
  build: Change bin/default/python -> bin/python symlink to 
bin/default/python_modules
  samba-tool dbcheck: fix comment on err_wrong_sd
  samba-tool domain classicupgrade: Print a better error when the ldap 
backend PW was not found
  samba-tool domain classicupgrade: Fix typo in error path for multiple 
account flags
  samb

[SCM] Samba Website Repository - branch master updated

2013-04-09 Thread Karolin Seeger
The branch, master has been updated
   via  d80eec7 Announce Samba 4.0.5.
  from  0994f3f FAQ: Some updates.

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


- Log -
commit d80eec71ff7b92174babd7f6b3366f0609aa50f1
Author: Karolin Seeger 
Date:   Tue Apr 9 10:48:44 2013 +0200

Announce Samba 4.0.5.

Signed-off-by: Karolin Seeger 

---

Summary of changes:
 generated_news/latest_10_bodies.html|   25 ++--
 generated_news/latest_10_headlines.html |4 +-
 generated_news/latest_2_bodies.html |   27 ++---
 history/header_history.html |1 +
 history/samba-4.0.5.html|  185 +++
 latest_stable_release.html  |6 +-
 6 files changed, 216 insertions(+), 32 deletions(-)
 create mode 100755 history/samba-4.0.5.html


Changeset truncated at 500 lines:

diff --git a/generated_news/latest_10_bodies.html 
b/generated_news/latest_10_bodies.html
index 7489b5d..6ae083f 100644
--- a/generated_news/latest_10_bodies.html
+++ b/generated_news/latest_10_bodies.html
@@ -1,3 +1,16 @@
+   09 April 2013
+   Samba 4.0.5 Available for Download
+   This is the latest stable release of the Samba 4.0 series.
+
+The uncompressed tarballs and patch files have been signed
+using GnuPG (ID 6568B7EA).  The source code can be
+http://samba.org/samba/ftp/stable/samba-4.0.5.tar.gz";>downloaded
+now. A http://samba.org/samba/ftp/patches/patch-4.0.4-4.0.5.diffs.gz";>
+patch against Samba 4.0.4 is also available. See
+http://samba.org/samba/history/samba-4.0.5.html";> the release notes
+ for more info.
+
+
02 April 2013
Samba 3.6.0 - 3.6.5 (inclusive) bug fix Available 
for Download
 
@@ -127,15 +140,3 @@ now.  A http://samba.org/samba/ftp/patches/patch-4.0.0-4.0.1.diffs.
 patch against Samba 4.0.0 is also available. See
 http://samba.org/samba/history/samba-4.0.1.html";>
 the release notes for more info.
-
-   17 December 2012
-   Samba 3.5.20 Available for Download
-   This is the latest stable release of the Samba 3.5 series.
-
-The uncompressed tarballs and patch files have been signed
-using GnuPG (ID 6568B7EA).  The source code can be
-http://samba.org/samba/ftp/stable/samba-3.5.20.tar.gz";>downloaded
-now. A http://samba.org/samba/ftp/patches/patch-3.5.19-3.5.20.diffs.gz";>
-patch against Samba 3.5.19 is also available. See
-http://samba.org/samba/history/samba-3.5.20.html";>
-the release notes for more info.
diff --git a/generated_news/latest_10_headlines.html 
b/generated_news/latest_10_headlines.html
index 4416ab1..dc25e84 100644
--- a/generated_news/latest_10_headlines.html
+++ b/generated_news/latest_10_headlines.html
@@ -1,4 +1,6 @@
 
+09 April 2013 Samba 4.0.5 Available for 
Download
+
 02 April 2013 Samba 3.6.0 - 3.6.5 
(inclusive) bug fix Available for Download
 
 19 March 2013 Samba 4.0.4 Available for 
Download
@@ -16,6 +18,4 @@
 15 January 2013 Samba 4.0.1 Available for 
Download
 
 17 December 2012 Samba 3.5.20 Available for 
Download
-
-11 December 2012 Samba 4.0.0 Available for 
Download
 
diff --git a/generated_news/latest_2_bodies.html 
b/generated_news/latest_2_bodies.html
index 56fe096..fbf18ae 100644
--- a/generated_news/latest_2_bodies.html
+++ b/generated_news/latest_2_bodies.html
@@ -1,3 +1,15 @@
+   09 April 2013
+   Samba 4.0.5 Available for Download
+   This is the latest stable release of the Samba 4.0 series.
+
+The uncompressed tarballs and patch files have been signed
+using GnuPG (ID 6568B7EA).  The source code can be
+http://samba.org/samba/ftp/stable/samba-4.0.5.tar.gz";>downloaded
+now. A http://samba.org/samba/ftp/patches/patch-4.0.4-4.0.5.diffs.gz";>
+patch against Samba 4.0.4 is also available. See
+http://samba.org/samba/history/samba-4.0.5.html";> the release notes
+ for more info.
+
02 April 2013
Samba 3.6.0 - 3.6.5 (inclusive) bug fix Available 
for Download
 
@@ -7,18 +19,3 @@ CVE-2013-0454 (A writable configured share might get read 
only)
 This http://ftp.samba.org/pub/samba/patches/security/samba-3.6-CVE-2013-0454.patch";>
 patch is required by Samba 3.6.5.
 The patch file has been signed using GnuPG (ID 6568B7EA).
-
-   19 March 2013
-   Samba 4.0.4 Available for Download
-
-This is a security release in order to address http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2013-1863";>
-CVE-2013-1863 (World-writeable files may be created in additional
-shares on a Samba 4.0 AD DC).
-The uncompressed tarballs and patch files have been signed
-using GnuPG (ID 6568B7EA).  The source code can be
-http://download.samba.org/samba/ftp/stable/samba-4.0.4.tar.gz";>downloaded
-now.  A http://download.samba.org/samba/ftp/patches/patch-4.0.3-4.0.4.diffs.gz";>
-patch against Samba 4.0.3 is also available. See
-http://samba.org/samba/history/samba-4

[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Günther Deschner
The branch, master has been updated
   via  045c446 BUG 9766: Cache name_to_sid/sid_to_name correctly.
   via  b7c0330 BUG 9139: Fix the username map optimization.
  from  243278a doc: Document performance impact of "hide unxx" parameters

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


- Log -
commit 045c446b5a3ffc7e56d46ac4aa4acae9d27d9f49
Author: Andreas Schneider 
Date:   Thu Apr 4 12:18:25 2013 +0200

BUG 9766: Cache name_to_sid/sid_to_name correctly.

If there is no domain_name specified we still need to set to for
caching else we will not find the entry later if we lookup the entry
with the domain_name.

Reviewed-by: Guenther Deschner 
Reviewed-by: Volker Lendecke 
Signed-off-by: Andreas Schneider 

Autobuild-User(master): Günther Deschner 
Autobuild-Date(master): Tue Apr  9 16:32:44 CEST 2013 on sn-devel-104

commit b7c0330b7429ce1b9cda8b1c2446b3a21cbd29db
Author: Andreas Schneider 
Date:   Fri Apr 5 14:07:37 2013 +0200

BUG 9139: Fix the username map optimization.

If we successfully map a user. We call

set_last_from_to(user_in, unixname);

in the while loop reading the map file. After a successfull map we don't
stop and continue the loop to check all other mappings in the username
mapfile. But when we hit the end of the file and leave the loop we call:

set_last_from_to(user_in, user_in);

This overwrites the successful mapping, and the next time we call
map_username() we skip the username and no mapping is done.

Signed-off-by: Andreas Schneider 
Reviewed-by: Günther Deschner 

---

Summary of changes:
 source3/auth/user_util.c  |   12 
 source3/winbindd/winbindd_cache.c |   21 +
 2 files changed, 29 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/user_util.c b/source3/auth/user_util.c
index 4842192..082c885 100644
--- a/source3/auth/user_util.c
+++ b/source3/auth/user_util.c
@@ -427,12 +427,16 @@ bool map_username(TALLOC_CTX *ctx, const char *user_in, 
char **p_user_out)
x_fclose(f);
 
/*
-* Setup the last_from and last_to as an optimization so
+* If we didn't successfully map a user in the loop above,
+* setup the last_from and last_to as an optimization so
 * that we don't scan the file again for the same user.
 */
-
-   set_last_from_to(user_in, user_in);
-   store_map_in_gencache(ctx, user_in, user_in);
+   if (!mapped_user) {
+   DEBUG(8, ("The user '%s' has no mapping. "
+ "Skip it next time.\n", user_in));
+   set_last_from_to(user_in, user_in);
+   store_map_in_gencache(ctx, user_in, user_in);
+   }
 
return mapped_user;
 }
diff --git a/source3/winbindd/winbindd_cache.c 
b/source3/winbindd/winbindd_cache.c
index d7499df..86f15c2 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -943,6 +943,15 @@ static void wcache_save_name_to_sid(struct winbindd_domain 
*domain,
centry = centry_start(domain, status);
if (!centry)
return;
+
+   if (domain_name[0] == '\0') {
+   struct winbindd_domain *mydomain =
+   find_domain_from_sid_noinit(sid);
+   if (mydomain != NULL) {
+   domain_name = mydomain->name;
+   }
+   }
+
centry_put_uint32(centry, type);
centry_put_sid(centry, sid);
fstrcpy(uname, name);
@@ -963,6 +972,14 @@ static void wcache_save_sid_to_name(struct winbindd_domain 
*domain, NTSTATUS sta
if (!centry)
return;
 
+   if (domain_name[0] == '\0') {
+   struct winbindd_domain *mydomain =
+   find_domain_from_sid_noinit(sid);
+   if (mydomain != NULL) {
+   domain_name = mydomain->name;
+   }
+   }
+
if (NT_STATUS_IS_OK(status)) {
centry_put_uint32(centry, type);
centry_put_string(centry, domain_name);
@@ -1793,6 +1810,10 @@ NTSTATUS wcache_name_to_sid(struct winbindd_domain 
*domain,
return NT_STATUS_NO_MEMORY;
}
 
+   if (domain_name[0] == '\0') {
+   domain_name = domain->name;
+   }
+
centry = wcache_fetch(cache, domain, "NS/%s/%s", domain_name, uname);
TALLOC_FREE(uname);
if (centry == NULL) {


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Richard Sharpe
The branch, master has been updated
   via  f61ee72 pylibsmb: Avoid a segfault if no credentials are passed to 
libsmb.Conn()
  from  045c446 BUG 9766: Cache name_to_sid/sid_to_name correctly.

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


- Log -
commit f61ee7238b8430572fb266521dad3ee000d1f252
Author: Volker Lendecke 
Date:   Tue Apr 9 14:29:11 2013 +0200

pylibsmb: Avoid a segfault if no credentials are passed to libsmb.Conn()

Signed-off-by: Volker Lendecke 
Reviewed-by: Richard Sharpe 

Autobuild-User(master): Richard Sharpe 
Autobuild-Date(master): Tue Apr  9 18:30:06 CEST 2013 on sn-devel-104

---

Summary of changes:
 source3/libsmb/pylibsmb.c |   10 +-
 1 files changed, 5 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/pylibsmb.c b/source3/libsmb/pylibsmb.c
index 4fd5921..2b253f9 100644
--- a/source3/libsmb/pylibsmb.c
+++ b/source3/libsmb/pylibsmb.c
@@ -406,7 +406,7 @@ static int py_cli_state_init(struct py_cli_state *self, 
PyObject *args,
 {
NTSTATUS status;
char *host, *share;
-   PyObject *creds;
+   PyObject *creds = NULL;
struct cli_credentials *cli_creds;
bool ret;
 
@@ -434,10 +434,10 @@ static int py_cli_state_init(struct py_cli_state *self, 
PyObject *args,
return -1;
}
 
-   cli_creds = cli_credentials_from_py_object(creds);
-   if (cli_creds == NULL) {
-   PyErr_SetString(PyExc_TypeError, "Expected credentials");
-   return -1;
+   if (creds == NULL) {
+   cli_creds = cli_credentials_init_anon(NULL);
+   } else {
+   cli_creds = PyCredentials_AsCliCredentials(creds);
}
 
status = cli_full_connection(


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Jim McDonough
The branch, master has been updated
   via  28da1af winbindd: Avoid a fd leak when we can not fork
  from  f61ee72 pylibsmb: Avoid a segfault if no credentials are passed to 
libsmb.Conn()

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


- Log -
commit 28da1af476853e6b49765bd04a496163e8ebd448
Author: Volker Lendecke 
Date:   Tue Apr 9 16:37:29 2013 +0200

winbindd: Avoid a fd leak when we can not fork

Signed-off-by: Volker Lendecke 
Signed-off-by: Jim McDonough 

Autobuild-User(master): Jim McDonough 
Autobuild-Date(master): Tue Apr  9 20:27:27 CEST 2013 on sn-devel-104

---

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


Changeset truncated at 500 lines:

diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index e1e45d4..34896d5 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1398,6 +1398,8 @@ static bool fork_domain_child(struct winbindd_child 
*child)
 
if (child->pid == -1) {
DEBUG(0, ("Could not fork: %s\n", strerror(errno)));
+   close(fdpair[0]);
+   close(fdpair[1]);
return False;
}
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Andreas Schneider
The branch, master has been updated
   via  a308db6 s3-netlogon: enumerate UPN suffixes from PASSDB when 
available
   via  5952755 PASSDB: add support to set and enumerate UPN suffixes 
associated with our forest
   via  b752417 s3-waf: filter out ldapsam internal init functions
   via  6058bc9 wafsamba: fix samba_abi for default catch-all case
  from  28da1af winbindd: Avoid a fd leak when we can not fork

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


- Log -
commit a308db6587c866826a280a60b841f0a3926c1078
Author: Alexander Bokovoy 
Date:   Wed Apr 3 16:52:45 2013 +0300

s3-netlogon: enumerate UPN suffixes from PASSDB when available

Optionally append list of UPN suffixes if PDB module returns non-empty one.

Refactor fill_forest_trust_array() in source3 to allow reuse of the code 
between
_netr_DsRGetForestTrustInformation() and _netr_GetForestTrustInformation()

Implement a special case of _netr_DsRGetForestTrustInformation in smbd
when trusted_domain_name is NULL (covered by test_DsrEnumerateDomainTrusts()
in rpc.netlogon torture tests, see comment in 
source4/torture/rpc/netlogon.c).

Reviewed-by: Andreas Schneider 

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue Apr  9 22:19:34 CEST 2013 on sn-devel-104

commit 5952755755fb0ea7f942bb564ca1cfdca5730113
Author: Alexander Bokovoy 
Date:   Wed Apr 3 16:37:00 2013 +0300

PASSDB: add support to set and enumerate UPN suffixes associated with our 
forest

Samba PDC may manage a forest containing DNS domains in addition to the 
primary one.
Information about them is advertised via netr_DsRGetForestTrustInformation 
when
trusted_domain_name is NULL, according to MS-NRPC and MS-LSAD, and
via netr_GetForestTrustInformation.

This changeset only expands PASSDB API; how suffixes are maintained is left
to specific PDB modules. Set function is added so that suffixes could be
managed through 'net' and other Samba utilities, if possible.

One possible implementation is available for ipasam module in FreeIPA:

http://git.fedorahosted.org/cgit/freeipa.git/commit/?id=cc56723151c9ebf58d891e85617319d861af14a4

Reviewed-by: Andreas Schneider 

commit b752417f2d6c478524f0fbf0fda1a5d0401b6f9e
Author: Alexander Bokovoy 
Date:   Wed Apr 3 16:01:34 2013 +0300

s3-waf: filter out ldapsam internal init functions

pdb_ldapsam_init* functions (init and init_common) are used in
pdb_ipa.c and pdb_nds.c which are always linked together with
pdb_ldap.c where pdb_ldapsam_init* functions reside.

Tested with both ldapsam integrated (into libpdb) and as
a separate module.

Reviewed-by: Andreas Schneider 

commit 6058bc9bb6ac315fbe7cb18e1d07a846f7849e22
Author: Alexander Bokovoy 
Date:   Wed Apr 3 15:52:06 2013 +0300

wafsamba: fix samba_abi for default catch-all case

Only filter out the symbol when positive match was not found and there is
negative match.

ABI signature file generator worked incorrectly for cases when mixture of
positive and negative matches were provided. This resulted in generating 
empty
signature file for libpdb since there was no catch-all positive match 
anymore.

Commit 9ba44cc610426fb558b49aa9680b5bdf55c29082 removed explicit '*' 
positive
match and corresponding vscript generator adds '*' by default if global 
match
list is empty, so this commit introduces feature parity into signature
generator.

Reviewed-by: Andreas Schneider 

---

Summary of changes:
 buildtools/wafsamba/samba_abi.py|4 +-
 source3/include/passdb.h|   18 -
 source3/passdb/ABI/pdb-0.sigs   |2 +
 source3/passdb/pdb_interface.c  |   36 +
 source3/rpc_server/netlogon/srv_netlog_nt.c |  106 ---
 source3/wscript_build   |1 +
 6 files changed, 153 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 488dab8..76acd00 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -50,13 +50,15 @@ def parse_sigs(sigs, abi_match):
 sa = s.split(':')
 if abi_match:
 matched = False
+negative = False
 for p in abi_match:
 if p[0] == '!' and fnmatch.fnmatch(sa[0], p[1:]):
+negative = True
 break
 elif fnmatch.fnmatch(sa[0], p):
 matched = True
 break
-if not matched:
+if (not matched) and negative:
 continue
 Logs.debug("%s -> %s" % (sa[1], normalise_

[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Jeremy Allison
The branch, master has been updated
   via  69b3d19 vfs_fake_perms: Fix bug 9775, segfault for "artificial" 
conn_structs
   via  ce2fb2d vfs_fake_perms: Slightly streamline code
   via  60c2953 vfs_fake_perms: Slightly streamline code
  from  a308db6 s3-netlogon: enumerate UPN suffixes from PASSDB when 
available

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


- Log -
commit 69b3d1944501f65427fbd12e4ddd3b66e67deedd
Author: Volker Lendecke 
Date:   Tue Apr 9 21:18:34 2013 +0200

vfs_fake_perms: Fix bug 9775, segfault for "artificial" conn_structs

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

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Wed Apr 10 00:12:06 CEST 2013 on sn-devel-104

commit ce2fb2d019b6f8304b81e2d4d68bdac31edcf025
Author: Volker Lendecke 
Date:   Tue Apr 9 21:07:23 2013 +0200

vfs_fake_perms: Slightly streamline code

Don't initialize a variable directly set

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

commit 60c2953a9d5fa12494a8a767c30913398affe453
Author: Volker Lendecke 
Date:   Tue Apr 9 21:07:23 2013 +0200

vfs_fake_perms: Slightly streamline code

Do an early error return

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

---

Summary of changes:
 source3/modules/vfs_fake_perms.c |   66 +++--
 1 files changed, 48 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_fake_perms.c b/source3/modules/vfs_fake_perms.c
index 4cda7ea..8eb6e3c 100644
--- a/source3/modules/vfs_fake_perms.c
+++ b/source3/modules/vfs_fake_perms.c
@@ -32,17 +32,32 @@
 static int fake_perms_stat(vfs_handle_struct *handle,
   struct smb_filename *smb_fname)
 {
-   int ret = -1;
+   int ret;
 
ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
-   if (ret == 0) {
-   if (S_ISDIR(smb_fname->st.st_ex_mode)) {
-   smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
-   } else {
-   smb_fname->st.st_ex_mode = S_IRWXU;
-   }
-   smb_fname->st.st_ex_uid = 
handle->conn->session_info->unix_token->uid;
-   smb_fname->st.st_ex_gid = 
handle->conn->session_info->unix_token->gid;
+   if (ret != 0) {
+   return ret;
+   }
+
+   if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+   smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
+   } else {
+   smb_fname->st.st_ex_mode = S_IRWXU;
+   }
+
+   if (handle->conn->session_info != NULL) {
+   struct security_unix_token *utok;
+
+   utok = handle->conn->session_info->unix_token;
+   smb_fname->st.st_ex_uid = utok->uid;
+   smb_fname->st.st_ex_gid = utok->gid;
+   } else {
+   /*
+* We have an artificial connection for dfs for example. It
+* sucks, but the current uid/gid is the best we have.
+*/
+   smb_fname->st.st_ex_uid = geteuid();
+   smb_fname->st.st_ex_gid = getegid();
}
 
return ret;
@@ -50,18 +65,33 @@ static int fake_perms_stat(vfs_handle_struct *handle,
 
 static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, 
SMB_STRUCT_STAT *sbuf)
 {
-   int ret = -1;
+   int ret;
 
ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-   if (ret == 0) {
-   if (S_ISDIR(sbuf->st_ex_mode)) {
-   sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
-   } else {
-   sbuf->st_ex_mode = S_IRWXU;
-   }
-   sbuf->st_ex_uid = handle->conn->session_info->unix_token->uid;
-   sbuf->st_ex_gid = handle->conn->session_info->unix_token->gid;
+   if (ret != 0) {
+   return ret;
}
+
+   if (S_ISDIR(sbuf->st_ex_mode)) {
+   sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
+   } else {
+   sbuf->st_ex_mode = S_IRWXU;
+   }
+   if (handle->conn->session_info != NULL) {
+   struct security_unix_token *utok;
+
+   utok = handle->conn->session_info->unix_token;
+   sbuf->st_ex_uid = utok->uid;
+   sbuf->st_ex_gid = utok->gid;
+   } else {
+   /*
+* We have an artificial connection for dfs for example. It
+* sucks, but the current uid/gid is the best we have.
+*/
+   sbuf->st_ex_uid = geteuid();
+   sbuf->st_ex_gid = getegid();
+   }
+
return ret;
 }
 


-- 
Samba Shared Repository


[SCM] Samba Shared Repository - branch master updated

2013-04-09 Thread Michael Adam
The branch, master has been updated
   via  8aae8b5 s3:smbd: do not access data behind req->buf+req->buflen in 
srvstr_pull_req_talloc()
   via  a70e9db s3:smbd: convert srvstr_pull_req_talloc() into a function
   via  98f9e5e s3:smbd: do not access data behind req->buf+req->buflen in 
srvstr_get_path_req_wcard()
   via  e7e37b3 python-samba-tool domain classicupgrade: Make failure to 
connect directly to the LDAP backend fatal
   via  45a596f build: Remove extra space in shebang
   via  58e3c53 build: Replace #!/usr/bin/env python with passed in PYTHON=
  from  69b3d19 vfs_fake_perms: Fix bug 9775, segfault for "artificial" 
conn_structs

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


- Log -
commit 8aae8b5bad167ac732b7f8949dfb40aebb2f26a9
Author: Ralph Wuerthner 
Date:   Thu Apr 4 13:29:01 2013 +0200

s3:smbd: do not access data behind req->buf+req->buflen in 
srvstr_pull_req_talloc()

Reviewed-by: Volker Lendecke 
Reviewed-by: Michael Adam 

Autobuild-User(master): Michael Adam 
Autobuild-Date(master): Wed Apr 10 02:03:13 CEST 2013 on sn-devel-104

commit a70e9db0f325e9be85983c172f0cc68992b0f593
Author: Ralph Wuerthner 
Date:   Thu Apr 4 13:24:36 2013 +0200

s3:smbd: convert srvstr_pull_req_talloc() into a function

Reviewed-by: Volker Lendecke 
Reviewed-by: Michael Adam 

commit 98f9e5edd35d6fb54dea74f799b017967b0a13fd
Author: Ralph Wuerthner 
Date:   Thu Apr 4 12:59:36 2013 +0200

s3:smbd: do not access data behind req->buf+req->buflen in 
srvstr_get_path_req_wcard()

Reviewed-by: Volker Lendecke 
Reviewed-by: Michael Adam 

commit e7e37b3b90100f762a45f2f3c047e14e3619c216
Author: Andrew Bartlett 
Date:   Fri Apr 5 15:23:20 2013 +1100

python-samba-tool domain classicupgrade: Make failure to connect directly 
to the LDAP backend fatal

This is better than failing just a little further down the stack with a 
useless error
about use-before-set.

Andrew Bartlett

Reviewed-by: Michael Adam 

commit 45a596fbe9ed2b198956d58784999df780f6dd65
Author: Andrew Bartlett 
Date:   Mon Apr 8 08:33:55 2013 +1000

build: Remove extra space in shebang

Reviewed-by: Michael Adam 

commit 58e3c5323e343dcab1c528c6b6a44925b76cb297
Author: Andrew Bartlett 
Date:   Mon Apr 8 15:57:45 2013 +1000

build: Replace #!/usr/bin/env python with passed in PYTHON=

This means that if we were forced to use a specific python for the build, we
will put that binary into the top of samba-tool, so it continues to work
after the install.

Andrew Bartlett

Reviewed-by: Michael Adam 

---

Summary of changes:
 buildtools/wafsamba/samba_python.py |   10 ++
 buildtools/wafsamba/wafsamba.py |   15 ++-
 python/samba/upgrade.py |2 +-
 source3/include/srvstr.h|9 -
 source3/smbd/proto.h|2 ++
 source3/smbd/reply.c|   31 ---
 source3/wscript |2 +-
 wscript |7 ++-
 8 files changed, 58 insertions(+), 20 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_python.py 
b/buildtools/wafsamba/samba_python.py
index b2172f7..847b431 100644
--- a/buildtools/wafsamba/samba_python.py
+++ b/buildtools/wafsamba/samba_python.py
@@ -5,6 +5,16 @@ from samba_utils import *
 from samba_autoconf import *
 
 from Configure import conf
+
+@conf
+def SAMBA_CHECK_PYTHON(conf, mandatory=True):
+# enable tool to build python extensions
+conf.find_program('python', var='PYTHON', mandatory=mandatory)
+conf.check_tool('python')
+path_python = conf.find_program('python')
+conf.env.PYTHON_SPECIFIED = (conf.env.PYTHON != path_python)
+conf.check_python_version((2,4,2))
+
 @conf
 def SAMBA_CHECK_PYTHON_HEADERS(conf, mandatory=True):
 if conf.env["python_headers_checked"] == []:
diff --git a/buildtools/wafsamba/wafsamba.py b/buildtools/wafsamba/wafsamba.py
index f7156ec..3559cc1 100644
--- a/buildtools/wafsamba/wafsamba.py
+++ b/buildtools/wafsamba/wafsamba.py
@@ -696,14 +696,25 @@ def copy_and_fix_python_path(task):
 replacement="""sys.path.insert(0, "%s")
 sys.path.insert(1, "%s")""" % (task.env["PYTHONARCHDIR"], 
task.env["PYTHONDIR"])
 
+shebang = None
+
+if task.env["PYTHON"][0] == "/":
+replacement_shebang = "#!%s" % task.env["PYTHON"]
+else:
+replacement_shebang = "#!/usr/bin/env %s" % task.env["PYTHON"]
+
 installed_location=task.outputs[0].bldpath(task.env)
 source_file = open(task.inputs[0].srcpath(task.env))
 installed_file = open(installed_location, 'w')
+lineno = 0
 for line in source_file:
 newline = line
-if pattern in line:
+if lineno == 0