[SCM] Samba Shared Repository - branch master updated

2016-08-16 Thread Jeremy Allison
The branch, master has been updated
   via  639063d s3: vfs: shadow_copy2. Remove any trailing slash when 
stripping @GMT-... from the end of a path.
   via  6245f2c s3: vfs: shadow_copy2: Re-use an existing variable already 
set to the right value (p - name).
  from  b2bf613 idmap: centrally check that unix IDs returned by the idmap 
backends are in range

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


- Log -
commit 639063da8c5077170bfe2dc4d3a69c3219a4f6a1
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Aug 16 09:43:37 2016 -0700

s3: vfs: shadow_copy2. Remove any trailing slash when stripping 
@GMT-... from the end of a path.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Christof Schmitt <c...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Aug 17 05:25:30 CEST 2016 on sn-devel-144

commit 6245f2c042da55c71086e1d40186b11964ddeba8
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Aug 16 09:41:43 2016 -0700

s3: vfs: shadow_copy2: Re-use an existing variable already set to the right 
value (p - name).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Christof Schmitt <c...@samba.org>

---

Summary of changes:
 source3/modules/vfs_shadow_copy2.c | 10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_shadow_copy2.c 
b/source3/modules/vfs_shadow_copy2.c
index bda934e..4ac16d3 100644
--- a/source3/modules/vfs_shadow_copy2.c
+++ b/source3/modules/vfs_shadow_copy2.c
@@ -486,7 +486,15 @@ static bool shadow_copy2_strip_snapshot(TALLOC_CTX 
*mem_ctx,
 * with a path prefix.
 */
if (pstripped != NULL) {
-   stripped = talloc_strndup(mem_ctx, name, p - name);
+   if (len_before_gmt > 0) {
+   /*
+* There is a slash before
+* the @GMT-. Remove it.
+*/
+   len_before_gmt -= 1;
+   }
+   stripped = talloc_strndup(mem_ctx, name,
+   len_before_gmt);
if (stripped == NULL) {
return false;
}


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-08-12 Thread Jeremy Allison
The branch, master has been updated
   via  f1b42ec smbd: Fix snapshot query on shares with DFS enabled
   via  b6931d5 selftest: add tests for dfree with inherit owner enabled
   via  f20d57e selftest: refactor test_dfree_quota.sh - add share parameter
   via  ea73bcd smbd: use owner uid for free disk calculation if owner is 
inherited
   via  bd2ec88 smbd: get a valid file stat to disk_quotas
   via  3e6ea02 quotas: small cleanup
  from  1c10c85 ctdb: Fix the O3 developer build on RHEL7

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


- Log -
commit f1b42ec778e08875e076df7fdf67dd69bf9b2757
Author: Christof Schmitt <c...@samba.org>
Date:   Fri Aug 12 14:59:07 2016 -0700

smbd: Fix snapshot query on shares with DFS enabled

When DFS is enabled (host msdfs = yes and msdfs root = yes), then SMB
clients send create requests in the format \hostname\service\path.
Putting the GMT tag as first element breaks the DFS parsing and results
in OBJECT_NOT_FOUND for snapshotted files.  Fix this by appending the
GMT tag to the end of the path.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12150

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Aug 13 05:44:39 CEST 2016 on sn-devel-144

commit b6931d5edc381d64ba0fbcd85538cd65e90a2560
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Aug 11 23:54:22 2016 +0300

selftest: add tests for dfree with inherit owner enabled

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f20d57eceacccb365892dec816cbe57e2ddda8b9
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Jan 20 21:54:24 2016 +0200

selftest: refactor test_dfree_quota.sh - add share parameter

Add a share parameter to individual disk-free tests. This will
allow running tests on shares other than dfq share.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit ea73bcd87b6113f77ccda683d15b5a39003b8eaa
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Aug 11 23:37:42 2016 +0300

smbd: use owner uid for free disk calculation if owner is inherited

If "inherit owner" is enabled, then new files created under a
directory shall consume the quota of the directory's owner, so
the free disk calculation should take that quota into account,
not the quota of the user creating the file.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145
    
Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit bd2ec88dca692c239397891bd35c9fa6b8e7b51a
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Jan 14 00:09:36 2016 +0200

smbd: get a valid file stat to disk_quotas

Most calls to disk_quotas originate at a state with an
open file descriptor. Pass the file's stat info down to
disk_quota, so that we can avoid extra stat's and the related
error handling.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12145

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3e6ea02d4258a782482eee9f9124c6a39b74a965
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Jan 27 08:12:20 2016 +0200

quotas: small cleanup

Remove an internal function from proto.h

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 selftest/target/Samba3.pm| 21 ++--
 source3/modules/vfs_ceph.c   |  5 +-
 source3/modules/vfs_default.c|  5 +-
 source3/script/tests/test_dfree_quota.sh | 84 ++--
 source3/selftest/tests.py|  2 +-
 source3/smbd/dfree.c | 16 +++---
 source3/smbd/proto.h | 16 +++---
 source3/smbd/quotas.c| 55 ++---
 source3/smbd/reply.c | 13 -
 source3/smbd/smb2_create.c   |  6 +--
 source3/smbd/trans2.c| 12 ++---
 source3/smbd/vfs.c   |  4 +-
 12 files changed, 155 insertions(+), 84 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index a0996a8..8fc3204 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -614,6 +614,7 @@ sub setup_fileserver($$)
p

[SCM] Samba Shared Repository - branch master updated

2016-08-12 Thread Jeremy Allison
The branch, master has been updated
   via  1c10c85 ctdb: Fix the O3 developer build on RHEL7
  from  89a2462 vfs_gpfs: Load nfs4 acl params at tcon time

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


- Log -
commit 1c10c85939d8dfa5009736e8c8633a3b58712436
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Aug 12 13:18:19 2016 +0200

ctdb: Fix the O3 developer build on RHEL7

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Aug 13 00:55:02 CEST 2016 on sn-devel-144

---

Summary of changes:
 ctdb/tools/ctdb.c | 2 ++
 1 file changed, 2 insertions(+)


Changeset truncated at 500 lines:

diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index e52121d..2cb699a 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -4761,6 +4761,8 @@ static int control_scriptstatus(TALLOC_CTX *mem_ctx, 
struct ctdb_context *ctdb,
}
 
valid = false;
+   end = 0;
+
for (i=0; i<ARRAY_SIZE(all_events); i++) {
if (strcmp(event_str, all_events[i]) == 0) {
valid = true;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-08-11 Thread Jeremy Allison
The branch, master has been updated
   via  5700158 lib: Use replace.h properly in pthreadpool
   via  499bfce ctdb-pmda: Use 1s timeout for fetching statistics
  from  e001dce ldb: Fix some signed/unsigned hickups

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


- Log -
commit 57001580bb354be086548720b3b0d3c8b6e05642
Author: Volker Lendecke <v...@samba.org>
Date:   Sun Jul 31 07:42:21 2016 +0200

lib: Use replace.h properly in pthreadpool

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Aug 12 04:26:09 CEST 2016 on sn-devel-144

commit 499bfce3e9138e01216170a25b12b404d7430a74
Author: Amitay Isaacs <ami...@gmail.com>
Date:   Tue Aug 2 19:06:10 2016 +1000

ctdb-pmda: Use 1s timeout for fetching statistics

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12138

Signed-off-by: Amitay Isaacs <ami...@gmail.com>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ctdb/utils/pmda/pmda_ctdb.c   |  3 +--
 source3/lib/pthreadpool/pthreadpool.c | 14 +++---
 2 files changed, 4 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index 6131be9..a77f26c 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -441,7 +441,6 @@ static int
 pmda_ctdb_fetch(int numpmid, pmID pmidlist[], pmResult **resp, pmdaExt *pmda)
 {
int ret;
-   struct timeval ctdb_timeout;
 
if (client == NULL) {
fprintf(stderr, "attempting reconnect to ctdbd\n");
@@ -453,7 +452,7 @@ pmda_ctdb_fetch(int numpmid, pmID pmidlist[], pmResult 
**resp, pmdaExt *pmda)
}
 
ret = ctdb_ctrl_statistics(client, ev, client, CTDB_CURRENT_NODE,
-  ctdb_timeout, );
+  tevent_timeval_current_ofs(1,0), );
if (ret != 0) {
fprintf(stderr, "ctdb control for statistics failed, 
reconnecting\n");
pmda_ctdb_daemon_disconnect();
diff --git a/source3/lib/pthreadpool/pthreadpool.c 
b/source3/lib/pthreadpool/pthreadpool.c
index 4b745e4..917bafa 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -17,21 +17,13 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#include "config.h"
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
+#include "replace.h"
 #include "system/time.h"
 #include "system/filesys.h"
-#include "replace.h"
-
 #include "pthreadpool.h"
 #include "lib/util/dlinklist.h"
+#include "system/threads.h"
+#include 
 
 struct pthreadpool_job {
int id;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-08-11 Thread Jeremy Allison
The branch, master has been updated
   via  e001dce ldb: Fix some signed/unsigned hickups
   via  df83b17 s3: oplock: Fix race condition when closing an oplocked 
file.
   via  cb394ab smbd: oplock: Factor out internals of remove_oplock() into 
new remove_oplock_under_lock().
   via  de71801 smbd: oplock: Fixup debug messages inside remove_oplock().
  from  98d289d script/autobuild.py: include the branch name in the output

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


- Log -
commit e001dceadf20ca5bbc2597571d1caefe77deef77
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Aug 11 15:46:49 2016 +0200

ldb: Fix some signed/unsigned hickups

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Stefan Metzmacher <me...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Aug 11 23:49:38 CEST 2016 on sn-devel-144

commit df83b17c60a08a27a7ddd1d88dc125e15b3ee06d
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Aug 10 14:42:07 2016 -0700

s3: oplock: Fix race condition when closing an oplocked file.

We must send the 'oplock released' message whilst the lock
is held in the close path. Otherwise the messaged smbd can
race with the share mode delete.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12139
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Volker Lendecke <v...@samba.org>

commit cb394abe5206dd8ad8a68f157427991b259129a7
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Aug 10 14:39:52 2016 -0700

smbd: oplock: Factor out internals of remove_oplock() into new 
remove_oplock_under_lock().

Allows this to be called elsewhere.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12139

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Volker Lendecke <v...@samba.org>

commit de7180151fc99893c4763882fecd9d2a623cd061
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Aug 10 14:35:42 2016 -0700

smbd: oplock: Fixup debug messages inside remove_oplock().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12139

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Volker Lendecke <v...@samba.org>

---

Summary of changes:
 lib/ldb/common/ldb_pack.c |  5 ++---
 source3/smbd/close.c  | 10 -
 source3/smbd/oplock.c | 54 +--
 source3/smbd/proto.h  |  1 +
 4 files changed, 41 insertions(+), 29 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c
index cc3a552..7e6dd2d 100644
--- a/lib/ldb/common/ldb_pack.c
+++ b/lib/ldb/common/ldb_pack.c
@@ -185,8 +185,7 @@ static bool ldb_consume_element_data(uint8_t **pp, size_t 
*premaining)
unsigned int remaining = *premaining;
uint8_t *p = *pp;
uint32_t num_values = pull_uint32(p, 0);
-   uint32_t len;
-   int j;
+   uint32_t j, len;
 
p += 4;
if (remaining < 4) {
@@ -348,7 +347,7 @@ int ldb_unpack_data_only_attr_list_flags(struct ldb_context 
*ldb,
 */
if (list_size != 0) {
bool keep = false;
-   int h;
+   unsigned int h;
 
/*
 * We know that p has a \0 terminator before the
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 3c4b9b1..22bd361 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -273,6 +273,11 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp,
return NT_STATUS_INVALID_PARAMETER;
}
 
+   /* Remove the oplock before potentially deleting the file. */
+   if(fsp->oplock_type) {
+   remove_oplock_under_lock(fsp, lck);
+   }
+
if (fsp->write_time_forced) {
DEBUG(10,("close_remove_share_mode: write time forced "
"for file %s\n",
@@ -741,11 +746,6 @@ static NTSTATUS close_normal_file(struct smb_request *req, 
files_struct *fsp,
return NT_STATUS_OK;
}
 
-   /* Remove the oplock before potentially deleting the file. */
-   if(fsp->oplock_type) {
-   remove_oplock(fsp);
-   }
-
/* If this is an old DOS or FCB open and we have multiple opens on
   the same handle we only have one share mode. Ensure we only remove
   the share mode on the last close. */
diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index be20dee..ff87d9e 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -223,6 +223,34 @@ bool update_num_read_oplocks(files_struct *fsp, struct 
share_mode_

[SCM] Samba Shared Repository - branch master updated

2016-08-10 Thread Jeremy Allison
The branch, master has been updated
   via  c064357 selftest/flapping: add some samba3.blackbox.smbclient_s3 
tests
   via  119e7d0 Revert "s4: tests: Skip drs tests."
   via  3ce5ad1 selftest: Move repl_schema test to a distinct OID prefix
   via  1086974 s4:dsdb/repl_meta_data: Add more info on which DN we failed 
to find an attid on
   via  111c5fd s4:dsdb/repl: let dsdb_replicated_objects_convert() change 
remote to local attid for linked attributes
   via  cff6111 s4:dsdb/repl: set working_schema->resolving_in_progress 
during schema creation
   via  6bc007a s4:dsdb/schema: move messages for unknown attids to higher 
debug levels during resolving
   via  5ee6f93 s4:dsdb/schema: split out a 
dsdb_attribute_drsuapi_remote_to_local() function
   via  2e6860d s4:dsdb/schema: don't update the in memory 
schema->prefixmap without reloading the schema!
   via  b755ec7 s4:dsdb/schema: avoid an implicit prefix map creation in 
lookup functions
   via  fa580f2 s4:dsdb/objectclass_attrs: call dsdb_attribute_from_ldb() 
without a prefixmap
   via  edeb577 s4:dsdb/repl: make sure the working_schema prefix map is 
populated with the remote prefix map
   via  f905ddc s4:dsdb/schema: make dsdb_schema_pfm_add_entry() public and 
more useful
   via  29caafa s4:dsdb/schema: Remove unused old schema from memory
   via  c533b60 s4:dsdb/repl: Improve memory handling in replicated schema 
code
   via  0a1627d s4:dsdb/schema: don't treat an older remote schema as 
SCHEMA_MISMATCH
   via  386dbc4 s4:dsdb/schema: store struct dsdb_schema_info instead of a 
hexstring
   via  ab63866 s4:dsdb/repl: avoid recursion after fetching schema changes.
   via  7143aed s4:dsdb/schema: don't change schema->schema_info on 
originating schema changes.
  from  8c61e14 Fix a typo in smb.conf man page

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


- Log -
commit c064357428799ebb9c8ac5e9bf3a081bdad45072
Author: Stefan Metzmacher <me...@samba.org>
Date:   Sat Aug 6 10:33:49 2016 +0200

selftest/flapping: add some samba3.blackbox.smbclient_s3 tests

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12108

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Aug 11 04:42:30 CEST 2016 on sn-devel-144

commit 119e7d094da26029e16d72598a55377d8010f28f
Author: Stefan Metzmacher <me...@samba.org>
Date:   Fri Aug 5 22:06:41 2016 +0200

Revert "s4: tests: Skip drs tests."

This reverts commit 08d03f79de49826dc5dff3bc09193f1404e5f549.

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3ce5ad1e6ca25fb91f0a0dcd7e389713913a35b0
Author: Andrew Bartlett <abart...@samba.org>
Date:   Tue Aug 2 15:45:18 2016 +1200

selftest: Move repl_schema test to a distinct OID prefix

We also take the chance to make it clearer that the number
being passed in should be unique.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Stefan Metzmacher <me...@samba.org>

commit 108697402c9e39511f9ea1b1e21cae9322586f6b
Author: Andrew Bartlett <abart...@samba.org>
Date:   Tue Aug 2 14:28:12 2016 +1200

s4:dsdb/repl_meta_data: Add more info on which DN we failed to find an 
attid on

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 111c5fd83fa3d0f2e1ae3af0767d8717edab484a
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Aug 8 09:10:48 2016 +0200

s4:dsdb/repl: let dsdb_replicated_objects_convert() change remote to local 
attid for linked attributes

We already do that for objects in dsdb_convert_object_ex().

We need to be consistent and do the same for linked attributes.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cff6111d2fe5b3999447eaa870c5ddee158226aa
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Aug 8 12:11:53 2016 +0200

s4:dsdb/repl: set working_schema->resolving_in_progress during schema 
creation

    BUG: https://bugzilla.samba.org/show_bug.cgi?id=12128

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 6bc007a9143a57525732792bb1fcb934fcb2c91c
Author: Stefan Metzmacher <me...@samba.org>
Date:   Mon Aug 8 09:10:13 2016 +0200

s4:dsdb/schema: move messages f

[SCM] Samba Shared Repository - branch master updated

2016-08-08 Thread Jeremy Allison
The branch, master has been updated
   via  3fcd937 selftest: tests for kerberos encryption types
   via  1f90983 heimdal: honor conf enctypes when obtaining a service ticket
   via  3fff266 libads: use "kerberos encryption types" parameter
   via  513fa31 s3-param: add kerberos encryption types parameter
  from  25df582 dbwrap_ctdb: treat empty records in ltdb as non-existing

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


- Log -
commit 3fcd937f053e378a99d7886a6e53031462ffc2d9
Author: Uri Simchoni <u...@samba.org>
Date:   Tue Jul 5 06:07:04 2016 +0300

selftest: tests for kerberos encryption types

This test uses tshark and cwrap's packet capturing capability
to observe the Kerberos handshakes and ensure the correct
encryption types are being used.

Signed-off-by: Uri Simchoni <u...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Aug  9 07:43:52 CEST 2016 on sn-devel-144

commit 1f90983324b9f5804dc57f87c5f7695b0e53db8d
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Jul 4 09:50:33 2016 +0300

heimdal: honor conf enctypes when obtaining a service ticket

This patch removes part of what's categorized in the code as
"hideous glue", which causes Heimdal to ignore krb5.conf
encryption types, and instead use either the application-
supplied values or the default compile-time values.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3fff2667ec3f12fe1263735095c1a39182b0d351
Author: Uri Simchoni <u...@samba.org>
Date:   Mon May 30 21:21:41 2016 +0300

libads: use "kerberos encryption types" parameter

When creating the custom krb.conf file, list etypes
according to kerberos encryption types

Also use proper directives for heimdal (heimdal recognizes
the MIT etype directives, but does not act upon them)

    Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 513fa31c85650e0767e5dc1b3b94a4cc652030e6
Author: Uri Simchoni <u...@samba.org>
Date:   Sun May 8 15:45:44 2016 +0300

s3-param: add kerberos encryption types parameter

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 .../security/kerberosencryptiontypes.xml   |  53 +++
 lib/param/loadparm.c   |   2 +
 lib/param/loadparm.h   |   4 +
 lib/param/param_table.c|   9 ++
 source3/libads/kerberos.c  | 106 -
 source4/heimdal/lib/gssapi/krb5/init_sec_context.c |  11 +--
 source4/selftest/tests.py  |   3 +
 testprogs/blackbox/test_client_etypes.sh   |  58 +++
 8 files changed, 213 insertions(+), 33 deletions(-)
 create mode 100644 docs-xml/smbdotconf/security/kerberosencryptiontypes.xml
 create mode 100755 testprogs/blackbox/test_client_etypes.sh


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/security/kerberosencryptiontypes.xml 
b/docs-xml/smbdotconf/security/kerberosencryptiontypes.xml
new file mode 100644
index 000..b19a8a8
--- /dev/null
+++ b/docs-xml/smbdotconf/security/kerberosencryptiontypes.xml
@@ -0,0 +1,53 @@
+http://www.samba.org/samba/DTD/samba-doc;>
+
+This parameter determines the encryption types to use when operating
+as a Kerberos client. Possible values are all,
+strong, and legacy.
+
+
+Samba uses a Kerberos library (MIT or Heimdal) to obtain Kerberos
+tickets. This library is normally configured outside of Samba, using
+the krb5.conf file. This file may also include directives to configure
+the encryption types to be used. However, Samba implements Active Directory
+protocols and algorithms to locate a domain controller. In order to
+force the Kerberos library into using the correct domain controller,
+some Samba processes, such as
+winbindd
+8 and
+net
+8, build a private krb5.conf
+file for use by the Kerberos library while being invoked from Samba.
+This private file controls all aspects of the Kerberos library operation,
+and this parameter controls how the encryption types are configured
+within this generated file, and therefore also controls the encryption
+types negotiable by Samba.
+
+
+When set to all, all active directory
+encryption types are allowed.
+
+
+When set to strong, only AES-based encyption
+types are offered. This can be used in hardened environments to prevent
+ 

[SCM] Samba Shared Repository - branch master updated

2016-08-05 Thread Jeremy Allison
The branch, master has been updated
   via  1ddd01d s4: repl: Ensure all error paths in 
dreplsrv_op_pull_source_get_changes_trigger() are protected with tevent returns.
   via  8a44659 docs: Bump version up to 4.6.
   via  a320f53 ldb: Fix two signed/unsigned hickups
   via  07d12d2 lib: Fix a pointless error check
   via  5d0cc79 ctdb: Fix uninitialized variable warnings
   via  63b88a7 pyrpc: Fix CID 1364169 Explicit null dereferenced
  from  f6db954 s4: tests: Skip drs tests.

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


- Log -
commit 1ddd01dd21d5db9440dd382190e203c1e756fa3a
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Aug 4 11:09:21 2016 -0700

s4: repl: Ensure all error paths in 
dreplsrv_op_pull_source_get_changes_trigger() are protected with tevent returns.

Otherwise dreplsrv_op_pull_source_get_changes_trigger() could infinitely 
recurse.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Michael Adam <ob...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Aug  6 01:24:05 CEST 2016 on sn-devel-144

commit 8a44659c332a9bc94dc0e99e2c594c1ce9ceceb7
Author: Karolin Seeger <ksee...@samba.org>
Date:   Wed Aug 3 10:04:14 2016 +0200

docs: Bump version up to 4.6.

Signed-off-by: Karolin Seeger <ksee...@samba.org>
Reviewed-by: Ralph Böhme <s...@samba.org>

commit a320f53cb76b64c5b94476f6f0e61815ee095332
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jul 29 14:00:10 2016 +0200

ldb: Fix two signed/unsigned hickups

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 07d12d2c71195f8365c02ab599f4793928f9d9e5
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jul 29 10:54:39 2016 +0200

lib: Fix a pointless error check

According to susv4, addr.s6_addr is a

uint8_t s6_addr[16]

which is always != 0

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Martin Schwenke <mar...@meltin.net>

commit 5d0cc794fd42d9d52ecdf002c5ddfbcb703fab23
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jul 29 10:53:20 2016 +0200

ctdb: Fix uninitialized variable warnings

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Martin Schwenke <mar...@meltin.net>

commit 63b88a7275ae7ea87cf06a808b7030ef6c45eacf
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Jul 20 10:50:14 2016 +0200

pyrpc: Fix CID 1364169 Explicit null dereferenced

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ctdb/tools/ctdb.c | 4 ++--
 docs-xml/manpages/cifsdd.8.xml| 2 +-
 docs-xml/manpages/dbwrap_tool.1.xml   | 2 +-
 docs-xml/manpages/eventlogadm.8.xml   | 2 +-
 docs-xml/manpages/findsmb.1.xml   | 2 +-
 docs-xml/manpages/idmap_ad.8.xml  | 2 +-
 docs-xml/manpages/idmap_autorid.8.xml | 2 +-
 docs-xml/manpages/idmap_hash.8.xml| 2 +-
 docs-xml/manpages/idmap_ldap.8.xml| 2 +-
 docs-xml/manpages/idmap_nss.8.xml | 2 +-
 docs-xml/manpages/idmap_rfc2307.8.xml | 2 +-
 docs-xml/manpages/idmap_rid.8.xml | 2 +-
 docs-xml/manpages/idmap_script.8.xml  | 2 +-
 docs-xml/manpages/idmap_tdb.8.xml | 2 +-
 docs-xml/manpages/idmap_tdb2.8.xml| 2 +-
 docs-xml/manpages/libsmbclient.7.xml  | 2 +-
 docs-xml/manpages/lmhosts.5.xml   | 2 +-
 docs-xml/manpages/log2pcap.1.xml  | 2 +-
 docs-xml/manpages/net.8.xml   | 2 +-
 docs-xml/manpages/nmbd.8.xml  | 2 +-
 docs-xml/manpages/nmblookup.1.xml | 2 +-
 docs-xml/manpages/ntlm_auth.1.xml | 2 +-
 docs-xml/manpages/pam_winbind.8.xml   | 2 +-
 docs-xml/manpages/pam_winbind.conf.5.xml  | 2 +-
 docs-xml/manpages/pdbedit.8.xml   | 2 +-
 docs-xml/manpages/profiles.1.xml  | 2 +-
 docs-xml/manpages/rpcclient.1.xml | 2 +-
 docs-xml/manpages/samba-regedit.8.xml | 2 +-
 docs-xml/manpages/samba-tool.8.xml| 2 +-
 docs-xml/manpages/samba.7.xml | 2 +-
 docs-xml/manpages/samba.8.xml | 2 +-
 docs-xml/manpages/sharesec.1.xml  | 2 +-
 docs-xml/manpages/smb.conf.5.xml  | 2 +-
 docs-xml/manpages/smbcacls.1.xml  | 2 +-
 docs-xml/manpages/smbclient.1.xml | 2 +-
 docs-xml/manpages/smbcontrol.1.xml| 2 +-
 docs-xml/manpages/smbcquotas.1.xml| 2 +-
 docs-xml/manpages/smbd.8.xml  | 2 +-
 do

[SCM] Samba Shared Repository - branch master updated

2016-07-20 Thread Jeremy Allison
The branch, master has been updated
   via  698f651 notifyd: Move BlockSignals calls to server.c
   via  fa96452 smbd: Re-register notify requests
   via  fef0c3d smbd: Restart notifyd
   via  cf7fea2 smbd: Store notify filters in fsp->notify
   via  0136141 smbd: Log which notifyd was found
   via  5371d2b smbd: Remember notifyd's serverid
   via  7404fef notify_msg: Deregister handler upon talloc_free
   via  16a1418 smbd: Remove "listel" from notify_msg
   via  99b9f57 smbd: Protect notify_callback from stray pointers
   via  3caa8a1 smbd: Pass "sconn" via notify to notify_callback()
   via  d446e40 smbd: There's only one notify_callback
   via  2779cae smbd: Make notify_callback() public
   via  60fe61b smbd: "path" is no longer needed in notify_list
   via  229c910 smbd: Add "path" to notify_remove
   via  ed26f4b smbd: Avoid a talloc_asprintf
   via  ea47abc smbd: Add fsp_fullbasepath
   via  2c7bfdc smbd: Factor out notify_init
   via  8e27c19 smbd: sconn->sys_notify_ctx is not used
   via  2bd3451 smbd: Don't stop sending to children when one send fails
  from  99b8aca s3: torture: Regression test case to specify exactly how 
UNIX extensions should act on files with streams.

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


- Log -
commit 698f6517866f567e999baf5b63ec7e6f5e9452a8
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jul 19 14:36:07 2016 +0200

notifyd: Move BlockSignals calls to server.c

notifyd_send() is called as part of smbd initialization both in normal 
daemon
mode after a fork, but also in interactive mode. In interactive mode, 
notifyd
should not modify the global signal state with BlockSignals(). This patch 
moves
the signal blocking to the place where we know that notifyd is a child 
daemon.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jul 20 09:04:00 CEST 2016 on sn-devel-144

commit fa96452f9cde535f3cfe31afe8c54199a940f027
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jun 21 16:23:19 2016 +0200

smbd: Re-register notify requests

When notifyd is restarted, the parent will broadcast that fact to all 
workers.
They will then re-register their notify requests.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fef0c3d271847313f118160e57a853f89985
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jun 24 16:29:28 2016 +0200

smbd: Restart notifyd

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cf7fea2312c159764402f1bcb966f97904fb2132
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jun 24 16:27:34 2016 +0200

smbd: Store notify filters in fsp->notify

When notifyd crashes, it will be restarted. We need to restore the filters 
with
notifyd

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 01361418abd9b33cd0719188a88952566d99ff68
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jun 23 14:24:32 2016 +0200

smbd: Log which notifyd was found

Just a debugging aid

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5371d2b86077a0624e3ee58d4f554d64ce5cfbe9
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jun 21 14:13:06 2016 +0200

smbd: Remember notifyd's serverid

    Similarly to cleanupd, this is necessary to restart notifyd

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7404feffd7130ce389be3a1f65a7ae8c7cc2d156
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jun 21 13:04:25 2016 +0200

notify_msg: Deregister handler upon talloc_free

So far, we haven't TALLOC_FREE'ed the notify context. This will change.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 16a1418f3aa08b1fd5c971481592bfddc250abf0
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jun 14 15:03:35 2016 +0200

smbd: Remove "listel" from notify_msg

We have all information that was kept in "notify_list" in other parts of 
smbd
as well. The only possible downside of this patch is that we possibly have a
lot more fsp's than fsp's with notifies, so notify_callback() might be a bit
slower in this situation. If this turns out to be a problem, I'd rather put
some more smarts into the not

[SCM] Samba Shared Repository - branch master updated

2016-07-15 Thread Jeremy Allison
The branch, master has been updated
   via  fddee66 lib: Fix a signed/unsigned mixup
   via  fb71692 dbwrap: Remove dbwrap_watchers.tdb based code
  from  db020b3 smbd: Remove a reference to dbwrap_watch_db()

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


- Log -
commit fddee66e20cddc81b5078f2ea9163383ab6c10c6
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jul 15 10:55:54 2016 +0200

lib: Fix a signed/unsigned mixup

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Jul 16 00:17:03 CEST 2016 on sn-devel-144

commit fb71692128a8cd7760dfa6dd891ce159c409e966
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jul 15 11:00:36 2016 +0200

dbwrap: Remove dbwrap_watchers.tdb based code

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/dbwrap/dbwrap.c   |  22 --
 lib/dbwrap/dbwrap.h   |   5 -
 lib/dbwrap/dbwrap_private.h   |   3 -
 source3/lib/dbwrap/dbwrap_ctdb.c  |   1 -
 source3/lib/dbwrap/dbwrap_watch.c | 447 --
 source3/lib/dbwrap/dbwrap_watch.h |  21 --
 source3/lib/server_id_db_util.c   |   2 +-
 source3/utils/dbwrap_tool.c   |  38 +---
 8 files changed, 2 insertions(+), 537 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/dbwrap/dbwrap.c b/lib/dbwrap/dbwrap.c
index f7dcb8a..68e5608 100644
--- a/lib/dbwrap/dbwrap.c
+++ b/lib/dbwrap/dbwrap.c
@@ -84,44 +84,22 @@ TDB_DATA dbwrap_record_get_value(const struct db_record 
*rec)
 NTSTATUS dbwrap_record_store(struct db_record *rec, TDB_DATA data, int flags)
 {
NTSTATUS status;
-   struct db_context *db;
 
status = rec->store(rec, data, flags);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
-   db = rec->db;
-   if (db->stored_callback != NULL) {
-   db->stored_callback(db, rec,
-   db->stored_callback_private_data);
-   }
return NT_STATUS_OK;
 }
 
-void dbwrap_set_stored_callback(
-   struct db_context *db,
-   void (*cb)(struct db_context *db, struct db_record *rec,
-  void *private_data),
-   void *private_data)
-{
-   db->stored_callback = cb;
-   db->stored_callback_private_data = private_data;
-}
-
 NTSTATUS dbwrap_record_delete(struct db_record *rec)
 {
NTSTATUS status;
-   struct db_context *db;
 
status = rec->delete_rec(rec);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
-   db = rec->db;
-   if (db->stored_callback != NULL) {
-   db->stored_callback(db, rec,
-   db->stored_callback_private_data);
-   }
return NT_STATUS_OK;
 }
 
diff --git a/lib/dbwrap/dbwrap.h b/lib/dbwrap/dbwrap.h
index 2eded04..6b77236 100644
--- a/lib/dbwrap/dbwrap.h
+++ b/lib/dbwrap/dbwrap.h
@@ -56,11 +56,6 @@ struct db_record *dbwrap_try_fetch_locked(struct db_context 
*db,
  TALLOC_CTX *mem_ctx,
  TDB_DATA key);
 struct db_context *dbwrap_record_get_db(struct db_record *rec);
-void dbwrap_set_stored_callback(
-   struct db_context *db,
-   void (*cb)(struct db_context *db, struct db_record *rec,
-  void *private_data),
-   void *private_data);
 
 NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key);
 NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key,
diff --git a/lib/dbwrap/dbwrap_private.h b/lib/dbwrap/dbwrap_private.h
index 6a52850..15ebbc9 100644
--- a/lib/dbwrap/dbwrap_private.h
+++ b/lib/dbwrap/dbwrap_private.h
@@ -64,9 +64,6 @@ struct db_context {
void *private_data;
enum dbwrap_lock_order lock_order;
bool persistent;
-   void (*stored_callback)(struct db_context *db, struct db_record *rec,
-   void *private_data);
-   void *stored_callback_private_data;
 };
 
 #define DBWRAP_LOCK_ORDER_MIN DBWRAP_LOCK_ORDER_1
diff --git a/source3/lib/dbwrap/dbwrap_ctdb.c b/source3/lib/dbwrap/dbwrap_ctdb.c
index df5a34f..3bbb9be 100644
--- a/source3/lib/dbwrap/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap/dbwrap_ctdb.c
@@ -1737,7 +1737,6 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
result->transaction_commit = db_ctdb_transaction_commit;
result->transaction_cancel = db_ctdb_transaction_cancel;
result->id = db_ctdb_id;
-   result->stored_callback = NULL;
 
DEBUG(3,("db_open_ctdb: opened database '%s' with dbid 0x%x\n",
  

[SCM] Samba Shared Repository - branch master updated

2016-07-14 Thread Jeremy Allison
The branch, master has been updated
   via  a6ee401 build: avoid -Wtautological-compare errors from gcc6+ by 
disabling it globally
   via  a751b97 Revert "lib:dlinklist: avoid -Wtautological-compare errors 
with gcc6"
   via  ff55218 Revert "tevent: avoid -Wtautological-compare errors with 
gcc6"
   via  f061ccc Revert "ldb:dlinklist: avoid -Wtautological-compare errors 
with gcc6"
  from  91a17e5 tdb: Don't malloc for every record in traverse

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


- Log -
commit a6ee40194995617d6f08f050d6b044d80bfab19c
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jul 14 10:01:15 2016 +0200

build: avoid -Wtautological-compare errors from gcc6+ by disabling it 
globally

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jul 15 04:31:27 CEST 2016 on sn-devel-144

commit a751b978a8953206c251f3f46e1b2c53393b6118
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jul 14 09:58:28 2016 +0200

Revert "lib:dlinklist: avoid -Wtautological-compare errors with gcc6"

This reverts commit 5d85fd85467eb1f8941641d5f71d75e7d5c7234c.

Breaks compile for older (<= 4.4) gccs.
Needs to be done differently.

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit ff5521838a474d6ff9489bb92438797db65671a6
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jul 14 09:58:15 2016 +0200

Revert "tevent: avoid -Wtautological-compare errors with gcc6"

This reverts commit 2991f7709973fdcc2c0b83bbe15dda3f1ceae9b3.

Breaks compile for older (<= 4.4) gccs.
    Needs to be done differently.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f061cccd0a806c949142bf74ab5af957e2d3a5cf
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jul 14 09:57:32 2016 +0200

Revert "ldb:dlinklist: avoid -Wtautological-compare errors with gcc6"

This reverts commit 7c9505e651287c5d4747b222af1fda970c562a00.

Breaks compile for older (<= 4.4) gccs.
Needs to be done differently.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py | 1 +
 lib/ldb/include/dlinklist.h   | 8 
 lib/tevent/tevent_util.h  | 8 
 lib/util/dlinklist.h  | 8 
 4 files changed, 1 insertion(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py 
b/buildtools/wafsamba/samba_autoconf.py
index 09ce218..5f35d77 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -725,6 +725,7 @@ int main(void) {
 
 if Options.options.picky_developer:
 conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', '-Werror 
-Wno-error=deprecated-declarations', testflags=True)
+conf.ADD_NAMED_CFLAGS('PICKY_CFLAGS', 
'-Wno-error=tautological-compare', testflags=True)
 
 if Options.options.fatal_errors:
 conf.ADD_CFLAGS('-Wfatal-errors', testflags=True)
diff --git a/lib/ldb/include/dlinklist.h b/lib/ldb/include/dlinklist.h
index ca76794..ef01aec 100644
--- a/lib/ldb/include/dlinklist.h
+++ b/lib/ldb/include/dlinklist.h
@@ -83,9 +83,6 @@ do { \
 */
 #define DLIST_REMOVE(list, p) \
 do { \
-   _Pragma ("GCC diagnostic push") \
-   _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
-   _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((p) == (list)) { \
if ((p)->next) (p)->next->prev = (p)->prev; \
(list) = (p)->next; \
@@ -97,7 +94,6 @@ do { \
if ((p)->next) (p)->next->prev = (p)->prev; \
} \
if ((p) != (list)) (p)->next = (p)->prev = NULL;\
-   _Pragma ("GCC diagnostic pop") \
 } while (0)
 
 /*
@@ -128,11 +124,7 @@ do { \
(p)->next = (el)->next; \
(el)->next = (p);   \
if ((p)->next) (p)->next->prev = (p);   \
-   _Pragma ("GCC diagnostic push") \
-   _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
-   _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((list)->prev == (el)) (list)->prev = (p); \
-   _Pragma ("GCC diagnostic pop") \
   

[SCM] Samba Shared Repository - branch master updated

2016-07-13 Thread Jeremy Allison
The branch, master has been updated
   via  7c9505e ldb:dlinklist: avoid -Wtautological-compare errors with gcc6
   via  2991f77 tevent: avoid -Wtautological-compare errors with gcc6
   via  5d85fd8 lib:dlinklist: avoid -Wtautological-compare errors with gcc6
   via  f6d4380 selftest: Add tunable for smb2.maxfid limit
  from  84992e3 rpc_server: add mssing '#pragma GCC diagnostic push'

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


- Log -
commit 7c9505e651287c5d4747b222af1fda970c562a00
Author: Ira Cooper <i...@samba.org>
Date:   Wed Jul 13 12:37:19 2016 +0200

ldb:dlinklist: avoid -Wtautological-compare errors with gcc6

We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --pick-developer work with gcc6 and newer.

Pair-Programmed-With: Michael Adam <ob...@samba.org>

Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Ira Cooper <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Jul 14 05:44:21 CEST 2016 on sn-devel-144

commit 2991f7709973fdcc2c0b83bbe15dda3f1ceae9b3
Author: Michael Adam <ob...@samba.org>
Date:   Wed Jul 13 12:36:21 2016 +0200

tevent: avoid -Wtautological-compare errors with gcc6

We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --picky-developer work with gcc6 and newer.

Pair-Programmed-With: Ira Cooper <i...@samba.org>

Signed-off-by: Ira Cooper <i...@samba.org>
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5d85fd85467eb1f8941641d5f71d75e7d5c7234c
Author: Ira Cooper <i...@samba.org>
Date:   Wed Jul 13 12:35:13 2016 +0200

lib:dlinklist: avoid -Wtautological-compare errors with gcc6

We expect these macros to generate tautological compares
intentionally, so disabling the warning is just fine.

This lets --picky-developer work with gcc6 and newer.

Pair-Programmed-With: Michael Adam <ob...@samba.org>

Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Ira Cooper <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f6d4380a9d1e6e7323fb943d809893ce9b9dbbb2
Author: Christof Schmitt <c...@samba.org>
Date:   Wed Jul 13 13:09:48 2016 -0700

selftest: Add tunable for smb2.maxfid limit

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/ldb/include/dlinklist.h   |  8 
 lib/tevent/tevent_util.h  |  8 
 lib/util/dlinklist.h  |  8 
 source4/torture/smb2/maxfid.c | 10 --
 4 files changed, 32 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/include/dlinklist.h b/lib/ldb/include/dlinklist.h
index ef01aec..ca76794 100644
--- a/lib/ldb/include/dlinklist.h
+++ b/lib/ldb/include/dlinklist.h
@@ -83,6 +83,9 @@ do { \
 */
 #define DLIST_REMOVE(list, p) \
 do { \
+   _Pragma ("GCC diagnostic push") \
+   _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
+   _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((p) == (list)) { \
if ((p)->next) (p)->next->prev = (p)->prev; \
(list) = (p)->next; \
@@ -94,6 +97,7 @@ do { \
if ((p)->next) (p)->next->prev = (p)->prev; \
} \
if ((p) != (list)) (p)->next = (p)->prev = NULL;\
+   _Pragma ("GCC diagnostic pop") \
 } while (0)
 
 /*
@@ -124,7 +128,11 @@ do { \
(p)->next = (el)->next; \
(el)->next = (p);   \
if ((p)->next) (p)->next->prev = (p);   \
+   _Pragma ("GCC diagnostic push") \
+   _Pragma ("GCC diagnostic ignored \"-Wpragmas\"") \
+   _Pragma ("GCC diagnostic ignored \"-Wtautological-compare\"") \
if ((list)->prev == (el)) (list)->prev = (p); \
+   _Pragma ("GCC diagnostic pop") \
}\
 } while (0)
 
diff --git a/lib/tevent/tevent_util.h b/lib/tevent/tevent_util.h
index e2cdbb8..eb7586f 100644
--- a/lib/tevent/tevent_util.h
+++ b/lib/tevent/tevent_util.h
@@ -79,6 +79,9 @@ do { \
 */
 #define DLIST_REMOVE(list, p) \
 do { \
+   _Pragma ("GCC diagnostic push") \
+   _Pragma ("GCC diagnostic ignore

[SCM] Samba Shared Repository - branch master updated

2016-07-12 Thread Jeremy Allison
The branch, master has been updated
   via  be39b73 dsdb: Fix CID 1363810: Null pointer dereferences
   via  f9db6fb smbtorture: Add smb2.maxfid
   via  f18a920 selftest: Disable full audit logging in selftest
   via  b7d2132 Remove unused stf directory
  from  8a5a904 dsdb: Improve debugging during SD recursion failure

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


- Log -
commit be39b73ccd0f44a53b1b03c47cc0b5687d20eda2
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jul 12 18:28:23 2016 +0200

dsdb: Fix CID 1363810: Null pointer dereferences

The if-condition explicitly tests for new_schema==NULL, so this seems to be 
a
valid error case. The DEBUG statement would segfault in this case.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Ira Cooper <i...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jul 13 06:34:33 CEST 2016 on sn-devel-144

commit f9db6fb893820fbf583b8c57ac151c16a239dd15
Author: Christof Schmitt <c...@samba.org>
Date:   Mon Jul 11 11:32:19 2016 -0700

smbtorture: Add smb2.maxfid

This is the same as base.maxfid, but for the SMB2 protocol: Keep opening
file handles until an error is returned, print the number of file
handles opened and finally close the file handles again.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f18a920b0345768181e604d129d9235c193e89db
Author: Christof Schmitt <c...@samba.org>
Date:   Mon Jul 11 10:49:34 2016 -0700

selftest: Disable full audit logging in selftest

Commit 6eba42f activated the full_audit and time_audit modules for the
simpleserver config to trigger the check that all VFS functions are
implemented in these two modules. This resulted in all operations being
logged to syslog during a test run.

Change the full_audit configuration to keep loading the modules, but not
log anything from full_audit to not slow down the test or spam the logs.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b7d2132180333cccb8c53708bf5e24bc3e105d81
Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
Date:   Fri Jun 3 14:39:21 2016 +1200

Remove unused stf directory

Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andrew Bartlett <abart...@samba.org>

---

Summary of changes:
 selftest/target/Samba3.pm  |   4 +
 source3/stf/README.stf |   3 -
 source3/stf/comfychair.py  | 443 -
 source3/stf/example.py |  36 ---
 source3/stf/notes.txt  | 175 -
 source3/stf/osver.py   |  55 
 source3/stf/pythoncheck.py |  46 
 source3/stf/smbcontrol.py  | 238 --
 source3/stf/spoolss.py | 288 -
 source3/stf/standardcheck.py   |  32 ---
 source3/stf/stf.py | 101 
 source3/stf/test.py|  33 ---
 source4/dsdb/repl/replicated_objects.c |   9 +-
 source4/torture/smb2/maxfid.c  | 145 +++
 source4/torture/smb2/smb2.c|   1 +
 source4/torture/smb2/wscript_build |   2 +-
 16 files changed, 157 insertions(+), 1454 deletions(-)
 delete mode 100644 source3/stf/README.stf
 delete mode 100644 source3/stf/comfychair.py
 delete mode 100755 source3/stf/example.py
 delete mode 100644 source3/stf/notes.txt
 delete mode 100755 source3/stf/osver.py
 delete mode 100755 source3/stf/pythoncheck.py
 delete mode 100755 source3/stf/smbcontrol.py
 delete mode 100755 source3/stf/spoolss.py
 delete mode 100644 source3/stf/standardcheck.py
 delete mode 100755 source3/stf/stf.py
 delete mode 100755 source3/stf/test.py
 create mode 100644 source4/torture/smb2/maxfid.c


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 4e3169d..8a49cdb 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -553,6 +553,10 @@ sub setup_simpleserver($$)
vfs objects = xattr_tdb streams_depot time_audit full_audit
change notify = no
 
+   full_audit:syslog = no
+   full_audit:success = none
+   full_audit:failure = none
+
 [vfs_aio_fork]
path = $prefix_abs/share
 vfs objects = aio_fork
diff --git a/source3/stf/README.stf b/source3/stf/README.stf
deleted file mode 100644
index 3fbd33c..000
--- a/source3/stf/README.stf
+++ /dev/null
@@ -1,3 +0,0 @@
-This directory contains the Samba Testing Framew

[SCM] Samba Shared Repository - branch master updated

2016-07-11 Thread Jeremy Allison
The branch, master has been updated
   via  792f89c Fix typo in python/samba/provision/__init__.py
  from  a1743de libads: ensure the right ccache is used during spnego bind

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


- Log -
commit 792f89cdb67ec53a5148acc79a8e052187c4d622
Author: Rowland Penny <rpe...@samba.org>
Date:   Tue Jul 5 07:49:00 2016 +0100

Fix typo in python/samba/provision/__init__.py

Signed-off-by: Rowland Penny <rpe...@samba.org>
Reviewed-by: Stefan Metzmacher <me...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Jul 12 06:58:47 CEST 2016 on sn-devel-144

---

Summary of changes:
 python/samba/provision/__init__.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/python/samba/provision/__init__.py 
b/python/samba/provision/__init__.py
index d21a22d..344766e 100644
--- a/python/samba/provision/__init__.py
+++ b/python/samba/provision/__init__.py
@@ -121,7 +121,7 @@ from samba.dbchecker import dbcheck
 
 
 DEFAULT_POLICY_GUID = "31B2F340-016D-11D2-945F-00C04FB984F9"
-DEFAULT_DC_POLICY_GUID = "6AC1786C-016F-11D2-945F-00C04fB984F9"
+DEFAULT_DC_POLICY_GUID = "6AC1786C-016F-11D2-945F-00C04FB984F9"
 DEFAULTSITE = "Default-First-Site-Name"
 LAST_PROVISION_USN_ATTRIBUTE = "lastProvisionUSN"
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-07-03 Thread Jeremy Allison
The branch, master has been updated
   via  7700ee8 tdb: avoid many fcntl calls when incrementing seqnum
   via  d820b04 lib: talloc: Add check for destructor protection.
   via  f877191 lib: talloc: As we have a struct talloc_chunk * in 
_talloc_free_children_internal(), use it to call _tc_free_internal() directly.
   via  fde0d0d lib: talloc: As _tc_free_internal() takes a struct 
talloc_chunk *, add an extra paranoia check against destructor overwrite.
   via  d2a5927 lib: talloc: Rename the internals of 
_talloc_free_internal() to _tc_free_internal().
   via  94a7284 lib: talloc: Call talloc_chunk_from_ptr() less often in 
__talloc_with_prefix()
   via  c6d458e lib: talloc: Rename talloc_set_name_v() to tc_set_name_v(). 
Make it take a struct talloc_chunk *tc as the first argument.
   via  192c757 lib: talloc: Add _vasprintf_tc() which returns the struct 
talloc_chunk *, not the talloc'ed pointer.
   via  2bfccbf lib: talloc: Change _talloc_set_name_const() to 
_tc_set_name_const()
   via  5bc592d lib: talloc: Change __talloc() to return a struct 
talloc_chunk *.
   via  58f987d lib: talloc: Change __talloc_with_prefix() to return a 
struct talloc_chunk *.
   via  64244f9 lib: talloc: Rename talloc_XXX() internal functions that 
take a 'struct talloc_chunk *' to tc_XXX().
  from  1444196 testprogs/blackbox: Improve the net ads dns register tests.

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


- Log -
commit 7700ee810b2cf1766849efbfe40be15f2b43c934
Author: Bob Campbell <bobcampb...@catalyst.net.nz>
Date:   Thu Jun 30 09:51:23 2016 +1200

tdb: avoid many fcntl calls when incrementing seqnum

Signed-off-by: Bob Campbell <bobcampb...@catalyst.net.nz>
Signed-off-by: Garming Sam <garm...@catalyst.net.nz>
Pair-programmed-with: Garming Sam <garm...@catalyst.net.nz>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <s...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Jul  3 18:11:30 CEST 2016 on sn-devel-144

commit d820b046ac76705eff9817b76e5830096c28768f
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Jun 29 16:51:26 2016 -0700

lib: talloc: Add check for destructor protection.

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f877191fee61bc066687154044c0af28e356ee27
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Jun 29 16:48:42 2016 -0700

lib: talloc: As we have a struct talloc_chunk * in 
_talloc_free_children_internal(), use it to call _tc_free_internal() directly.

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fde0d0de71d4b670189555745b8155613aace599
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Jun 29 16:44:50 2016 -0700

lib: talloc: As _tc_free_internal() takes a struct talloc_chunk *, add an 
extra paranoia check against destructor overwrite.
    
    Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit d2a5927bd77a94256f7d8ee7098f66c4c0afd25d
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Jun 29 16:41:52 2016 -0700

lib: talloc: Rename the internals of _talloc_free_internal() to 
_tc_free_internal().

Make it use a struct talloc_chunk *tc parameter. Define 
_talloc_free_internal()
in terms of _tc_free_internal().

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 94a72849fa5be82c785f71ab58b8e813c94c51cd
Author: Andrew Bartlett <abart...@samba.org>
Date:   Wed Jun 29 15:46:37 2016 -0700

lib: talloc: Call talloc_chunk_from_ptr() less often in 
__talloc_with_prefix()

Rename 'ptc' pointer to parent as it's re-used as
    that name later in the function.

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit c6d458ef6eca00b6a65ed2fb32b002483154033c
Author: Andrew Bartlett <abart...@samba.org>
Date:   Thu Jun 23 17:17:20 2016 -0700

lib: talloc: Rename talloc_set_name_v() to tc_set_name_v(). Make it take a 
struct talloc_chunk *tc as the first argument.

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 192c75730bac285e8516a49d9cf9c75a03d04e9c
Author: Andrew Bartlett <abart...@samba.org>
Date:   Fri Jun 17 20:49:24 2016 -0700

lib: talloc: Add _vasprintf_tc() which returns the struct talloc_chunk *, 
not the talloc'ed pointer.

Define talloc_vasprintf() in terms of _vasprintf_tc().
We will use _vasprintf_tc() internally later.
  

[SCM] Samba Shared Repository - branch master updated

2016-06-30 Thread Jeremy Allison
The branch, master has been updated
   via  8b7d92b librpc: add decode_netlogon_samlogon_response_packet for 
mailslot debugging.
  from  4406cf7 krb5pac.idl: introduce PAC_DOMAIN_GROUP_MEMBERSHIP to 
handle the resource groups

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


- Log -
commit 8b7d92bb73c5519e70dc62723fb6d3db929d2cdb
Author: Günther Deschner <g...@samba.org>
Date:   Tue Jun 28 18:40:25 2016 +0200

librpc: add decode_netlogon_samlogon_response_packet for mailslot debugging.

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jul  1 01:29:42 CEST 2016 on sn-devel-144

---

Summary of changes:
 librpc/idl/nbt.idl   | 15 +++
 librpc/ndr/ndr_nbt.h | 11 ---
 2 files changed, 15 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/idl/nbt.idl b/librpc/idl/nbt.idl
index ef3f074..211095d 100644
--- a/librpc/idl/nbt.idl
+++ b/librpc/idl/nbt.idl
@@ -482,6 +482,21 @@ interface nbt
uint16   lm20_token;
} NETLOGON_SAM_LOGON_RESPONSE_EX;
 
+   typedef [nopush,nopull] union {
+   [case(NETLOGON_NT_VERSION_1)] NETLOGON_SAM_LOGON_RESPONSE_NT40 
nt4;
+   [case(NETLOGON_NT_VERSION_5)] NETLOGON_SAM_LOGON_RESPONSE nt5;
+   [case(NETLOGON_NT_VERSION_5EX)] NETLOGON_SAM_LOGON_RESPONSE_EX 
nt5_ex;
+   } netlogon_samlogon_response_union;
+
+   typedef [nopush,nopull] struct {
+   uint32 ntver;
+   [switch_is(ntver)] netlogon_samlogon_response_union data;
+   } netlogon_samlogon_response;
+
+   void decode_netlogon_samlogon_response_packet(
+   [in] netlogon_samlogon_response packet
+   );
+
/* query for pdc request */
typedef struct {
astring  computer_name;
diff --git a/librpc/ndr/ndr_nbt.h b/librpc/ndr/ndr_nbt.h
index 870ee43..edb2bf7 100644
--- a/librpc/ndr/ndr_nbt.h
+++ b/librpc/ndr/ndr_nbt.h
@@ -30,17 +30,6 @@
 
 NDR_SCALAR_PROTO(nbt_string, const char *)
 
-struct netlogon_samlogon_response
-{
-   uint32_t ntver;
-   union {
-   struct NETLOGON_SAM_LOGON_RESPONSE_NT40 nt4;
-   struct NETLOGON_SAM_LOGON_RESPONSE nt5;
-   struct NETLOGON_SAM_LOGON_RESPONSE_EX nt5_ex;
-   } data;
-
-};
-
 enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_REQUEST(struct ndr_push *ndr, 
int ndr_flags, const struct NETLOGON_SAM_LOGON_REQUEST *r);
 enum ndr_err_code ndr_pull_NETLOGON_SAM_LOGON_REQUEST(struct ndr_pull *ndr, 
int ndr_flags, struct NETLOGON_SAM_LOGON_REQUEST *r);
 enum ndr_err_code ndr_push_NETLOGON_SAM_LOGON_RESPONSE_EX_with_flags(struct 
ndr_push *ndr, int ndr_flags, const struct NETLOGON_SAM_LOGON_RESPONSE_EX *r);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-29 Thread Jeremy Allison
The branch, master has been updated
   via  4524f59 tsocket: Do not dereference a NULL pointer
   via  1d4b20d s4: ldb: Ignore case of "range" in sscanf as we've already 
checked for its presence.
  from  826f619 s3-winbind: Fix memory leak with each cached credential 
login

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


- Log -
commit 4524f5986c3cc6430fcc2ddae6970a62b3f22ac8
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 15:36:59 2016 +0200

tsocket: Do not dereference a NULL pointer

Make sure the lrbsda pointer is not allocated and we will
not end up dereferencing a NULL pointer. In practice this
can't happen, but this change links the pointer with the
code that uses it.

Found by Coverity.

Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Jun 30 02:53:02 CEST 2016 on sn-devel-144

commit 1d4b20d4f3829eb3778006397990cd9fee4966a5
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Jun 28 15:38:22 2016 -0700

s4: ldb: Ignore case of "range" in sscanf as we've already checked for its 
presence.

https://bugzilla.samba.org/show_bug.cgi?id=11838

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andrew Bartlett <abart...@samba.org>

---

Summary of changes:
 lib/tsocket/tsocket_bsd.c   | 12 
 source4/dsdb/samdb/ldb_modules/ranged_results.c |  8 +---
 2 files changed, 13 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tsocket/tsocket_bsd.c b/lib/tsocket/tsocket_bsd.c
index 9608dde..708d17e 100644
--- a/lib/tsocket/tsocket_bsd.c
+++ b/lib/tsocket/tsocket_bsd.c
@@ -2327,10 +2327,14 @@ static struct tevent_req 
*tstream_bsd_connect_send(TALLOC_CTX *mem_ctx,
goto post;
}
 
-   ret = getsockname(state->fd, >u.sa, >sa_socklen);
-   if (ret == -1) {
-   tevent_req_error(req, errno);
-   goto post;
+   if (lrbsda != NULL) {
+   ret = getsockname(state->fd,
+ >u.sa,
+ >sa_socklen);
+   if (ret == -1) {
+   tevent_req_error(req, errno);
+   goto post;
+   }
}
 
tevent_req_done(req);
diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c 
b/source4/dsdb/samdb/ldb_modules/ranged_results.c
index 60d7503..13bf3a2 100644
--- a/source4/dsdb/samdb/ldb_modules/ranged_results.c
+++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c
@@ -201,6 +201,8 @@ static int rr_search(struct ldb_module *module, struct 
ldb_request *req)
/* Strip the range request from the attribute */
for (i = 0; req->op.search.attrs && req->op.search.attrs[i]; i++) {
char *p;
+   size_t range_len = strlen(";range=");
+
new_attrs = talloc_realloc(req, new_attrs, const char *, i+2);
new_attrs[i] = req->op.search.attrs[i];
new_attrs[i+1] = NULL;
@@ -208,12 +210,12 @@ static int rr_search(struct ldb_module *module, struct 
ldb_request *req)
if (!p) {
continue;
}
-   if (strncasecmp(p, ";range=", strlen(";range=")) != 0) {
+   if (strncasecmp(p, ";range=", range_len) != 0) {
continue;
}
end = (unsigned int)-1;
-   if (sscanf(p, ";range=%u-*", ) != 1) {
-   if (sscanf(p, ";range=%u-%u", , ) != 2) {
+   if (sscanf(p + range_len, "%u-*", ) != 1) {
+   if (sscanf(p + range_len, "%u-%u", , ) != 2) {
ldb_asprintf_errstring(ldb,
"range request error: "
"range request malformed");


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-24 Thread Jeremy Allison
The branch, master has been updated
   via  40258f5 smbd: Fix a valgrind error
  from  600cec4 ctdb-recovery: Terminate if recovery fails without any 
banning credits

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


- Log -
commit 40258f5df1a86d30e265974604cbd77685c18a2a
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Jun 24 07:27:43 2016 +0200

smbd: Fix a valgrind error

"child" has been free'd via "tmp"

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jun 24 14:07:56 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 24acc04..cdcdcc2 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -577,7 +577,7 @@ static void remove_child_pid(struct smbd_parent_context 
*parent,
return;
}
 
-   if (child->pid == procid_to_pid(>cleanupd)) {
+   if (pid == procid_to_pid(>cleanupd)) {
bool ok;
 
DBG_WARNING("Restarting cleanupd\n");


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-22 Thread Jeremy Allison
The branch, master has been updated
   via  a737efe s4-ntlm: Fix a NULL pointer dereference in error path
   via  f01f424 s4-dsdb: Fix a possible NULL pointer dereference
   via  5499cff s3-torture: Do some code hygiene in the ldb test
   via  7bac35e librpc: Check for negative return value of socket_get_fd()
   via  8e88ab7 util: Fix a possible null pointer dereference
  from  c0704d9 s3: libsmb: Correctly trim a trailing \ character in 
cli_smb2_create_fnum_send() when passing a pathname to SMB2 create.

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


- Log -
commit a737efe2bd45fffe82d1815789c63172e01ed1d7
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 15:53:59 2016 +0200

s4-ntlm: Fix a NULL pointer dereference in error path

Found by clang compiler.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jun 22 23:21:33 CEST 2016 on sn-devel-144

commit f01f4248536c6f4b2cfe6f28f775deb7cb2fe01a
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 15:48:10 2016 +0200

s4-dsdb: Fix a possible NULL pointer dereference

Detected by clang compiler.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5499cff2014e64ab9b40f038631a9b8eb847ca03
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 15:15:05 2016 +0200

s3-torture: Do some code hygiene in the ldb test

Coverity is confused if in a expresion we use = and not ==.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7bac35e7fd6d2e580648e0028e114626edf3dc2e
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 09:25:16 2016 +0200

librpc: Check for negative return value of socket_get_fd()

Found by Coverity.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8e88ab727a68eb3979ad1bde65001130c7166d1f
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Jun 22 09:17:07 2016 +0200

util: Fix a possible null pointer dereference

Found by cppcheck.

    Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/util/talloc_report.c  |  3 +++
 source4/auth/ntlm/auth_winbind.c  |  6 --
 source4/dsdb/common/util_trusts.c |  4 +++-
 source4/librpc/rpc/dcerpc_sock.c  |  5 +
 source4/torture/ldb/ldb.c | 12 
 5 files changed, 23 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/talloc_report.c b/lib/util/talloc_report.c
index 9b98347..018d9ab 100644
--- a/lib/util/talloc_report.c
+++ b/lib/util/talloc_report.c
@@ -40,6 +40,9 @@ static char *talloc_vasprintf_append_largebuf(char *buf, 
ssize_t *pstr_len,
if (buf == NULL) {
return NULL;
}
+   if (fmt == NULL) {
+   return NULL;
+   }
buflen = talloc_get_size(buf);
 
if (buflen > str_len) {
diff --git a/source4/auth/ntlm/auth_winbind.c b/source4/auth/ntlm/auth_winbind.c
index aed893d..447c0de 100644
--- a/source4/auth/ntlm/auth_winbind.c
+++ b/source4/auth/ntlm/auth_winbind.c
@@ -216,9 +216,11 @@ static NTSTATUS winbind_check_password_wbclient(struct 
auth_method_context *ctx,
if (err) {
DEBUG(1, ("error was %s (0x%08x)\nerror message was 
'%s'\n",
  err->nt_string, err->nt_status, 
err->display_string));
+   nt_status = NT_STATUS(err->nt_status);
+   wbcFreeMemory(err);
+   } else {
+   nt_status = NT_STATUS_LOGON_FAILURE;
}
-   nt_status = NT_STATUS(err->nt_status);
-   wbcFreeMemory(err);
NT_STATUS_NOT_OK_RETURN(nt_status);
} else if (!WBC_ERROR_IS_OK(wbc_status)) {
DEBUG(1, ("wbcAuthenticateUserEx: failed with %u - %s\n",
diff --git a/source4/dsdb/common/util_trusts.c 
b/source4/dsdb/common/util_trusts.c
index 0e69ba2..a083d86 100644
--- a/source4/dsdb/common/util_trusts.c
+++ b/source4/dsdb/common/util_trusts.c
@@ -2671,7 +2671,9 @@ NTSTATUS dsdb_trust_get_incoming_passwords(struct 
ldb_message *msg,
if (_previous != NULL) {
*_previous = talloc(mem_ctx, struct samr_Password);
if (*_previous == NULL) {
-   TALLOC_FREE(*_current);
+   if (_current 

[SCM] Samba Shared Repository - branch master updated

2016-06-21 Thread Jeremy Allison
The branch, master has been updated
   via  345cfae smbd: Fix a signed/unsigned hickup
  from  6083e62 ctdb-daemon: make bool assignment more obvious

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


- Log -
commit 345cfae91910cfb62649cbf5d44483483167134f
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Jun 21 16:23:38 2016 +0200

smbd: Fix a signed/unsigned hickup

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Jun 21 22:22:03 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/open.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index af1c1de..0c46eb1 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1213,7 +1213,7 @@ static NTSTATUS open_mode_check(connection_struct *conn,
uint32_t access_mask,
uint32_t share_access)
 {
-   int i;
+   uint32_t i;
 
if(lck->data->num_share_modes == 0) {
return NT_STATUS_OK;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-20 Thread Jeremy Allison
The branch, master has been updated
   via  af08cb2 source4/scripting: add an option to samba_dnsupdate to add 
ns records.
  from  7d9a876 ctdb-tests: Update local daemons tests to use 
CTDB_NOSETSCHED

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


- Log -
commit af08cb2eee9dc9fabad6ca62ca11728209297222
Author: Richard Sharpe <rsha...@samba.org>
Date:   Mon May 23 17:37:13 2016 -0700

source4/scripting: add an option to samba_dnsupdate to add ns records.

Add a --add-ns option to samba_dnsupdate and use that, but only when 
--use-file has been specified, to add an NS record to the file produced.

This allows us to make progress in the self tests and is an interim fix.

Signed-off-by: Richard Sharpe <rsha...@samba.org>
Reviewed-by: Rowland Penny <repenny241...@gmail.com>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Jun 21 00:51:02 CEST 2016 on sn-devel-144

---

Summary of changes:
 source4/scripting/bin/samba_dnsupdate | 10 ++
 1 file changed, 10 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source4/scripting/bin/samba_dnsupdate 
b/source4/scripting/bin/samba_dnsupdate
index 16265f6..3880dda 100755
--- a/source4/scripting/bin/samba_dnsupdate
+++ b/source4/scripting/bin/samba_dnsupdate
@@ -69,6 +69,7 @@ parser.add_option("--all-interfaces", action="store_true")
 parser.add_option("--current-ip", action="append", help="IP address to update 
DNS to match (helpful if behind NAT, valid multiple times, defaults to values 
from interfaces=)")
 parser.add_option("--rpc-server-ip", type="string", help="IP address of server 
to use with samba-tool (defaults to first --current-ip)")
 parser.add_option("--use-file", type="string", help="Use a file, rather than 
real DNS calls")
+parser.add_option("--add-ns", action="store_true", help="Add an NS record to 
the DNS file for self-tests. Can only be used with --use-file")
 parser.add_option("--update-list", type="string", help="Add DNS names from the 
given file")
 parser.add_option("--update-cache", type="string", help="Cache database of 
already registered records")
 parser.add_option("--fail-immediately", action='store_true', help="Exit on 
first failure")
@@ -681,6 +682,15 @@ dup_set = set()
 cache_set = set()
 
 rebuild_cache = False
+
+# Add an NS line if asked to ...
+if opts.add_ns:
+if opts.use_file is None:
+print "Option --add-ns can only be used with --use-file"
+sys.exit(1)
+else:
+dns_list.append(parse_dns_line("NS ${DNSDOMAIN} ${HOSTNAME}", 
sub_vars))
+
 try:
 cfile = open(dns_update_cache, 'r+')
 except IOError:


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-18 Thread Jeremy Allison
The branch, master has been updated
   via  3de3f64 s4-kdc: Move KDC packet handling functions to kdc-server.c
   via  3da8932 s4-kdc: Create a kdc-proxy.h header file
   via  379ed08 s4-kdc: Rename proxy-heimdal.c to kdc-proxy.c
   via  dc350a3 s4-kdc: Move KDC socket structs to krb5-server.h
   via  f110662 s4-kdc: Move kdc_process_fn_t declaration to kdc-server.h
   via  13661b6 s4-kdc: Move definitions to kdc-server.h
   via  cafd2d3 s4-kdc: Use better and simpler names for the 
kdc_process_ret enum
   via  0314796 s4-kdc: Put the heimdal kdc config into a private data 
pointer
   via  5ddfe5e s4-kdc: Use smb_krb5_mk_error() in kpasswd implementation
   via  c5a02e8 s4-kdc: Use smb_krb5_mk_error() in kdc implemenation
   via  8a0b058 krb5_wrap: Add smb_krb5_mk_error()
   via  de88bfc s4-kdc: Rename heimdal KDC files
  from  a978113 ctdb-tests: Improve ctdb protocol tests

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


- Log -
commit 3de3f643a870239a7a410a13065a86053992f7fa
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 11:29:20 2016 +0200

s4-kdc: Move KDC packet handling functions to kdc-server.c

Create an Kerberos implmentation independent KDC-SERVER subsystem so we
can use it to implement a kpasswd server with MIT Kerberos in future.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Jun 19 03:31:32 CEST 2016 on sn-devel-144

commit 3da8932e4ce4c289daf7bb102c0e5f54413b568c
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Jun 13 11:20:44 2016 +0200

s4-kdc: Create a kdc-proxy.h header file

This makes the it Kerberos implmentation independent.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 379ed087545c01c6d897e7daaf4861edec32c3bf
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Jun 13 11:19:51 2016 +0200

s4-kdc: Rename proxy-heimdal.c to kdc-proxy.c

The plan is to have a KDC-SERVER subsystem later.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit dc350a349ac8ae484074e0900129d817a017c11f
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 11:23:20 2016 +0200

s4-kdc: Move KDC socket structs to krb5-server.h

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f11066231052190467df8c7d0019c80e61c281b5
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 14:06:10 2016 +0200

s4-kdc: Move kdc_process_fn_t declaration to kdc-server.h

    Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 13661b6fb0806c871d858716394a85c0d3936ca0
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 11:10:50 2016 +0200

s4-kdc: Move definitions to kdc-server.h

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cafd2d365abd42193caa2b666ae443fdc8a9d0a6
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 09:50:45 2016 +0200

s4-kdc: Use better and simpler names for the kdc_process_ret enum

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0314796113db86cb9ee3342e06e8e9e117fdd162
Author: Andreas Schneider <a...@samba.org>
Date:   Fri Jun 10 09:42:33 2016 +0200

s4-kdc: Put the heimdal kdc config into a private data pointer

This allows us to make the struct general useable.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5ddfe5ecd3e941f645619ec200d6e131763e4bb3
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Jun 14 16:31:32 2016 +0200

s4-kdc: Use smb_krb5_mk_error() in kpasswd implementation

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit c5a02e81ea423f02b402ae3d16c61054d8606158
Author: Andreas Schneider <a...@samba.org>
Date:   Tue Jun 14 16:33:34 2016 +0200

s4-kdc: Use smb_krb5_mk_error() in kdc implemenation

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8a0b058ceedf4a568e3e5e272eef356abbe9bd08
Author: Andreas Schneider <a...@samba.org>
Date:   Mon Jun 13 10:52:46 2016 +0200

krb5_wrap: Add smb_krb5_mk_error()

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org&

[SCM] Samba Shared Repository - branch master updated

2016-06-17 Thread Jeremy Allison
The branch, master has been updated
   via  d2ebe2d libnet: only create local private krb5.conf if joining an 
AD domain
   via  9a274d9 winbind: honor 'socket options' in winbind
  from  c3dfeb3 s4: dns: Correctly check for talloc failure.

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


- Log -
commit d2ebe2d17d9606dc1f06bd5206ee09711ae0f3da
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jun 16 00:15:00 2016 +0200

libnet: only create local private krb5.conf if joining an AD domain

This prevents irritating warning messages.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jun 17 08:13:55 CEST 2016 on sn-devel-144

commit 9a274d9ae76ddad9a0b609bddfa007afee61c0ca
Author: Jim McDonough <j...@samba.org>
Date:   Wed Jun 15 15:57:01 2016 -0400

winbind: honor 'socket options' in winbind

Set socket options from smb.conf before negprot, as done by libsmbclient

Signed-off-by: Jim McDonough <j...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/libnet/libnet_join.c   | 8 +---
 source3/winbindd/winbindd_cm.c | 2 ++
 2 files changed, 7 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index abb9cff..0a23e0d 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -2515,9 +2515,11 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 
 #ifdef HAVE_ADS
 
-   create_local_private_krb5_conf_for_domain(
-   r->out.dns_domain_name, r->out.netbios_domain_name,
-   sitename, smbXcli_conn_remote_sockaddr(cli->conn));
+   if (r->out.domain_is_ad) {
+   create_local_private_krb5_conf_for_domain(
+   r->out.dns_domain_name, r->out.netbios_domain_name,
+   sitename, smbXcli_conn_remote_sockaddr(cli->conn));
+   }
 
if (r->out.domain_is_ad &&
!(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) {
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 1de731a..e18f638 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1055,6 +1055,8 @@ static NTSTATUS cm_prepare_connection(struct 
winbindd_domain *domain,
 
cli_set_timeout(*cli, 1); /* 10 seconds */
 
+   set_socket_options(sockfd, lp_socket_options());
+
result = smbXcli_negprot((*cli)->conn, (*cli)->timeout,
 lp_client_ipc_min_protocol(),
 lp_client_ipc_max_protocol());


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-08 Thread Jeremy Allison
The branch, master has been updated
   via  6888c17 build: Address may be used uninitialized in this function 
on Ubuntu 10.04
   via  2a5183f build: Try to work around strict aliasing rules on Ubuntu 
10.04
  from  b7073d4 ctdb-cluster-mutex: Fix #endif decoration

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


- Log -
commit 6888c172d3f2ed471fac626ee9a50bb092367054
Author: Andrew Bartlett <abart...@samba.org>
Date:   Fri Jun 3 09:53:29 2016 +1200

build: Address may be used uninitialized in this function on Ubuntu 10.04

This is not found by modern compilers, but prevents the -Werror -O3 build 
on Ubuntu 10.04

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jun  8 08:48:57 CEST 2016 on sn-devel-144

commit 2a5183f49efc1d407ed36c457d8a953e1363eb42
Author: Andrew Bartlett <abart...@samba.org>
Date:   Fri Jun 3 09:23:12 2016 +1200

build: Try to work around strict aliasing rules on Ubuntu 10.04

We get cc1: warnings being treated as errors
../lib/util/util_net.c: In function get_socket_port:
../lib/util/util_net.c:921: error: dereferencing pointer sa.106 does break 
strict-aliasing rules
../lib/util/util_net.c:921: note: initialized from here
../lib/util/util_net.c:925: error: dereferencing pointer sa.107 does break 
strict-aliasing rules
../lib/util/util_net.c:925: note: initialized from here

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Michael Adam <ob...@samba.org>

---

Summary of changes:
 lib/dbwrap/dbwrap_rbt.c | 3 ++-
 lib/util/util_net.c | 6 --
 2 files changed, 6 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/dbwrap/dbwrap_rbt.c b/lib/dbwrap/dbwrap_rbt.c
index 3b5e589..eb5ef10 100644
--- a/lib/dbwrap/dbwrap_rbt.c
+++ b/lib/dbwrap/dbwrap_rbt.c
@@ -277,7 +277,8 @@ static bool db_rbt_search_internal(struct db_context *db, 
TDB_DATA key,
struct rb_node *n;
bool found = false;
struct db_rbt_node *r = NULL;
-   TDB_DATA search_key, search_val;
+   TDB_DATA search_key = { 0 };
+   TDB_DATA search_val = { 0 };
 
n = ctx->tree.rb_node;
 
diff --git a/lib/util/util_net.c b/lib/util/util_net.c
index e5b33aa..cb238ad 100644
--- a/lib/util/util_net.c
+++ b/lib/util/util_net.c
@@ -918,11 +918,13 @@ int get_socket_port(int fd)
 
 #if defined(HAVE_IPV6)
if (sa.ss_family == AF_INET6) {
-   return ntohs(((struct sockaddr_in6 *))->sin6_port);
+   struct sockaddr_in6 *sa_in6 = (struct sockaddr_in6 *)
+   return ntohs(sa_in6->sin6_port);
}
 #endif
if (sa.ss_family == AF_INET) {
-   return ntohs(((struct sockaddr_in *))->sin_port);
+   struct sockaddr_in *sa_in = (struct sockaddr_in *)
+   return ntohs(sa_in->sin_port);
}
return -1;
 }


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-06-02 Thread Jeremy Allison
The branch, master has been updated
   via  469fdcd Efficient xattr handling for VxFS Signed-off-by: Abhidnya 
Joshi <abhidnya.jo...@veritas.com>
  from  8814b25 lib: replace: snprintf - Fix length calculation for 
hex/octal 64-bit values.

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


- Log -
commit 469fdcd66269f340a05e6a9e4a9de51a1f5d99b2
Author: Abhidnya Joshi <abhidnya.jo...@veritas.com>
Date:   Wed Jun 1 23:38:31 2016 -0700

Efficient xattr handling for VxFS Signed-off-by: Abhidnya Joshi 
<abhidnya.jo...@veritas.com>

Reviewed-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jun  3 07:26:34 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/modules/lib_vxfs.c| 244 ++
 source3/modules/vfs_vxfs.c| 149 +++---
 source3/modules/vfs_vxfs.h|  34 ++
 source3/modules/wscript_build |   2 +-
 4 files changed, 415 insertions(+), 14 deletions(-)
 create mode 100644 source3/modules/lib_vxfs.c
 create mode 100644 source3/modules/vfs_vxfs.h


Changeset truncated at 500 lines:

diff --git a/source3/modules/lib_vxfs.c b/source3/modules/lib_vxfs.c
new file mode 100644
index 000..0d5ea60
--- /dev/null
+++ b/source3/modules/lib_vxfs.c
@@ -0,0 +1,244 @@
+/*
+ Unix SMB/CIFS implementation.
+ Wrap VxFS xattr calls.
+
+ Copyright (C) Veritas Technologies LLC  2016
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "smbd/smbd.h"
+#include "system/filesys.h"
+#include "string.h"
+
+/*
+ * Available under GPL at
+ * http://www.veritas.com/community/downloads/vxfsmisc-library
+ */
+#define LIBVXFS "/usr/lib64/vxfsmisc.so"
+
+
+static int (*vxfs_setxattr_fd_func) (int fd, const char *name,
+const void *value, size_t len, int flags);
+static int (*vxfs_getxattr_fd_func) (int fd, const char *name, void *value,
+size_t *len);
+static int (*vxfs_removexattr_fd_func) (int fd, const char *name);
+static int (*vxfs_listxattr_fd_func) (int fd, void *value, size_t *len);
+
+int vxfs_setxattr_fd(int fd, const char *name, const void *value,
+size_t len, int flags)
+{
+   int ret = -1;
+
+   if (vxfs_setxattr_fd_func == NULL) {
+   errno = ENOSYS;
+   return ret;
+   }
+
+   DEBUG(10, ("Calling vxfs_setxattr_fd\n"));
+   ret = vxfs_setxattr_fd_func(fd, name, value, len, flags);
+   if (ret) {
+   errno = ret;
+   ret = -1;
+   }
+
+   return ret;
+}
+
+int vxfs_setxattr_path(const char *path, const char *name, const void *value,
+  size_t len, int flags, bool is_dir)
+{
+   int ret, fd = -1;
+
+   if (is_dir) {
+   fd = open(path, O_RDONLY|O_DIRECTORY);
+   } else {
+   fd = open(path, O_WRONLY);
+   }
+
+   if (fd == -1) {
+   DEBUG(10, ("error in vxfs_setxattr_path: %s\n",
+ strerror(errno)));
+   return -1;
+   }
+
+   ret = vxfs_setxattr_fd(fd, name, value, len, flags);
+
+   close(fd);
+
+   return ret;
+}
+
+int vxfs_getxattr_fd(int fd, const char *name, void *value, size_t len)
+{
+   int ret;
+   size_t size = len;
+
+   if (vxfs_getxattr_fd_func == NULL) {
+   errno = ENOSYS;
+   return -1;
+   }
+
+   DEBUG(10, ("Calling vxfs_getxattr_fd with %s\n", name));
+   ret = vxfs_getxattr_fd_func(fd, name, value, );
+   if (ret) {
+   errno = ret;
+   if (ret == EFBIG) {
+   errno = ERANGE;
+   }
+   return -1;
+   }
+
+   return size;
+}
+
+int vxfs_getxattr_path(const char *path, const char *name, void *value,
+  size_t len)
+{
+   int ret, fd = -1;
+
+   fd = open(path, O_RDONLY);
+   if (fd == -1) {
+   DEBUG(10, ("file not opened: vxfs_getxattr_path for %s\n&

[SCM] Samba Shared Repository - branch master updated

2016-05-31 Thread Jeremy Allison
The branch, master has been updated
   via  c0b17c3 ctdb:tests: timedout->timed out in 60.nfs.multi.004 test
   via  2fbf194 ctdb:eventscript: timedout->timed out in 
ctdb_event_script_args()
   via  b360c72 ctdb:banning: timedout->timed out in dbg messages in 
ctdb_ban_node_event()
   via  537d5fc ctdb:tcp: add missing spaces in debug message in 
ctdb_tcp_node_connect()
   via  b83a742 dsdb: Simplify acl_validate_spn_value
   via  f722185 s3-dfree-quota: remove special handling of EDQUOT
   via  b79ea7d s3-sysquotas: remove special handling of EDQUOT
   via  8078e5f vfs_fake_dfq - remove support for generating EDQUOT
   via  3d02489 selftest: remove test for EDQUOT returned from quota backend
   via  3b352d3 s3-sysquotas-linux: do not check for EDQUOT
   via  7583377 samba-too: Allow 'samba-tool fsmo' to cope with empty or 
missing fsmo roles
   via  4feffb6 s3/client/clitar.c: NULL-check correct variable
  from  af6bd05 rwrap: Update resolve_wrapper to version 1.1.4

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


- Log -
commit c0b17c39000f601fa0aa9618b38b0991cf6535a2
Author: Michael Adam <ob...@samba.org>
Date:   Wed Jun 1 00:45:00 2016 +0200

ctdb:tests: timedout->timed out in 60.nfs.multi.004 test

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jun  1 04:30:36 CEST 2016 on sn-devel-144

commit 2fbf19449e616d4d2489df3744982537c32c04f9
Author: Michael Adam <ob...@samba.org>
Date:   Wed Jun 1 00:44:21 2016 +0200

ctdb:eventscript: timedout->timed out in ctdb_event_script_args()

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b360c72eafa2df0726f966541668ca93f515271f
Author: Michael Adam <ob...@samba.org>
Date:   Wed Jun 1 00:43:38 2016 +0200

ctdb:banning: timedout->timed out in dbg messages in ctdb_ban_node_event()

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 537d5fc50e692d04863a5995324ce74e71799b43
Author: Michael Adam <ob...@samba.org>
Date:   Thu May 26 13:40:38 2016 +0200

ctdb:tcp: add missing spaces in debug message in ctdb_tcp_node_connect()
    
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b83a742fed21969906bacfb6a98df82c3f49206c
Author: Volker Lendecke <v...@samba.org>
Date:   Fri May 27 10:40:55 2016 +0200

dsdb: Simplify acl_validate_spn_value

Avoid pointless "else" and fix indentation

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f7221857236f5449424cc9cbb1ac92f59fa51bbc
Author: Uri Simchoni <u...@samba.org>
Date:   Fri May 27 22:15:46 2016 +0300

s3-dfree-quota: remove special handling of EDQUOT

It is no longer part of the quota VFS interface to return
an EDQUOT error as an indication that getting quota succeeded
but the user/group is over-quota. A VFS module implementing
quota interface always returns 0 on success.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b79ea7d3fb92ba95b3368604e79dbb26e88a4acf
Author: Uri Simchoni <u...@samba.org>
Date:   Fri May 27 21:51:38 2016 +0300

s3-sysquotas: remove special handling of EDQUOT

The sysquotas module has several supported backends for
getting/setting user/group quota. This patch removes a check
by the common code, to see if the backend has returned EDQUOT.

Before this patch, it was OK for a backend to return with error
and errno set to EDQUOT, and that meant success, but with a warning
that the user/group is over quota. This is the system behavior on
some Unices. This patch removes this from the protocol between the
sysquota module and its backend drivers - it's the responsibility
of the backend to return 0 iff it has fulfilled the request to get or
set quota.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8078e5f15bb23f95faa1c12cb7ddc8a62dcf2661
Author: Uri Simchoni <u...@samba.org>
Date:   Fri May 27 21:42:49 2016 +0300

vfs_fake_dfq - remove support for generating EDQUOT

Remove the option to retrieve valid user/group quota while
returning -1 and EDQUOT errno - this is no longer part of the
protocol between the quota backend and smbd.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3d02489ff19184751d2213d419f85f48c6ad78e3

[SCM] Samba Shared Repository - branch master updated

2016-05-29 Thread Jeremy Allison
The branch, master has been updated
   via  3b5e3ef lib: tevent: Use struct sockaddr_storage to cope with IPv6.
   via  b5f1ce8 s3: lib: ldap: Use struct sockaddr_storage to cope with 
IPv6.
  from  227b35a s3: net: Return an error when no name servers were returned 
by the lookup so that we see an error in self test.

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


- Log -
commit 3b5e3ef9f27487044e7e418a1a83978381b5bfb2
Author: Jeremy Allison <j...@samba.org>
Date:   Fri May 27 11:43:31 2016 -0700

lib: tevent: Use struct sockaddr_storage to cope with IPv6.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun May 29 09:13:30 CEST 2016 on sn-devel-144

commit b5f1ce892a4f8b589aea21b89c2bf93c028fbbe7
Author: Jeremy Allison <j...@samba.org>
Date:   Fri May 27 11:42:58 2016 -0700

s3: lib: ldap: Use struct sockaddr_storage to cope with IPv6.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

---

Summary of changes:
 lib/tevent/echo_server.c | 8 +---
 source3/lib/smbldap.c| 2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tevent/echo_server.c b/lib/tevent/echo_server.c
index 102f7b4..6e7f181 100644
--- a/lib/tevent/echo_server.c
+++ b/lib/tevent/echo_server.c
@@ -66,7 +66,7 @@ struct accept_state {
struct tevent_fd *fde;
int listen_sock;
socklen_t addrlen;
-   struct sockaddr addr;
+   struct sockaddr_storage addr;
int sock;
 };
 
@@ -111,7 +111,9 @@ static void accept_handler(struct tevent_context *ev, 
struct tevent_fd *fde,
}
state->addrlen = sizeof(state->addr);
 
-   ret = accept(state->listen_sock, >addr, >addrlen);
+   ret = accept(state->listen_sock,
+   (struct sockaddr *)>addr,
+   >addrlen);
if (ret == -1) {
tevent_req_error(req, errno);
return;
@@ -133,7 +135,7 @@ static int accept_recv(struct tevent_req *req, struct 
sockaddr *paddr,
return -1;
}
if (paddr != NULL) {
-   *paddr = state->addr;
+   memcpy(paddr, >addr, state->addrlen);
}
if (paddrlen != NULL) {
*paddrlen = state->addrlen;
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 5a876e0..e9cc48b 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -1040,7 +1040,7 @@ static int smbldap_open(struct smbldap_state *ldap_state)
 #ifdef HAVE_UNIXSOCKET
struct sockaddr_un addr;
 #else
-   struct sockaddr addr;
+   struct sockaddr_storage addr;
 #endif
socklen_t len = sizeof(addr);
int sd;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-27 Thread Jeremy Allison
The branch, master has been updated
   via  227b35a s3: net: Return an error when no name servers were returned 
by the lookup so that we see an error in self test.
  from  42151f6 smbd: dfree - ignore quota if not enforced

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


- Log -
commit 227b35ac96c6f78f52f885deb668fabaa40cf9d6
Author: Richard Sharpe <rsha...@samba.org>
Date:   Sun May 15 10:28:04 2016 -0700

s3: net: Return an error when no name servers were returned by the lookup 
so that we see an error in self test.

Signed-off-by: Richard Sharpe <rsha...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat May 28 04:34:20 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/utils/net_ads.c | 3 +++
 1 file changed, 3 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_ads.c b/source3/utils/net_ads.c
index 90af09e..d565df1 100644
--- a/source3/utils/net_ads.c
+++ b/source3/utils/net_ads.c
@@ -1209,6 +1209,9 @@ static NTSTATUS net_update_dns_internal(struct 
net_context *c,
if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) {
DEBUG(3,("net_update_dns_internal: Failed to find name 
server for the %s "
 "realm\n", ads->config.realm));
+   if (ns_count == 0) {
+   status = NT_STATUS_UNSUCCESSFUL;
+   }
goto done;
}
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-27 Thread Jeremy Allison
The branch, master has been updated
   via  42151f6 smbd: dfree - ignore quota if not enforced
   via  de2d624 selftest: add disk-free quota tests
   via  b5ac30e vfs_fake_dfq: add more mocking options
  from  7a725ee Fix memory leak in share mode locking.

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


- Log -
commit 42151f6fa25fefc8a6ae7388ca85379c07c93e1e
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 27 23:22:25 2016 +0300

smbd: dfree - ignore quota if not enforced

When calculating free disk space, do not take user quota
into account if quota is globally not enforced on the file
system.

This is meant to fix a specific problem with XFS. One might
say "why don't you fix the XFS-specific code instead?". The
reason for that is that getting and setting quota must not
be affected by whether quota is actually enforced. NTFS has
the same notion of separating quota accounting (and being
able to configure / retrieve configured quota), from quota
enforcement.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11937

Signed-off-by: Uri Simchoni <u...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat May 28 00:09:05 CEST 2016 on sn-devel-144

commit de2d624d071c338b356824d3b30ab2c9075c8528
Author: Uri Simchoni <u...@samba.org>
Date:   Thu May 26 22:52:09 2016 +0300

selftest: add disk-free quota tests

Add a test for situation where quota accounting is enabled
but quota enforcement is disabled (disk-free should not take
quota into account)

Add a test for situation where overall quota status reporting
(whether or not it's enforcing) is not supported - as with NFS.
In that case it must be assumed that if quota is configured, then
it is also enforced (as with NFS).

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11937

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b5ac30e96ede7a68bc191b983b068b62cbc160ec
Author: Uri Simchoni <u...@samba.org>
Date:   Thu May 26 21:59:38 2016 +0300

vfs_fake_dfq: add more mocking options

Add support for mocking FS user/group quotas (default quota and
quota flags).

Make the default block size 4096 instead of 0. This
turns the default into "no quota" instead of "punt to
lower VFS module" (that is, if the mock module is asked
to retrieve quota of a user/group/default for which there
is no config).

Add support for ENOSYS error

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11937

    Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/modules/vfs_fake_dfq.c   | 15 ++-
 source3/script/tests/test_dfree_quota.sh | 12 
 source3/smbd/quotas.c| 32 +++-
 3 files changed, 57 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_fake_dfq.c b/source3/modules/vfs_fake_dfq.c
index e476e16..bf49860 100644
--- a/source3/modules/vfs_fake_dfq.c
+++ b/source3/modules/vfs_fake_dfq.c
@@ -110,6 +110,12 @@ static int dfq_get_quota(struct vfs_handle_struct *handle, 
const char *path,
section = talloc_asprintf(talloc_tos(), "g%llu",
  (unsigned long long)id.gid);
break;
+   case SMB_USER_FS_QUOTA_TYPE:
+   section = talloc_strdup(talloc_tos(), "udflt");
+   break;
+   case SMB_GROUP_FS_QUOTA_TYPE:
+   section = talloc_strdup(talloc_tos(), "gdflt");
+   break;
default:
break;
}
@@ -118,7 +124,7 @@ static int dfq_get_quota(struct vfs_handle_struct *handle, 
const char *path,
goto dflt;
}
 
-   bsize = dfq_load_param(snum, rpath, section, "block size", 0);
+   bsize = dfq_load_param(snum, rpath, section, "block size", 4096);
if (bsize == 0) {
goto dflt;
}
@@ -129,6 +135,12 @@ static int dfq_get_quota(struct vfs_handle_struct *handle, 
const char *path,
goto out;
}
 
+   if (dfq_load_param(snum, rpath, section, "nosys", 0) != 0) {
+   errno = ENOSYS;
+   rc = -1;
+   goto out;
+   }
+
ZERO_STRUCTP(qt);
 
qt->bsize = bsize;
@@ -140,6 +152,7 @@ static int dfq_get_quota(struct vfs_handle_struct *handle, 
const char *path,
qt->isoftlimit =
  

[SCM] Samba Shared Repository - branch master updated

2016-05-25 Thread Jeremy Allison
The branch, master has been updated
   via  bc3fcb2 s3: docs: Add documentation for posix_whoami command in 
smbclient.
   via  17045c3 s3: smbclient: Add posix_whoami command.
   via  46695fa s3: libsmb: Add sync and async cli_posix_whoami().
  from  92b4b6b s3-smbd: Support systemd 230

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


- Log -
commit bc3fcb23fae3cf0daaab0bcbfde346931ef178bd
Author: Jeremy Allison <j...@samba.org>
Date:   Wed May 25 09:17:40 2016 -0700

s3: docs: Add documentation for posix_whoami command in smbclient.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May 26 02:43:55 CEST 2016 on sn-devel-144

commit 17045c315a3d66992049556c3c51eabb0e557088
Author: Jeremy Allison <j...@samba.org>
Date:   Wed May 25 09:15:13 2016 -0700

s3: smbclient: Add posix_whoami command.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 46695fa2c8116d9ea52186b95587dbee9b1e103d
Author: Jeremy Allison <j...@samba.org>
Date:   Tue May 24 16:58:11 2016 -0700

s3: libsmb: Add sync and async cli_posix_whoami().

Will add as a command to smbclient, plus will be useful for testing.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

---

Summary of changes:
 docs-xml/manpages/smbclient.1.xml |   8 ++
 source3/client/client.c   |  46 +++
 source3/libsmb/clifsinfo.c| 260 ++
 source3/libsmb/proto.h|  21 +++
 4 files changed, 335 insertions(+)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/smbclient.1.xml 
b/docs-xml/manpages/smbclient.1.xml
index faf1ca1..6b5468a 100644
--- a/docs-xml/manpages/smbclient.1.xml
+++ b/docs-xml/manpages/smbclient.1.xml
@@ -924,6 +924,14 @@

 

+   posix_whoami
+   Query the remote server for the user token 
using the CIFS UNIX
+   extensions WHOAMI call. Prints out the guest status, user, 
group, group list and
+   sid list that the remote server is using on behalf of the 
logged on user.
+   
+   
+
+   
print file name
Print the specified file from the local machine
through a printable service on the server. 
diff --git a/source3/client/client.c b/source3/client/client.c
index 831b9bc..45dc11c 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -2956,6 +2956,50 @@ static int cmd_unlock(void)
return 0;
 }
 
+static int cmd_posix_whoami(void)
+{
+   TALLOC_CTX *ctx = talloc_tos();
+   NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+   uint64_t uid = 0;
+   uint64_t gid = 0;
+   uint32_t num_gids = 0;
+   uint32_t num_sids = 0;
+   uint64_t *gids = NULL;
+   struct dom_sid *sids = NULL;
+   bool guest = false;
+   uint32_t i;
+
+   status = cli_posix_whoami(cli,
+   ctx,
+   ,
+   ,
+   _gids,
+   ,
+   _sids,
+   ,
+   );
+
+   if (!NT_STATUS_IS_OK(status)) {
+   d_printf("posix_whoami failed with error %s\n", 
nt_errstr(status));
+   return 1;
+   }
+
+   d_printf("GUEST:%s\n", guest ? "True" : "False");
+   d_printf("UID:%" PRIu64 "\n", uid);
+   d_printf("GID:%" PRIu64 "\n", gid);
+   d_printf("NUM_GIDS:%" PRIu32 "\n", num_gids);
+   for (i = 0; i < num_gids; i++) {
+   d_printf("GIDS[%" PRIu32 "]:%" PRIu64 "\n", i, gids[i]);
+   }
+   d_printf("NUM_SIDS:%" PRIu32 "\n", num_sids);
+   for (i = 0; i < num_sids; i++) {
+   char *sid_str = dom_sid_string(ctx, [i]);
+   d_printf("SIDS[%" PRIu32 "]:%s\n", i, sid_str);
+   TALLOC_FREE(sid_str);
+   }
+   return 0;
+}
+
 
 /
  Remove a directory.
@@ -4931,6 +4975,8 @@ static struct {
   {"posix_mkdir",cmd_posix_mkdir," 0 creates a directory using 
POSIX interface",{COMPL_REMOTE,COMPL_NONE}},
   {"posix_rmdir",cmd_posix_rmdir," removes a directory using POSIX 
interface",{COMPL_REMOTE,COMPL_NONE}},
   {"posix_unlink",cmd_posix_unlink," removes a file usin

[SCM] Samba Shared Repository - branch master updated

2016-05-23 Thread Jeremy Allison
The branch, master has been updated
   via  b2b951d heimdal make kvno unisgned internally
   via  5913329 s3-quotas: fix sysquotas_4B quota fetching for BSD
  from  2eb824f s3:rpcclient: make use of SMB_SIGNING_IPC_DEFAULT

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


- Log -
commit b2b951d14fa9464cf2333e611e5b651e1d57cf01
Author: Uri Simchoni <u...@samba.org>
Date:   Tue May 17 13:45:11 2016 +0300

heimdal make kvno unisgned internally

The folks at heimdal didn't like the patch in
commit 6379737b7ddc6ccb752238c5820cc62e76a8da17 and insisted
that kvno should remain unsigned internally, even though it is
encoded as signed in packets. This patch reverts some of the
unsigned->signed changes in that commit, and resolves conversion
issues - in order to be aligned with upstream Heimdal.

Signed-off-by: Uri Simchoni <u...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue May 24 03:00:39 CEST 2016 on sn-devel-144

commit 59133295bbfd3b51953d9c86e3b533ff1d4861e3
Author: Uri Simchoni <u...@samba.org>
Date:   Sat May 21 22:25:32 2016 +0300

s3-quotas: fix sysquotas_4B quota fetching for BSD

Correctly copy block hard/soft limits from the OS-specific structure
to samba structure.

BUG:https://bugzilla.samba.org/show_bug.cgi?id=11931

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/lib/sysquotas_4B.c|  6 ++
 source4/heimdal/kdc/krb5tgs.c | 17 +++--
 source4/heimdal/kdc/misc.c|  2 +-
 source4/torture/rpc/lsa.c |  2 +-
 4 files changed, 23 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/sysquotas_4B.c b/source3/lib/sysquotas_4B.c
index e3adc35..ee56432 100644
--- a/source3/lib/sysquotas_4B.c
+++ b/source3/lib/sysquotas_4B.c
@@ -81,6 +81,12 @@ static void xlate_qblk_to_smb(const struct dqblk * const 
qblk,
dp->hardlimit = XLATE_TO_BLOCKS(qblk->dqb_bhardlimit);
dp->curblocks = XLATE_TO_BLOCKS(qblk->dqb_curbytes);
 #undef XLATE_TO_BLOCKS
+#else
+   dp->bsize = DEV_BSIZE;
+
+   dp->softlimit = qblk->dqb_bsoftlimit;
+   dp->hardlimit = qblk->dqb_bhardlimit;
+   dp->curblocks = qblk->dqb_curblocks;
 #endif
 
dp->ihardlimit = qblk->dqb_ihardlimit;
diff --git a/source4/heimdal/kdc/krb5tgs.c b/source4/heimdal/kdc/krb5tgs.c
index 1d0d1dd..c221c90 100644
--- a/source4/heimdal/kdc/krb5tgs.c
+++ b/source4/heimdal/kdc/krb5tgs.c
@@ -1174,6 +1174,8 @@ tgs_parse_request(krb5_context context,
 Key *tkey;
 krb5_keyblock *subkey = NULL;
 unsigned usage;
+krb5uint32 kvno = 0;
+krb5uint32 *kvno_ptr = NULL;
 
 *auth_data = NULL;
 *csec  = NULL;
@@ -1201,7 +1203,12 @@ tgs_parse_request(krb5_context context,
   ap_req.ticket.sname,
   ap_req.ticket.realm);
 
-ret = _kdc_db_fetch(context, config, princ, HDB_F_GET_KRBTGT, 
ap_req.ticket.enc_part.kvno, NULL, krbtgt);
+if (ap_req.ticket.enc_part.kvno) {
+   kvno = *ap_req.ticket.enc_part.kvno;
+   kvno_ptr = 
+}
+ret = _kdc_db_fetch(context, config, princ, HDB_F_GET_KRBTGT, kvno_ptr,
+   NULL, krbtgt);
 
 if(ret == HDB_ERR_NOT_FOUND_HERE) {
char *p;
@@ -1541,6 +1548,8 @@ tgs_build_reply(krb5_context context,
hdb_entry_ex *uu;
krb5_principal p;
Key *uukey;
+   krb5uint32 second_kvno = 0;
+   krb5uint32 *kvno_ptr = NULL;
 
if(b->additional_tickets == NULL ||
   b->additional_tickets->len == 0){
@@ -1557,8 +1566,12 @@ tgs_build_reply(krb5_context context,
goto out;
}
_krb5_principalname2krb5_principal(context, , t->sname, t->realm);
+   if(t->enc_part.kvno){
+   second_kvno = *t->enc_part.kvno;
+   kvno_ptr = _kvno;
+   }
ret = _kdc_db_fetch(context, config, p,
-   HDB_F_GET_KRBTGT, t->enc_part.kvno,
+   HDB_F_GET_KRBTGT, kvno_ptr,
NULL, );
krb5_free_principal(context, p);
if(ret){
diff --git a/source4/heimdal/kdc/misc.c b/source4/heimdal/kdc/misc.c
index 6fd5119..b0bc38a 100644
--- a/source4/heimdal/kdc/misc.c
+++ b/source4/heimdal/kdc/misc.c
@@ -40,7 +40,7 @@ _kdc_db_fetch(krb5_context context,
  krb5_kdc_configuration *config,
  krb5_const_principal principal,
  unsigned flags,
- krb5int32 *kvno_ptr,
+ krb5uint32 *kvno_ptr,
  HDB **db,
   

[SCM] Samba Shared Repository - branch master updated

2016-05-20 Thread Jeremy Allison
The branch, master has been updated
   via  2eb824f s3:rpcclient: make use of SMB_SIGNING_IPC_DEFAULT
   via  f4b5e9d Revert "s3:rpcclient add -m option"
   via  7d0def3 s3: wscript: Add checks for open file description locks.
   via  e39436e s3: VFS: Map process-associated lock operation to open file 
description lock operation.
   via  5985383 s3: lib: util: Add map_process_lock_to_ofd_lock() utility 
function.
   via  da9b705 s3: VFS: Add bool use_ofd_locks member to struct 
files_struct.
   via  bb93b24 s3: lib: Add 'int op' parameter to fcntl_getlock().
   via  1863e6d s3: torture: Add POSIX-OFD-LOCK test.
   via  66b8ee1 s3: locking: Convert on the wire behavior of POSIX (UNIX 
extensions) locks from process-associated locks to open file description locks.
   via  a3cb0a4 s3: locking: Add a const struct lock_context * paramter to 
set_posix_lock_posix_flavour()
   via  a3df904 s3: locking: Add some const.
   via  4146fb9 s3: locking: Rename xxx_windows_lock_ref_count to 
xxx_lock_ref_count.
  from  02c2958 ctdb-scripts: Drop unnecessary detect_init_style() call

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


- Log -
commit 2eb824fbaf61dfc5e9c735589c80c41379dabe86
Author: Stefan Metzmacher <me...@samba.org>
Date:   Thu May 19 11:47:18 2016 +0200

s3:rpcclient: make use of SMB_SIGNING_IPC_DEFAULT

This means we'll use the "client ipc min protocol", "client ipc max 
protocol"
and "client ipc signing" options. But "--signing=no" or "--signing=required"
still overwrite "client ipc signing".

The following can be used to alter the max protocol

rpcclient --option="client ipc max protocol=SMB2_10" 172.31.9.163 
-Uadministrator%A1b2C3d4 -c "getusername"
Account Name: Administrator, Authority Name: W4EDOM-L4

rpcclient --option="client ipc max protocol=NT1" 172.31.9.163 
-Uadministrator%A1b2C3d4 -c "getusername"
Account Name: Administrator, Authority Name: W4EDOM-L4

rpcclient 172.31.9.163 -Uadministrator%A1b2C3d4 -c "getusername"
Account Name: Administrator, Authority Name: W4EDOM-L4

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11927

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat May 21 05:01:15 CEST 2016 on sn-devel-144

commit f4b5e9d44d32a26d47fa8e465047be4355d4c30f
Author: Stefan Metzmacher <me...@samba.org>
Date:   Thu May 19 11:47:29 2016 +0200

Revert "s3:rpcclient add -m option"

This reverts commit a55ac51f5f67c61bda1fee7067ad7d09a0c1efdf.

This will be implemented in a more common way using the
"client ipc max protocol" option.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11927
    
Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7d0def3056925118f3f47ff721939c0f5a42db57
Author: Jeremy Allison <j...@samba.org>
Date:   Thu May 12 21:46:50 2016 +0200

s3: wscript: Add checks for open file description locks.

Compiles and runs code that checks for working
F_OFD_GETLK, F_OFD_SETLK, F_OFD_SETLKW.

We now use these if available.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Jeff Layton <jlay...@samba.org>

commit e39436e770b5f6fe9e6615bc70bda627a3a1bd58
Author: Jeremy Allison <j...@samba.org>
Date:   Thu May 12 21:17:21 2016 +0200

s3: VFS: Map process-associated lock operation to open file description 
lock operation.

Only in the default VFS. Gpfs, Ceph, Gluster and other modern
backend VFS filesystems might want to do the same.

Allow tuneable "smbd:force process locks = true" to turn
off OFD locks if in use and the kernel doesn't support them.

Display debug message showing admins what to do in this case.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Jeff Layton <jlay...@samba.org>

commit 598538316786188f2d91c6e2c343c8051e27fd68
Author: Jeremy Allison <j...@samba.org>
Date:   Thu May 12 21:14:28 2016 +0200

s3: lib: util: Add map_process_lock_to_ofd_lock() utility function.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Jeff Layton <jlay...@samba.org>

commit da9b7056fcd6f68795db3a28564fca8bd8eb8605
Author: Jeremy Allison <j...@samba.org>
Date:   Thu May 12 21:03:57 2016 +0200

s3: VFS: Add bool use_ofd_locks member to struct files_struct.

Not yet used. We will set this if we translate a process-associated
lock operation to a open file de

[SCM] Samba Shared Repository - branch master updated

2016-05-19 Thread Jeremy Allison
The branch, master has been updated
   via  249012f vfs_fruit: Fix a few signed/unsigned mixups
   via  3c0d86e vfs_fileid: Fix a signed/unsigned mixup
  from  3aefd27 python:samba: move netcmd/time.py to 
python/samba/netcmd/nettime.py

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


- Log -
commit 249012f3e479b6a6e96b7eda189e68ab0db3d546
Author: Volker Lendecke <v...@samba.org>
Date:   Thu May 19 18:42:04 2016 +0200

vfs_fruit: Fix a few signed/unsigned mixups

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May 19 23:53:47 CEST 2016 on sn-devel-144

commit 3c0d86e68db0b1aafffcaaf4f6d74d65e4f41806
Author: Volker Lendecke <v...@samba.org>
Date:   Thu May 19 14:55:10 2016 +0200

vfs_fileid: Fix a signed/unsigned mixup

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/modules/vfs_fileid.c |  2 +-
 source3/modules/vfs_fruit.c  | 14 --
 2 files changed, 9 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_fileid.c b/source3/modules/vfs_fileid.c
index 25048e7..f274059 100644
--- a/source3/modules/vfs_fileid.c
+++ b/source3/modules/vfs_fileid.c
@@ -100,7 +100,7 @@ nomem:
 static struct fileid_mount_entry *fileid_find_mount_entry(struct 
fileid_handle_data *data,
  SMB_DEV_T dev)
 {
-   int i;
+   unsigned i;
 
if (data->num_mount_entries == 0) {
fileid_load_mount_entries(data);
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 84c40bd..6d4389f 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -576,10 +576,11 @@ static bool ad_pack(struct adouble *ad)
 /**
  * Unpack an AppleDouble blob into a struct adoble
  **/
-static bool ad_unpack(struct adouble *ad, const int nentries, size_t filesize)
+static bool ad_unpack(struct adouble *ad, const size_t nentries,
+ size_t filesize)
 {
size_t bufsize = talloc_get_size(ad->ad_data);
-   int adentries, i;
+   size_t adentries, i;
uint32_t eid, len, off;
 
/*
@@ -603,7 +604,8 @@ static bool ad_unpack(struct adouble *ad, const int 
nentries, size_t filesize)
 
adentries = RSVAL(ad->ad_data, ADEDOFF_NENTRIES);
if (adentries != nentries) {
-   DEBUG(1, ("invalid number of entries: %d\n", adentries));
+   DEBUG(1, ("invalid number of entries: %zu\n",
+ adentries));
return false;
}
 
@@ -1533,7 +1535,7 @@ static bool del_fruit_stream(TALLOC_CTX *mem_ctx, 
unsigned int *num_streams,
 const char *name)
 {
struct stream_struct *tmp = *streams;
-   int i;
+   unsigned int i;
 
if (*num_streams == 0) {
return true;
@@ -2015,7 +2017,7 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
 mode_t *pmode,
 bool *pdo_chmod)
 {
-   int i;
+   uint32_t i;
struct fruit_config_data *config = NULL;
 
*pdo_chmod = false;
@@ -3770,7 +3772,7 @@ static void fruit_copy_chunk_done(struct tevent_req 
*subreq)
NTSTATUS status;
unsigned int num_streams = 0;
struct stream_struct *streams = NULL;
-   int i;
+   unsigned int i;
struct smb_filename *src_fname_tmp = NULL;
struct smb_filename *dst_fname_tmp = NULL;
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-16 Thread Jeremy Allison
The branch, master has been updated
   via  c42c0c0 torture: Remove a use of get_my_vnn()
   via  c4504bd lib: Fix some whitespace
   via  8c332f4 lib: Fix a signed/unsigned mixup
   via  7d0fe14 ctdb: Fix the O3 developer build
   via  2600f82 ctdb: Improve debug in case of set_runstate failure
   via  a5d49b7 smbd: Fix an assert
  from  ecbe6c6 ctdb-scripts: Add GlusterFS support to nfs-ganesha-callout

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


- Log -
commit c42c0c071f3ac6067ff9c53fade2e900342d56ae
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Oct 14 11:52:24 2015 +0200

torture: Remove a use of get_my_vnn()

Reduce the use of globals

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Mon May 16 23:23:53 CEST 2016 on sn-devel-144

commit c4504bd7e344773f5d1b8cb16c398e43de3d2390
Author: Volker Lendecke <v...@samba.org>
Date:   Sun May 1 17:30:11 2016 +0200

lib: Fix some whitespace

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8c332f46e4efc93e2b3aa810eff6b4e5778bb156
Author: Volker Lendecke <v...@samba.org>
Date:   Sun May 1 17:28:56 2016 +0200

lib: Fix a signed/unsigned mixup

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7d0fe145e23c3f58ef311d6749dc0ea0285fe890
Author: Volker Lendecke <v...@samba.org>
Date:   Mon May 16 16:42:18 2016 +0200

ctdb: Fix the O3 developer build

    Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 2600f823deb795c45ca484d0e6808c5af7ab9548
Author: Volker Lendecke <v...@samba.org>
Date:   Sun Apr 24 16:07:43 2016 +0200

ctdb: Improve debug in case of set_runstate failure

If this fails, we want to know which states it wanted to move to. Don't do 
the
return before the debug.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a5d49b7ce1cfbf8491bc3d29c1ae5b0960b5fe01
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Apr 20 13:13:38 2016 +0200

smbd: Fix an assert

This might stumble over stale entries

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11844
Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ctdb/common/ctdb_util.c  |  5 +++--
 ctdb/tests/src/fake_ctdbd.c  |  6 --
 lib/crypto/arcfour.c | 27 ++-
 source3/smbd/oplock.c|  1 +
 source3/torture/msg_source.c |  5 +++--
 5 files changed, 25 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/ctdb_util.c b/ctdb/common/ctdb_util.c
index 39108bc..154878b 100644
--- a/ctdb/common/ctdb_util.c
+++ b/ctdb/common/ctdb_util.c
@@ -642,12 +642,13 @@ enum ctdb_runstate runstate_from_string(const char *label)
 
 void ctdb_set_runstate(struct ctdb_context *ctdb, enum ctdb_runstate runstate)
 {
+   DEBUG(DEBUG_NOTICE,("Set runstate to %s (%d)\n",
+   runstate_to_string(runstate), runstate));
+
if (runstate <= ctdb->runstate) {
ctdb_fatal(ctdb, "runstate must always increase");
}
 
-   DEBUG(DEBUG_NOTICE,("Set runstate to %s (%d)\n",
-   runstate_to_string(runstate), runstate));
ctdb->runstate = runstate;
 }
 
diff --git a/ctdb/tests/src/fake_ctdbd.c b/ctdb/tests/src/fake_ctdbd.c
index e198a5d..0d08313 100644
--- a/ctdb/tests/src/fake_ctdbd.c
+++ b/ctdb/tests/src/fake_ctdbd.c
@@ -2025,7 +2025,8 @@ static void server_new_client(struct tevent_req *subreq)
struct server_state *state = tevent_req_data(
req, struct server_state);
struct ctdbd_context *ctdb = state->ctdb;
-   int client_fd, ret;
+   int client_fd;
+   int ret = 0;
 
client_fd = accept_recv(subreq, );
TALLOC_FREE(subreq);
@@ -2057,7 +2058,8 @@ static void server_client_done(struct tevent_req *subreq)
struct server_state *state = tevent_req_data(
req, struct server_state);
struct ctdbd_context *ctdb = state->ctdb;
-   int ret, status;
+   int ret = 0;
+   int status;
 
status = client_recv(subreq, );
TALLOC_FREE(subreq);
diff --git a/lib/crypto/arcfour.c b/lib/crypto/arcfour.c
index d310649..af9b20c 100644
--- a/lib/crypto/arcfour.c
+++ b/lib/crypto/arcfour.c
@@ -1,20 +1,20 @@
-/* 
+/*
Unix SMB/C

[SCM] Samba Shared Repository - branch master updated

2016-05-12 Thread Jeremy Allison
The branch, master has been updated
   via  a55ac51 s3:rpcclient add -m option
   via  d0cdf02 s3:selftest add a test for rpcclient --pw-nt-hash option
   via  4fe5987 s3:rpcclient make --pw-nt-hash option work
  from  86dbdce s3:rpc_server/samr: simplify the logic in get_user_info_18()

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


- Log -
commit a55ac51f5f67c61bda1fee7067ad7d09a0c1efdf
Author: Christian Ambach <a...@samba.org>
Date:   Wed May 11 18:54:58 2016 +0200

s3:rpcclient add -m option

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May 12 17:36:09 CEST 2016 on sn-devel-144

commit d0cdf02dc9733dae960021ff1ca07587d8155e58
Author: Christian Ambach <a...@samba.org>
Date:   Wed May 11 19:21:20 2016 +0200

s3:selftest add a test for rpcclient --pw-nt-hash option

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4fe59879cc2a608194578e33e27e0dc1e2f0fc58
Author: Christian Ambach <a...@samba.org>
Date:   Wed May 11 17:41:24 2016 +0200

s3:rpcclient make --pw-nt-hash option work

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10796

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 docs-xml/manpages/rpcclient.1.xml | 14 
 source3/rpcclient/rpcclient.c |  8 +++
 source3/script/tests/test_rpcclient_pw_nt_hash.sh | 27 +++
 source3/selftest/tests.py |  5 +
 4 files changed, 54 insertions(+)
 create mode 100755 source3/script/tests/test_rpcclient_pw_nt_hash.sh


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/rpcclient.1.xml 
b/docs-xml/manpages/rpcclient.1.xml
index fcdd0c6..2ce1443 100644
--- a/docs-xml/manpages/rpcclient.1.xml
+++ b/docs-xml/manpages/rpcclient.1.xml
@@ -24,6 +24,7 @@
-c command string
-d debuglevel
-l logdir
+   -m maxprotocol
-N
-s smb config file
-U username[%password]
@@ -86,6 +87,19 @@

 

+   -m|--max-protocol protocol
+   This allows the user to select the
+   highest SMB protocol level that rpcclient will use to
+   connect to the server. By default this is set to
+   NT1, which is the highest available SMB1 protocol.
+   To connect using SMB2 or SMB3 protocol, use the
+   strings SMB2 or SMB3 respectively. Note that to connect
+   to a Windows 2012 server with encrypted transport selecting
+   a max-protocol of SMB3 is required.
+   
+   
+
+   
-p|--port port
This number is the TCP port number that will be 
used
when making connections to the server. The standard (well-known)
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index c32fbc7..44d691b 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -913,6 +913,7 @@ out_free:
{"command", 'c', POPT_ARG_STRING,   , 'c', "Execute 
semicolon separated cmds", "COMMANDS"},
{"dest-ip", 'I', POPT_ARG_STRING,   _ipaddr, 'I', "Specify 
destination IP address", "IP"},
{"port", 'p', POPT_ARG_INT,   _port, 'p', "Specify port 
number", "PORT"},
+   {"max-protocol", 'm', POPT_ARG_STRING, NULL, 'm', "Set the max 
protocol level", "LEVEL" },
POPT_COMMON_SAMBA
POPT_COMMON_CONNECTION
POPT_COMMON_CREDENTIALS
@@ -949,6 +950,10 @@ out_free:
while((opt = poptGetNextOpt(pc)) != -1) {
switch (opt) {
 
+   case 'm':
+   lp_set_cmdline("client max protocol", 
poptGetOptArg(pc));
+   break;
+
case 'I':
if (!interpret_string_addr(_ss,
opt_ipaddr,
@@ -1084,6 +1089,9 @@ out_free:
if (get_cmdline_auth_info_use_ccache(rpcclient_auth_info)) {
flags |= CLI_FULL_CONNECTION_USE_CCACHE;
}
+   if (get_cmdline_auth_info_use_pw_nt_hash(rpcclient_auth_info)) {
+   flags |= CLI_FULL_CONNECTION_USE_NT_HASH;
+   }
 
user = talloc_strdup(frame, 
get_cmdline_auth_info_username(rpcclient

[SCM] Samba Shared Repository - branch master updated

2016-05-11 Thread Jeremy Allison
The branch, master has been updated
   via  7efbe11 s3:libsmb/clifile use correct value for MaxParameterCount 
for setting EAs
  from  15f191a ldb-samba: Add "secret" as a value to hide in LDIF files

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


- Log -
commit 7efbe1139796bb708176cd8dddb206a0f271ec1b
Author: Christian Ambach <a...@samba.org>
Date:   Tue May 10 19:47:02 2016 +0200

s3:libsmb/clifile use correct value for MaxParameterCount for setting EAs

Windows servers will refuse trans2 requests which use excessive
request parameters. From [MS-CIFS|:
<239> Section 3.3.5.2.5: Windows NT servers fail a transaction request with
STATUS_INSUFF_SERVER_RESOURCES, if (SetupCount + MaxSetupCount +
TotalParameterCount + MaxParameterCount + TotalDataCount + MaxDataCount)
is greater than 65*1024.

When attempting to set a large list of EAs for a file, this limit can be
hit when using CLI_BUFFER_SIZE as MaxDataCount
while the TRANS2_SET_PATH_INFORMATION response has no data reply,
only parameters (section 2.2.6.7.2).

Be as minimal as possible here to allow a maximum number of EAs to
be written.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11354
    Reviewed-by: Jeremy Allison <j...@samba.org>

Signed-off-by: Christian Ambach <a...@samba.org>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed May 11 18:35:59 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/libsmb/clifile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 0e790cd..684f263 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -4593,7 +4593,7 @@ static NTSTATUS cli_set_ea(struct cli_state *cli, 
uint16_t setup_val,
status = cli_trans(talloc_tos(), cli, SMBtrans2, NULL, -1, 0, 0,
   setup, 1, 0,
   param, param_len, 2,
-  data,  data_len, CLI_BUFFER_SIZE,
+  data,  data_len, 0,
   NULL,
   NULL, 0, NULL, /* rsetup */
   NULL, 0, NULL, /* rparam */


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-09 Thread Jeremy Allison
The branch, master has been updated
   via  a3f3a6c smbd: Remove an unused #define
  from  6379737 heimdal: encode/decode kvno as signed integer

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


- Log -
commit a3f3a6c354f85d4b7939773e00636526fded5583
Author: Volker Lendecke <v...@samba.org>
Date:   Mon May 9 13:12:01 2016 +0200

smbd: Remove an unused #define

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Mon May  9 17:20:22 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/include/smb.h | 3 ---
 1 file changed, 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/smb.h b/source3/include/smb.h
index dec3189..0af3b61 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -484,9 +484,6 @@ Offset  Datalength.
otherwise NT will not honour the announce packets */
 #define MAX_SERVER_STRING_LENGTH 48
 
-
-#define SMB_SUCCESS 0  /* The request was successful. */
-
 #ifdef NOSTRDUP
 char *strdup(char *s);
 #endif


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-05 Thread Jeremy Allison
The branch, master has been updated
   via  25ac392 WHATSNEW: Document "only user" removal
   via  b51add1 smbd: remove "only user" and "username" parameters
   via  dc3e224 Reset WHATSNEW.txt for 4.5.x series
  from  83b64ae talloc: version 2.1.7

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


- Log -
commit 25ac39268f99671f77dbec27c1d65fb1f67c28f8
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 6 07:54:19 2016 +0300

WHATSNEW: Document "only user" removal

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri May  6 05:02:08 CEST 2016 on sn-devel-144

commit b51add1f3b55fb96f0e9ca922196bab6f1fe03b7
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 6 08:50:27 2016 +0300

smbd: remove "only user" and "username" parameters

These have long been superseded by "valid users"

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit dc3e224408afd18dd2fb7e53ce193e46d5893b04
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 6 07:44:48 2016 +0300

Reset WHATSNEW.txt for 4.5.x series

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 WHATSNEW.txt  | 212 ++
 docs-xml/smbdotconf/security/onlyuser.xml |  22 
 docs-xml/smbdotconf/security/username.xml |  25 
 source3/param/loadparm.c  |   3 -
 source3/smbd/share_access.c   |  20 +--
 5 files changed, 10 insertions(+), 272 deletions(-)
 delete mode 100644 docs-xml/smbdotconf/security/onlyuser.xml
 delete mode 100644 docs-xml/smbdotconf/security/username.xml


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index d81e1ed6..f0c5f77 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,12 +1,12 @@
 Release Announcements
 =
 
-This is the first release candidate of Samba 4.4.  This is *not*
+This is the first release candidate of Samba 4.5.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
 
-Samba 4.4 will be the next version of the Samba suite.
+Samba 4.5 will be the next version of the Samba suite.
 
 
 UPGRADING
@@ -18,217 +18,21 @@ Nothing special.
 NEW FEATURES/CHANGES
 
 
-Asynchronous flush requests

-
-Flush requests from SMB2/3 clients are handled asynchronously and do
-not block the processing of other requests. Note that 'strict sync'
-has to be set to 'yes' for Samba to honor flush requests from SMB
-clients.
-
-s3: smbd
-
-
-Remove '--with-aio-support' configure option. We no longer would ever prefer
-POSIX-RT aio, use pthread_aio instead.
-
-samba-tool sites
-
-
-The 'samba-tool sites' subcommand can now be run against another server by
-specifying an LDB URL using the '-H' option and not against the local database
-only (which is still the default when no URL is given).
-
-samba-tool domain demote
-
-
-Add '--remove-other-dead-server' option to 'samba-tool domain demote'
-subcommand. The new version of this tool now can remove another DC that is
-itself offline.  The '--remove-other-dead-server' removes as many references
-to the DC as possible.
-
-samba-tool drs clone-dc-database
-
-
-Replicate an initial clone of domain, but do not join it.
-This is developed for debugging purposes, but not for setting up another DC.
-
-pdbedit

-
-Add '--set-nt-hash' option to pdbedit to update user password from nt-hash
-hexstring. 'pdbedit -vw' shows also password hashes.
-
-smbstatus
--
-
-'smbstatus' was enhanced to show the state of signing and encryption for
-sessions and shares.
-
-smbget
---
-The -u and -p options for user and password were replaced by the -U option that
-accepts username[%password] as in many other tools of the Samba suite.
-Similary, smbgetrc files do not accept username and password options any more,
-only a single "user" option which also accepts user%password combinations.
-The -P option was removed.
-
-s4-rpc_server
--
-
-Add a GnuTLS based backupkey implementation.
-
-ntlm_auth
--
-
-Using the '--offline-logon' enables ntlm_auth to use cached passwords when the
-DC is offline.
-
-Allow '--password' force a local password check for ntlm-server-1 mode.
-
-vfs_offline

-
-A new VFS module calle

[SCM] Samba Shared Repository - branch master updated

2016-05-05 Thread Jeremy Allison
The branch, master has been updated
   via  83b64ae talloc: version 2.1.7
  from  d4d14b1 lib:talloc. Fix memory leak when destructors reparent 
children.

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


- Log -
commit 83b64ae64b315ccc37b9fce66f19ab0d342ad3ba
Author: Stefan Metzmacher <me...@samba.org>
Date:   Thu May 5 10:18:57 2016 +0200

talloc: version 2.1.7

* Fix memory leak when destructors reparent children. (bug #11901)

Signed-off-by: Stefan Metzmacher <me...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May  5 22:33:04 CEST 2016 on sn-devel-144

---

Summary of changes:
 lib/talloc/ABI/{pytalloc-util-2.1.6.sigs => pytalloc-util-2.1.7.sigs}   | 0
 .../ABI/{pytalloc-util.py3-2.1.6.sigs => pytalloc-util.py3-2.1.7.sigs}  | 0
 lib/talloc/ABI/{talloc-2.1.4.sigs => talloc-2.1.7.sigs} | 0
 lib/talloc/wscript  | 2 +-
 4 files changed, 1 insertion(+), 1 deletion(-)
 copy lib/talloc/ABI/{pytalloc-util-2.1.6.sigs => pytalloc-util-2.1.7.sigs} 
(100%)
 copy lib/talloc/ABI/{pytalloc-util.py3-2.1.6.sigs => 
pytalloc-util.py3-2.1.7.sigs} (100%)
 copy lib/talloc/ABI/{talloc-2.1.4.sigs => talloc-2.1.7.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/ABI/pytalloc-util-2.1.6.sigs 
b/lib/talloc/ABI/pytalloc-util-2.1.7.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util-2.1.6.sigs
copy to lib/talloc/ABI/pytalloc-util-2.1.7.sigs
diff --git a/lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs 
b/lib/talloc/ABI/pytalloc-util.py3-2.1.7.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util.py3-2.1.6.sigs
copy to lib/talloc/ABI/pytalloc-util.py3-2.1.7.sigs
diff --git a/lib/talloc/ABI/talloc-2.1.4.sigs b/lib/talloc/ABI/talloc-2.1.7.sigs
similarity index 100%
copy from lib/talloc/ABI/talloc-2.1.4.sigs
copy to lib/talloc/ABI/talloc-2.1.7.sigs
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index ae0b2276..98e3b7d 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.1.6'
+VERSION = '2.1.7'
 
 
 blddir = 'bin'


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-05 Thread Jeremy Allison
The branch, master has been updated
   via  d4d14b1 lib:talloc. Fix memory leak when destructors reparent 
children.
  from  2fe2e66 autobuild: fix typo in autobuild success subject line

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


- Log -
commit d4d14b15b6734e99f8527136ec007a97024ac348
Author: Saji VR <saji...@nutanix.com>
Date:   Wed May 4 15:14:55 2016 -0700

lib:talloc. Fix memory leak when destructors reparent children.

If a destructor reparents a child, we shouldn't exit the
loop freeing children as there may be others to process.

https://bugzilla.samba.org/show_bug.cgi?id=11901

Signed-off-by: Saji VR <saji...@nutanix.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <rsha...@samba.org>
Reviewed-by: Ira Cooper <i...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May  5 08:33:53 CEST 2016 on sn-devel-144

---

Summary of changes:
 lib/talloc/talloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/lib/talloc/talloc.c b/lib/talloc/talloc.c
index 90b9d96..48d2033 100644
--- a/lib/talloc/talloc.c
+++ b/lib/talloc/talloc.c
@@ -1528,7 +1528,7 @@ static inline void _talloc_free_children_internal(struct 
talloc_chunk *tc,
 * Destructor already reparented this child.
 * No further reparenting needed.
 */
-   return;
+   continue;
}
if (new_parent == null_context) {
struct talloc_chunk *p = 
talloc_parent_chunk(ptr);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-05-04 Thread Jeremy Allison
The branch, master has been updated
   via  625dcef vfs_fruit: add an option that allows disabling POSIX rename 
behaviour
   via  2a872e2 Correctly set cli->raw_status for libsmbclient in SMB2 code
  from  0f6d51f s3:libnet:libnet_join: add netbios aliases as SPNs

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


- Log -
commit 625dcef765adc75c34ee5955a08c6cb77b87f41b
Author: Ralph Boehme <s...@samba.org>
Date:   Mon Apr 11 12:17:22 2016 +0200

vfs_fruit: add an option that allows disabling POSIX rename behaviour

https://bugzilla.samba.org/show_bug.cgi?id=11721

Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu May  5 00:04:50 CEST 2016 on sn-devel-144

commit 2a872e2b66f373b3c96b315b13c9f06a15522e13
Author: Robin McCorkell <ro...@mccorkell.me.uk>
Date:   Mon May 2 21:48:14 2016 +0100

Correctly set cli->raw_status for libsmbclient in SMB2 code

The SMB2 file handling code wasn't correctly setting raw_status, which
is used by libsmbclient to report file open errors etc.

https://bugzilla.samba.org/show_bug.cgi?id=11276

Signed-off-by: Robin McCorkell <ro...@mccorkell.me.uk>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>

---

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml | 11 +++
 source3/libsmb/cli_smb2_fnum.c| 16 +++-
 source3/modules/vfs_fruit.c   |  6 +-
 3 files changed, 31 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml 
b/docs-xml/manpages/vfs_fruit.8.xml
index 36d137e..2535f9e 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -234,6 +234,17 @@

  
 
+ 
+   fruit:posix_rename = yes | no
+   
+ Whether to enable POSIX directory rename behaviour
+ for OS X clients. Without this, directories can't be
+ renamed if any client has any file inside it
+ (recursive!) open.
+ The default is yes.
+   
+ 
+

 
 
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index c9f4060..a17d918 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -262,6 +262,7 @@ NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, 
uint16_t *pfnum,
NTSTATUS status;
 
if (tevent_req_is_nterror(req, )) {
+   state->cli->raw_status = status;
return status;
}
if (pfnum != NULL) {
@@ -270,6 +271,7 @@ NTSTATUS cli_smb2_create_fnum_recv(struct tevent_req *req, 
uint16_t *pfnum,
if (cr != NULL) {
*cr = state->cr;
}
+   state->cli->raw_status = NT_STATUS_OK;
return NT_STATUS_OK;
 }
 
@@ -390,7 +392,11 @@ static void cli_smb2_close_fnum_done(struct tevent_req 
*subreq)
 
 NTSTATUS cli_smb2_close_fnum_recv(struct tevent_req *req)
 {
-   return tevent_req_simple_recv_ntstatus(req);
+   struct cli_smb2_close_fnum_state *state = tevent_req_data(
+   req, struct cli_smb2_close_fnum_state);
+   NTSTATUS status = tevent_req_simple_recv_ntstatus(req);
+   state->cli->raw_status = status;
+   return status;
 }
 
 NTSTATUS cli_smb2_close_fnum(struct cli_state *cli, uint16_t fnum)
@@ -2302,6 +2308,7 @@ NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
req, struct cli_smb2_read_state);
 
if (tevent_req_is_nterror(req, )) {
+   state->cli->raw_status = status;
return status;
}
/*
@@ -2311,6 +2318,7 @@ NTSTATUS cli_smb2_read_recv(struct tevent_req *req,
 */
*received = (ssize_t)state->received;
*rcvbuf = state->buf;
+   state->cli->raw_status = NT_STATUS_OK;
return NT_STATUS_OK;
 }
 
@@ -2409,6 +2417,7 @@ NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
NTSTATUS status;
 
if (tevent_req_is_nterror(req, )) {
+   state->cli->raw_status = status;
tevent_req_received(req);
return status;
}
@@ -2416,6 +2425,7 @@ NTSTATUS cli_smb2_write_recv(struct tevent_req *req,
if (pwritten != NULL) {
*pwritten = (size_t)state->written;
}
+   state->cli->raw_status = NT_STATUS_OK;
tevent_req_received(req);
return NT_STATUS_OK;
 }
@@ -2573,11 +2583,13 @@ NTSTATUS cli_smb2_writeall_recv(struct tevent_req *req,
NTSTATUS status;
 
if (te

[SCM] Samba Shared Repository - branch master updated

2016-05-03 Thread Jeremy Allison
The branch, master has been updated
   via  f85b30a s3:smbd remove todo comments
   via  c519cc8 selftest: test for case insensitivity over SMB2/SMB3
   via  a9ccd50 s3:smbd/filename remove smelly code
   via  3242776 s3:smbd/service apply some code formatting
   via  bb9f5ce s3:smbd/service disable case-sensitivity for SMB2/3 
connections
   via  87fa3c3 lib: Avoid includes.h in base64.c
   via  93b982f lib: Give base64.c its own .h
   via  9ec3332 lib: Remove SMB_ASSERT from base64_encode_data_blob
   via  cf5a810 lib: Make callers of base64_encode_data_blob check for 
success
   via  f457535 lib: =0 and |= is equivalent to =
   via  a5fd779 lib: The base64 chars are by definition single-byte :-)
   via  a2c59d3 smbd: use remote arch caching
   via  719e422 s3/lib: add remote arch caching
   via  44c236a s3/lib: add get_remote_arch_from_str()
   via  6b5b004 s3/lib: rework get_remote_arch_str() to use an array
  from  5359031 ldb-samba: Use ndr_pull_struct_blob_all_noalloc

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


- Log -
commit f85b30ae78c90b7b1ae9bdce099d37728c77c9d4
Author: Christian Ambach <a...@samba.org>
Date:   Tue Apr 5 14:30:47 2016 +0200

s3:smbd remove todo comments

as the service is set to be case insensitive for SMB2 now,
there is no need to set FLAG_CASELESS_PATHNAMES as flag

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed May  4 05:00:36 CEST 2016 on sn-devel-144

commit c519cc8b98e05a17698790ebad7dec04531c22d8
Author: Christian Ambach <a...@samba.org>
Date:   Mon Apr 4 19:28:05 2016 +0200

selftest: test for case insensitivity over SMB2/SMB3

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a9ccd50b63421187c18bfb04001d225d212cdc2a
Author: Christian Ambach <a...@samba.org>
Date:   Tue Apr 5 02:58:48 2016 +0200

s3:smbd/filename remove smelly code

not sure how this chunk ended up there, but I agree with
the statement in the comment that behavior should not depend
on developer mode

make test does not seem to depend on it anymore.

This piece had some bad influence on the tests I wrote
for case insensitivite behavior of SMB2/3, so let us
remove this technical debt.

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 32427768610cbe2e5dfe199ab7865b061ea57919
Author: Christian Ambach <a...@samba.org>
Date:   Sun Apr 3 05:16:45 2016 +0200

s3:smbd/service apply some code formatting

reduce indentation in switch statement, obey 80 char line limit, use C99 
bool

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit bb9f5ceeb37df2485f2a9d18fb441e64b168378c
Author: Christian Ambach <a...@samba.org>
Date:   Sun Apr 3 05:06:05 2016 +0200

s3:smbd/service disable case-sensitivity for SMB2/3 connections

in SMB2, there is no flag to let us know if the client wants to have 
case-sensitive behavior,
so in Auto mode, disable case-sensitivity

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11438
Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 87fa3c36f3bc7848a3fbd06a0dcd7bb49666da74
Author: Volker Lendecke <v...@samba.org>
Date:   Tue May 3 16:12:23 2016 +0200

lib: Avoid includes.h in base64.c

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 93b982faada860b6be178e0dcd4650bf7ca498aa
Author: Volker Lendecke <v...@samba.org>
Date:   Tue May 3 16:12:10 2016 +0200

    lib: Give base64.c its own .h

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9ec33323499cae77dba1ea3ff659d3cf59e9e2d4
Author: Volker Lendecke <v...@samba.org>
Date:   Tue May 3 15:56:37 2016 +0200

lib: Remove SMB_ASSERT from base64_encode_data_blob

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cf5a81013d2dbc62cacaa0141c9ee6b53e13cb39
Author: Volker Lendecke <v...@samba.org>
Date:   Tue May 3 15:54:07 2016 +0200

lib: Make callers of base64_encode_data_blob check for success

Quite a few callers already did check for !=NULL. With the current code 
this is
pointless due to a SMB_ASSERT in base64_encode_data_blob() itself. Make the
callers consistently check, so that we can remove SMB_ASSERT from base64.c.

Signed-off-by

[SCM] Samba Shared Repository - branch master updated

2016-05-02 Thread Jeremy Allison
The branch, master has been updated
   via  685e813 Add build option for default smbpasswd location
  from  84a13e7 ctdb/ltdbtool: Fix static declarations

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


- Log -
commit 685e813c45436046a18eb3b8895da5846bd2a0dc
Author: Ivo De Decker <ivo.dedec...@ugent.be>
Date:   Tue Apr 26 21:35:57 2016 +0200

Add build option for default smbpasswd location

Signed-off-by: Ivo De Decker <ivo.dedec...@ugent.be>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andrew Bartlett <abart...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue May  3 04:42:24 CEST 2016 on sn-devel-144

---

Summary of changes:
 dynconfig/wscript | 2 ++
 1 file changed, 2 insertions(+)


Changeset truncated at 500 lines:

diff --git a/dynconfig/wscript b/dynconfig/wscript
index dba74f6..2d17e7c 100755
--- a/dynconfig/wscript
+++ b/dynconfig/wscript
@@ -254,6 +254,8 @@ dynconfig = {
 'SMB_PASSWD_FILE' : {
  'STD-PATH':  '${PRIVATE_DIR}/smbpasswd',
  'FHS-PATH':  '${PRIVATE_DIR}/smbpasswd',
+ 'OPTION':'--with-smbpasswd-file',
+ 'HELPTEXT':  'Where to put the smbpasswd file',
  'DELAY': True,
 },
 }


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-29 Thread Jeremy Allison
The branch, master has been updated
   via  84a13e7 ctdb/ltdbtool: Fix static declarations
   via  e2642da smbcacls: Do not read old ACL for 'set' operation
   via  8bb4fcc gensec: Change log level of message when no PAC is found
   via  3d33ebe winbindd: Remove unused prototypes for winbindd_group.c
  from  e0d8c6b s3:client:smbspool_krb5_wrapper: fix the non clearenv build.

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


- Log -
commit 84a13e70a61ae0b1207805bb08b34b0fb32e5248
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Apr 26 12:15:20 2016 -0700

ctdb/ltdbtool: Fix static declarations

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Apr 30 04:28:13 CEST 2016 on sn-devel-144

commit e2642da130f96c542aa4962b76c1b9d1f677162d
Author: Christof Schmitt <c...@samba.org>
Date:   Fri Apr 29 15:12:38 2016 -0700

smbcacls: Do not read old ACL for 'set' operation

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8bb4fccd2758cba5907134621ef57186e70a7073
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Apr 28 11:23:41 2016 -0700

gensec: Change log level of message when no PAC is found

For a Samba server that uses a non-AD KDC this message is triggered on
every new connection. Change the log level from warning/1 to a more
appropriate notice/5.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3d33ebe36bc2aece6b16d86eb18d51c241c30fc5
Author: Christof Schmitt <c...@samba.org>
Date:   Sun Apr 17 21:27:31 2016 -0700

winbindd: Remove unused prototypes for winbindd_group.c

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 auth/gensec/gensec_util.c |  4 ++--
 ctdb/tools/ltdbtool.c | 25 ++---
 source3/utils/smbcacls.c  | 14 ++
 source3/winbindd/winbindd_proto.h | 11 ---
 4 files changed, 26 insertions(+), 28 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/gensec/gensec_util.c b/auth/gensec/gensec_util.c
index 64fffb1..da2e2e5 100644
--- a/auth/gensec/gensec_util.c
+++ b/auth/gensec/gensec_util.c
@@ -48,8 +48,8 @@ NTSTATUS gensec_generate_session_info_pac(TALLOC_CTX *mem_ctx,
  principal_string));
return NT_STATUS_ACCESS_DENIED;
}
-   DEBUG(1, ("Unable to find PAC for %s, resorting to local user 
lookup\n",
- principal_string));
+   DBG_NOTICE("Unable to find PAC for %s, resorting to local "
+  "user lookup\n", principal_string);
}
 
if (gensec_security->auth_context && 
gensec_security->auth_context->generate_session_info_pac) {
diff --git a/ctdb/tools/ltdbtool.c b/ctdb/tools/ltdbtool.c
index 7ac70e2..2352079 100644
--- a/ctdb/tools/ltdbtool.c
+++ b/ctdb/tools/ltdbtool.c
@@ -302,9 +302,10 @@ ltdb_traverse_fn(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA 
val,
return ctx->fn(tdb, key, val, , ctx->state);
 }
 
-int ltdb_traverse(TDB_CONTEXT *tdb,
- int (*fn)(TDB_CONTEXT *,TDB_DATA,TDB_DATA,struct 
ctdb_ltdb_header*,void *),
- void *state, int hsize, bool skip_empty)
+static int ltdb_traverse(TDB_CONTEXT *tdb,
+int (*fn)(TDB_CONTEXT*, TDB_DATA, TDB_DATA,
+  struct ctdb_ltdb_header*, void *),
+void *state, int hsize, bool skip_empty)
 {
struct ltdb_traverse_ctx ctx = {
.fn = fn,
@@ -318,9 +319,9 @@ int ltdb_traverse(TDB_CONTEXT *tdb,
return (ret < 0) ? ret : (ret - ctx.nempty);
 }
 
-int write_record(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA val,
-struct ctdb_ltdb_header* hdr,
-void* write_record_ctx)
+static int write_record(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA val,
+   struct ctdb_ltdb_header* hdr,
+   void* write_record_ctx)
 {
struct write_record_ctx* ctx
= (struct write_record_ctx*)write_record_ctx;
@@ -347,9 +348,9 @@ int write_record(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA 
val,
return 0;
 }
 
-int dump_record(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA val,
-   struct ctdb_ltdb_header* hdr,
-   void* dump_record_ctx)
+static int dump_record(TDB_CONTEXT* tdb, TDB_DATA key, TDB_DATA val,
+

[SCM] Samba Shared Repository - branch master updated

2016-04-28 Thread Jeremy Allison
The branch, master has been updated
   via  d28282c xfs quotas - fix case of no quota for user
   via  2c03d00 nt-quotas: fixup failure case for 
TRANSACT_GET_USER_QUOTA_FOR_SID
  from  f198abc Provide fallback code for non-portable clearenv(3)

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


- Log -
commit d28282ce573380f230bd683e655bfc77d358a706
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 27 23:21:51 2016 +0300

xfs quotas - fix case of no quota for user

Fixup commit ce82f66b9fdc611124f7284e32e44ed3df2d7295
Add missing success return value when user has no quota record
(this is considered success with no quota)

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Apr 29 05:39:14 CEST 2016 on sn-devel-144

commit 2c03d004f8ef36fb10e879580999ebb70d440d43
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Apr 27 23:21:20 2016 +0300

nt-quotas: fixup failure case for TRANSACT_GET_USER_QUOTA_FOR_SID

Fixup commit 0e01ed06a40146d145ffe439a65fb9035ab7b1cf
Add a missing return statement after generating error response to
the request.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/lib/sysquotas_xfs.c | 2 ++
 source3/smbd/nttrans.c  | 1 +
 2 files changed, 3 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/lib/sysquotas_xfs.c b/source3/lib/sysquotas_xfs.c
index bea86d5..8db52bd 100644
--- a/source3/lib/sysquotas_xfs.c
+++ b/source3/lib/sysquotas_xfs.c
@@ -98,6 +98,8 @@ int sys_get_xfs_quota(const char *path, const char *bdev, 
enum SMB_QUOTA_TYPE qt
if (ret != 0 && errno != ENOENT) {
return ret;
}
+
+   ret = 0;
break;
 #ifdef HAVE_GROUP_QUOTA
case SMB_GROUP_QUOTA_TYPE:
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index fa3f74c..05f3cae 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -2513,6 +2513,7 @@ static void 
call_nt_transact_get_user_quota(connection_struct *conn,
, );
if (!NT_STATUS_IS_OK(nt_status)) {
reply_nterror(req, nt_status);
+   return;
}
 
/* Realloc the size of parameters and data we will 
return */


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-28 Thread Jeremy Allison
The branch, master has been updated
   via  f198abc Provide fallback code for non-portable clearenv(3)
   via  90403de testsuit/manage-ca.sh: specify key size in CSRs
   via  b61658e winbindd/idmap_rfc2307: Fix CID 1273424 - Read from pointer 
after free
   via  184e787 winbindd: check if dcinfo from genache is expired
  from  eee88e0 s3:selftest: add smbclient_ntlm tests

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


- Log -
commit f198abcbb3f6e8b26c697d3ded2caa1076ae018b
Author: Jérémie Courrèges-Anglas <j...@wxcvbn.org>
Date:   Wed Apr 27 18:01:51 2016 +0200

Provide fallback code for non-portable clearenv(3)

clearenv(3) is a GNU extension that was rejected twice by POSIX,
without an easy, portable alternative.

As the dovecot project notes,
"""
environ = NULL crashes on OSX - and OpenBSD < 6.0
*environ = NULL doesn't work on FreeBSD 7.0
environ = emptyenv doesn't work on Haiku OS
environ = calloc should work everywhere
"""
(source: 
http://hg.dovecot.org/dovecot-2.0/file/48f90e7e92dc/src/lib/env-util.c)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11864
Signed-off-by: Jérémie Courrèges-Anglas <j...@wxcvbn.org>
Reviewed-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Apr 29 00:12:02 CEST 2016 on sn-devel-144

commit 90403de7acdfec2aa3c752f6add27bc6f0e9ac30
Author: Björn Jacke <b...@sernet.de>
Date:   Wed Apr 27 16:57:36 2016 +0200

testsuit/manage-ca.sh: specify key size in CSRs

specifying the key size is required by some openssl versions
    
    Signed-off-by: Bjoern Jacke <b...@sernet.de>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b61658e721c922089bde4543ec8c445de6eb903c
Author: Robin Hack <hack.ro...@gmail.com>
Date:   Wed Apr 27 15:10:45 2016 +0200

winbindd/idmap_rfc2307: Fix CID 1273424 - Read from pointer after free

idmap_rfc2307_ads_search() calls ads_do_search_retry_internal() which
can deallocate ads param based on ads->is_mine boolean.

This approach is fragile so caller must properly check
return code before any pointer dereference.

Signed-off-by: Robin Hack <hack.ro...@gmail.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Christof Schmitt <c...@samba.org>

commit 184e7873cb4038e3e90028cb60443f5b2602a7ed
Author: Ralph Boehme <s...@samba.org>
Date:   Tue Apr 26 08:43:26 2016 +0200

winbindd: check if dcinfo from genache is expired

The gencache parse function dcinfo_parser() used by
wb_dsgetdcname_gencache_get() misses a check for expired gencache
entries.

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 selftest/manage-ca/manage-ca.sh| 4 ++--
 source3/client/smbspool_krb5_wrapper.c | 6 ++
 source3/winbindd/idmap_rfc2307.c   | 5 +
 source3/winbindd/wb_dsgetdcname.c  | 4 
 source3/wscript| 2 +-
 5 files changed, 18 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/manage-ca/manage-ca.sh b/selftest/manage-ca/manage-ca.sh
index ab796b7..8e09a93 100755
--- a/selftest/manage-ca/manage-ca.sh
+++ b/selftest/manage-ca/manage-ca.sh
@@ -234,7 +234,7 @@ create_dc)
"${OPENSSLCNF}" \
${DEFAULT_VARS} DC_DNS_NAME DC_OBJECTGUID_HEX
 
-   openssl req -new -newkey rsa -keyout "${DCKEY_PEM}" -out "${DCREQ_PEM}" 
-config "${OPENSSLCNF}"
+   openssl req -new -newkey rsa:${DC_BITS} -keyout "${DCKEY_PEM}" -out 
"${DCREQ_PEM}" -config "${OPENSSLCNF}"
openssl rsa -in "${DCKEY_PEM}" -inform PEM -out "${DCKEY_PRIVATE_PEM}" 
-outform PEM
openssl ca -config "${OPENSSLCNF}" -in "${DCREQ_PEM}" -out 
"${DCCERT_PEM}"
ln -s "${DCKEY_PRIVATE_PEM_BASE}" "${DCKEY_PRIVATE_PEM_LINK}"
@@ -326,7 +326,7 @@ create_user)
"${OPENSSLCNF}" \
${DEFAULT_VARS} USER_PRINCIPAL_NAME
 
-   openssl req -new -newkey rsa -keyout "${USERKEY_PEM}" -out 
"${USERREQ_PEM}" -config "${OPENSSLCNF}"
+   openssl req -new -newkey rsa:${USER_BITS} -keyout "${USERKEY_PEM}" -out 
"${USERREQ_PEM}" -config "${OPENSSLCNF}"
openssl rsa -in "${USERKEY_PEM}" -inform PEM -out 
"${USERKEY_PRIVATE_PEM}" -outform PEM
openssl ca -config "${OPENSSLCNF}" -i

[SCM] Samba Shared Repository - branch master updated

2016-04-27 Thread Jeremy Allison
The branch, master has been updated
   via  10b0a8b smbd: Avoid large reads beyond EOF
  from  07e2f47 Fix the smb2_setinfo to handle FS info types and FSQUOTA 
infolevel

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


- Log -
commit 10b0a8baa25fab70df8e6c5f0048ce0963211517
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Apr 27 12:15:37 2016 +0200

smbd: Avoid large reads beyond EOF

With unix extensions and oplocks=no mount.cifs from jessie reads beyond the
file end forever, and we are happy to return zeros

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11878

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Apr 27 23:57:56 CEST 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/reply.c | 10 ++
 1 file changed, 10 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index cbe15a3..e0e55c6 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -4100,6 +4100,16 @@ normal_read:
uint8_t headerbuf[smb_size + 2*12 + 1 /* padding byte */];
ssize_t ret;
 
+   if (!S_ISREG(fsp->fsp_name->st.st_ex_mode) ||
+   (startpos > fsp->fsp_name->st.st_ex_size) ||
+   (smb_maxcnt > (fsp->fsp_name->st.st_ex_size - startpos))) {
+   /*
+* We already know that we would do a short
+* read, so don't try the sendfile() path.
+*/
+   goto nosendfile_read;
+   }
+
construct_reply_common_req(req, (char *)headerbuf);
setup_readX_header(req, (char *)headerbuf, smb_maxcnt);
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-26 Thread Jeremy Allison
The branch, master has been updated
   via  f4181f2 ldb-samba/ldb_matching_rules: Fix CID 1349424 - 
Uninitialized pointer read
   via  51f221c dcesrv_backupkey_heimdal: Fix CID 1321647 - Unchecked 
return value
   via  9a7a38a lib/http/http_auth: Fix CID 1273428 - Unchecked return value
   via  b9ffb93 talloc/testsuite: Fix CID 1291641 - Logically dead code
  from  f9099d3 s3-libads: Fix compilation with MIT Kerberos

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


- Log -
commit f4181f25b4ae3db684e43837449617e75183ecc8
Author: Robin Hack <hack.ro...@gmail.com>
Date:   Tue Apr 26 17:51:46 2016 +0200

ldb-samba/ldb_matching_rules: Fix CID 1349424 - Uninitialized pointer read

Fix unitialized 'visited' value (pointer to pointer) in
ldb_eval_transitive_filter() which passes 'visited' value later to
ldb_eval_transitive_filter_helper().

Signed-off-by: Robin Hack <hack.ro...@gmail.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Apr 27 02:12:39 CEST 2016 on sn-devel-144

commit 51f221c86eb7004f7a45c9cd03aa889e94a8dbc6
Author: Robin Hack <hack.ro...@gmail.com>
Date:   Tue Apr 26 15:17:51 2016 +0200

dcesrv_backupkey_heimdal: Fix CID 1321647 - Unchecked return value

Unchecked return value of gnutls_global_init().

Signed-off-by: Robin Hack <hack.ro...@gmail.com>
Reviewed-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9a7a38a6dde6418e48048fdf8bfcd6f38674e443
Author: Robin Hack <hack.ro...@gmail.com>
Date:   Tue Apr 26 13:58:27 2016 +0200

lib/http/http_auth: Fix CID 1273428 - Unchecked return value

There is missing check of status value in
http_auth.c:http_create_auth_request() which can leave values
inside 'DATA_BLOB in' unitialized.

http_auth.c:http_create_auth_request() calls
http_auth.c:http_parse_auth_response() which can return 
NT_STATUS_NOT_SUPPORTED
and which is not checked by caller and later passed as argument to other 
functions.

For example:
'DATA_BLOB in' can be passed to
auth/gensec/spnego.c:gensec_spnego_update() later:

...
switch (spnego_state->state_position) {
..
case SPNEGO_SERVER_START:
if (in.length) {

Signed-off-by: Robin Hack <hack.ro...@gmail.com>
Reviewed-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b9ffb9322b987409693e4faa277b5e3f46ad8b22
Author: Robin Hack <hack.ro...@gmail.com>
Date:   Tue Apr 26 13:02:01 2016 +0200

talloc/testsuite: Fix CID 1291641 - Logically dead code

Add check for snprintf return code.
    
Signed-off-by: Robin Hack <hack.ro...@gmail.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>

---

Summary of changes:
 lib/ldb-samba/ldb_matching_rules.c  |  2 +-
 lib/talloc/testsuite.c  | 10 +-
 source4/lib/http/http_auth.c|  3 +++
 source4/rpc_server/backupkey/dcesrv_backupkey_heimdal.c |  6 +-
 4 files changed, 14 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb-samba/ldb_matching_rules.c 
b/lib/ldb-samba/ldb_matching_rules.c
index 1692a73..637858f 100644
--- a/lib/ldb-samba/ldb_matching_rules.c
+++ b/lib/ldb-samba/ldb_matching_rules.c
@@ -206,7 +206,7 @@ static int ldb_eval_transitive_filter(TALLOC_CTX *mem_ctx,
struct dsdb_dn *dn_to_match;
const char *dn_oid;
unsigned int count;
-   struct dsdb_dn **visited;
+   struct dsdb_dn **visited = NULL;
 
schema = dsdb_get_schema(ldb, mem_ctx);
if (schema == NULL) {
diff --git a/lib/talloc/testsuite.c b/lib/talloc/testsuite.c
index 34410b8..5eab839 100644
--- a/lib/talloc/testsuite.c
+++ b/lib/talloc/testsuite.c
@@ -1795,11 +1795,11 @@ static bool test_pthread_talloc_passing(void)
 * They will use their own toplevel contexts.
 */
for (i = 0; i < NUM_THREADS; i++) {
-   (void)snprintf(str_array[i],
-   20,
-   "thread:%d",
-   i);
-   if (str_array[i] == NULL) {
+   ret = snprintf(str_array[i],
+  20,
+  "thread:%d",
+  i);
+   if (ret < 0) {
printf("snprintf %d failed\n", i);
return false;
  

[SCM] Samba Shared Repository - branch master updated

2016-04-26 Thread Jeremy Allison
The branch, master has been updated
   via  32b1f78 LDB: Redudant test on NULL context remove
  from  3e3e72f s3/rpc_server: mdssvc: suppress compiler warnings from glib 
headers

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


- Log -
commit 32b1f78b23b0f47d38417f75af1341a0662184f1
Author: Petr Cech <pc...@redhat.com>
Date:   Mon Mar 21 09:15:17 2016 -0400

LDB: Redudant test on NULL context remove

There is redudant test on NULL context in ldb_dn_new_fmt() function.
We use this (NULL) context in talloc_vasprintf() function which is
able to work with NULL at all. And at the end, we free this newly
created (by talloc_vasprintf) context. So it should be safe to remove
this check.

Signed-off-by: Petr Cech <pc...@redhat.com>
Reviewed-by: Simo Sorce <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Apr 26 08:09:25 CEST 2016 on sn-devel-144

---

Summary of changes:
 lib/ldb/common/ldb_dn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index b7d2de7..ab78776 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -171,7 +171,7 @@ struct ldb_dn *ldb_dn_new_fmt(TALLOC_CTX *mem_ctx,
char *strdn;
va_list ap;
 
-   if ( (! mem_ctx) || (! ldb)) return NULL;
+   if (! ldb) return NULL;
 
va_start(ap, new_fmt);
strdn = talloc_vasprintf(mem_ctx, new_fmt, ap);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-25 Thread Jeremy Allison
The branch, master has been updated
   via  53e0860 Fix CHECK_CODE usage in atomics builtin detection
  from  ad5a4a9 ctdbd_conn: Make "cstatus" int32_t

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


- Log -
commit 53e0860122c3fa6b9fe80b5693c7b1eee2ad605d
Author: Jérémie Courrèges-Anglas <j...@wxcvbn.org>
Date:   Mon Apr 25 16:10:03 2016 +0200

Fix CHECK_CODE usage in atomics builtin detection

CHECK_CODE already wraps the code with main().  Adding another layer
results in a nested function, eg

  int main(void) { int main(void) { __sync_fetch_and_add(); } }

Since the inner function isn't called it is optimized out at cc -O2,
thus the linker doesn't fail if __sync_fetch_and_add() isn't available.

Issue noticed on OpenBSD/hppa.

Signed-off-by: Jérémie Courrèges-Anglas <j...@wxcvbn.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <s...@samba.org>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Apr 26 01:19:40 CEST 2016 on sn-devel-144

---

Summary of changes:
 lib/replace/wscript | 16 
 1 file changed, 4 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/wscript b/lib/replace/wscript
index 37cbbb7..5efd86c 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -202,23 +202,15 @@ def configure(conf):
 
 # Check for atomic builtins. */
 conf.CHECK_CODE('''
-int main(void) {
-int i;
-(void)__sync_fetch_and_add(, 1);
-return 0;
-}
+int i;
+(void)__sync_fetch_and_add(, 1);
 ''',
 'HAVE___SYNC_FETCH_AND_ADD',
 msg='Checking for __sync_fetch_and_add compiler builtin')
 
 conf.CHECK_CODE('''
-#include 
-#include 
-int main(void) {
-int32_t i;
-atomic_add_32(, 1);
-return 0;
-}
+int32_t i;
+atomic_add_32(, 1);
 ''',
 'HAVE_ATOMIC_ADD_32',
 headers='stdint.h sys/atomic.h',


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-08 Thread Jeremy Allison
The branch, master has been updated
   via  494da27 examples/smb.conf.default: Fix typo in comment line: sever 
-> server
  from  f63b9a7 s3: libsmb: Fix error where short name length was read as 2 
bytes, should be 1.

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


- Log -
commit 494da274df3f99fee7bd46bed4709bb1bbc01a5d
Author: Santiago Vila <sanv...@debian.org>
Date:   Fri Apr 8 13:05:56 2016 +0200

examples/smb.conf.default: Fix typo in comment line: sever -> server

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11823

Signed-off-by: Santiago Vila <sanv...@debian.org>
Reviewed-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Apr  9 02:35:23 CEST 2016 on sn-devel-144

---

Summary of changes:
 examples/smb.conf.default | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/examples/smb.conf.default b/examples/smb.conf.default
index bb9c2e2..2f20720 100644
--- a/examples/smb.conf.default
+++ b/examples/smb.conf.default
@@ -33,7 +33,7 @@
 # domain controller", "classic backup domain controller", "active
 # directory domain controller".
 #
-# Most people will want "standalone sever" or "member server".
+# Most people will want "standalone server" or "member server".
 # Running as "active directory domain controller" will require first
 # running "samba-tool domain provision" to wipe databases and create a
 # new domain.


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-04-05 Thread Jeremy Allison
The branch, master has been updated
   via  f63b9a7 s3: libsmb: Fix error where short name length was read as 2 
bytes, should be 1.
   via  6eba42f selftest: Load time_audit and full_audit
   via  0d9c2b9 vfs_time_audit: Assert that all VFS functions are 
implemented
   via  8a9f74e vfs_full_audit: Assert that all VFS functions are 
implemented
   via  d18a0ff vfs: Add helper to check for missing VFS functions
   via  94f3129 configure: Don't check for inotify on illumos
  from  ff6b49b nwrap: Fix the build on Solaris

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


- Log -
commit f63b9a73b03971f41947c694e6952cd1e49b67c3
Author: Jeremy Allison <j...@samba.org>
Date:   Tue Apr 5 13:07:06 2016 -0700

s3: libsmb: Fix error where short name length was read as 2 bytes, should 
be 1.

Reported by Thomas Dvorachek <tdvorac...@yahoo.com> from a Windows 10 
server.
Confirmed in MS-CIFS 2.2.8.1.7.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11822

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <s...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Apr  6 03:46:55 CEST 2016 on sn-devel-144

commit 6eba42f927230e1a0c65ded4bc47ddacfb4a0ddb
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Mar 31 22:31:19 2016 -0700

selftest: Load time_audit and full_audit

This triggers the check for missing VFS functions in these modules.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0d9c2b95b2954fca8a43e7d7561f04bfb7600667
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Mar 31 22:30:41 2016 -0700

vfs_time_audit: Assert that all VFS functions are implemented

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8a9f74e3ac821d0b4b02c778cc9abff740294693
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Mar 31 22:30:14 2016 -0700

vfs_full_audit: Assert that all VFS functions are implemented
    
Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit d18a0ff9cba40e2e50bedb95657563ede8f586dd
Author: Christof Schmitt <c...@samba.org>
Date:   Fri Apr 1 09:47:31 2016 -0700

vfs: Add helper to check for missing VFS functions

Some VFS modules want to ensure that they implement all VFS functions.
This helper can be used to detect missing functions in the developer
    build.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 94f31295b12b20a68d596929ea428eb36f8c0d82
Author: Jorge Schrauwen <sjo...@blackdot.be>
Date:   Sun Apr 3 11:43:50 2016 +0200

configure: Don't check for inotify on illumos

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11816
Reviewed-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 selftest/target/Samba3.pm  |  2 +-
 source3/include/vfs.h  |  3 +++
 source3/libsmb/clilist.c   |  2 +-
 source3/modules/vfs_full_audit.c   | 10 +++---
 source3/modules/vfs_time_audit.c   |  2 ++
 source3/smbd/vfs.c | 30 ++
 source3/wscript| 11 +++
 source4/ntvfs/sysdep/wscript_configure | 13 +
 8 files changed, 60 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index bdeebc9..f4d7403 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -548,7 +548,7 @@ sub setup_simpleserver($$)
 
my $simpleserver_options = "
lanman auth = yes
-   vfs objects = xattr_tdb streams_depot
+   vfs objects = xattr_tdb streams_depot time_audit full_audit
change notify = no
 
 [vfs_aio_fork]
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index 6ab9a7e..9360802 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -1381,4 +1381,7 @@ void vfs_remove_all_fsp_extensions(struct files_struct 
*fsp);
 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 void *vfs_fetch_fsp_extension(vfs_handle_struct *handle, files_struct *fsp);
 
+void smb_vfs_assert_all_fns(const struct vfs_fn_pointers* fns,
+   const char *module);
+
 #endif /* _VFS_H */
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 94bbc57..6438d3b 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -186,7 +186,7 @@ stati

[SCM] Samba Shared Repository - branch master updated

2016-04-01 Thread Jeremy Allison
The branch, master has been updated
   via  f777ca3 Bug 11818 : obvious missing word When trying to demote a 
dc, 'remove_dc.remove_sysvol_references' is sent 'remote_samdb, dc_name' , it 
expects 'remote_samdb, logger, dc_name'
   via  16ef497 vfs_gpfs: Remove xattr functions
   via  f20aed5 vfs_gpfs: Implement new dos_attributes vfs functions
   via  6a2d97b gpfswrap: Add wrapper for gpfs_set_winattrs
  from  02f4808 ctdb-killtcp: Change default retry interval, batch size and 
attempts

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


- Log -
commit f777ca33c677cc6a7f4e52606b83c5002e3e6b71
Author: Rowland Penny <rpe...@samba.org>
Date:   Thu Mar 31 13:24:28 2016 +0100

Bug 11818 : obvious missing word When trying to demote a dc, 
'remove_dc.remove_sysvol_references' is sent 'remote_samdb, dc_name' , it 
expects 'remote_samdb, logger, dc_name'

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11818

Signed-off-by: Rowland Penny <rpe...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Apr  1 22:54:22 CEST 2016 on sn-devel-144

commit 16ef4973660e15aa3f03057e56557477ece82c09
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Mar 22 22:43:49 2016 -0700

vfs_gpfs: Remove xattr functions

The xattr functions intercepted only the calls from dosmode. With the
implementation of the dos_attribute interface, the xattr codepaths never
get called and can be removed.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f20aed5c17769c09bb3ecce59628ecac7b337b0c
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Mar 22 22:39:11 2016 -0700

vfs_gpfs: Implement new dos_attributes vfs functions

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 6a2d97b361ac2e8c31ee643f0e82a86cffcd67bc
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Mar 22 22:38:11 2016 -0700

gpfswrap: Add wrapper for gpfs_set_winattrs

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/util/gpfswrap.c   |  13 +++
 lib/util/gpfswrap.h   |   1 +
 python/samba/netcmd/domain.py |   2 +-
 source3/modules/vfs_gpfs.c| 266 +++---
 4 files changed, 160 insertions(+), 122 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c
index 4c74105..0632ee2 100644
--- a/lib/util/gpfswrap.c
+++ b/lib/util/gpfswrap.c
@@ -29,6 +29,8 @@ static int (*gpfs_get_realfilename_path_fn)(char *pathname, 
char *filenamep,
int *len);
 static int (*gpfs_set_winattrs_path_fn)(char *pathname, int flags,
struct gpfs_winattr *attrs);
+static int (*gpfs_set_winattrs_fn)(int fd, int flags,
+  struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_path_fn)(char *pathname,
struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
@@ -63,6 +65,7 @@ int gpfswrap_init(void)
gpfs_putacl_fn= dlsym(l, "gpfs_putacl");
gpfs_get_realfilename_path_fn = dlsym(l, "gpfs_get_realfilename_path");
gpfs_set_winattrs_path_fn = dlsym(l, "gpfs_set_winattrs_path");
+   gpfs_set_winattrs_fn  = dlsym(l, "gpfs_set_winattrs");
gpfs_get_winattrs_path_fn = dlsym(l, "gpfs_get_winattrs_path");
gpfs_get_winattrs_fn  = dlsym(l, "gpfs_get_winattrs");
gpfs_prealloc_fn  = dlsym(l, "gpfs_prealloc");
@@ -140,6 +143,16 @@ int gpfswrap_set_winattrs_path(char *pathname, int flags,
return gpfs_set_winattrs_path_fn(pathname, flags, attrs);
 }
 
+int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs)
+{
+   if (gpfs_set_winattrs_fn == NULL) {
+   errno = ENOSYS;
+   return -1;
+   }
+
+   return gpfs_set_winattrs_fn(fd, flags, attrs);
+}
+
 int gpfswrap_get_winattrs_path(char *pathname, struct gpfs_winattr *attrs)
 {
if (gpfs_get_winattrs_path_fn == NULL) {
diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h
index 25b1ba8..1c9c64f 100644
--- a/lib/util/gpfswrap.h
+++ b/lib/util/gpfswrap.h
@@ -34,6 +34,7 @@ int gpfswrap_putacl(char *pathname, int flags, void *acl);
 int gpfswrap_get_realfilename_path(char *pathname, char *filenamep, int *len);
 int gpfswrap_set_winattrs_path(char

[SCM] Samba Shared Repository - branch master updated

2016-03-31 Thread Jeremy Allison
The branch, master has been updated
   via  10054c4 docs: Mention _NO_WINBINDD in idmap_script.8
   via  74f0a24 docs: build idmap_script.8 by default
   via  4f65fa9 pam_winbind: Avoid a use of sprintf
   via  9d6d620 smbcquotas: print "NO LIMIT" only if returned quota value 
is 0.
   via  0e01ed0 smbd: do not cover up VFS failures to get quota
   via  0124d3e nfs-quota: do not fail on ECONNREFUSED
   via  ce82f66 xfs-quota: do not fail if user has no quota
   via  fe3 sys-quotas: do not fail if user has no quota
   via  20a0d59 ntquotas - skip entry if the quota is zero
   via  78ae852 nt-quotas: return 0 as indication of no quota
   via  fcf6527 nt-quotas: vfs_get_ntquota() return NTSTATUS
  from  d378c85 winbind: Fix a typo in a wrong comment...

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


- Log -
commit 10054c4281d73652b641921b756eaaae14964e6b
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 31 17:10:39 2016 +0200

docs: Mention _NO_WINBINDD in idmap_script.8

Thanks to Joachim Achtzehnter <joach...@netacquire.com> for pointing out 
this
flaw!

Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Mar 31 23:57:13 CEST 2016 on sn-devel-144

commit 74f0a2435b6f26135bfb4c25d297af5b2cc436c8
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 31 16:57:58 2016 +0200

docs: build idmap_script.8 by default

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4f65fa9c7b60264d71c8fe8ed715fb5c63e528ba
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 31 14:41:07 2016 +0200

pam_winbind: Avoid a use of sprintf

pam_winbind depends on talloc, which depends on libreplace, so we have 
asprintf
available.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9d6d62010be2a54b6828cc4cc9c13b5657c8b4a0
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 14:20:44 2016 +0300

smbcquotas: print "NO LIMIT" only if returned quota value is 0.

If the user being queried has no quota, the server returns 0 as
its quota. This is the observed smbd and Windows behavior, which
is also documented in [MS-FSA] 2.5.1.20.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11815

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0e01ed06a40146d145ffe439a65fb9035ab7b1cf
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 14:02:31 2016 +0300

smbd: do not cover up VFS failures to get quota

Now that the VFS follows the convention that get-quota
returns error only on error condition, and success
with zero quota if there is no quota assigned,
reply with an error if failing to obtain a user's
quota.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0124d3e6a537374c6639025934903ca03a08691e
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 13:21:58 2016 +0300

nfs-quota: do not fail on ECONNREFUSED

Trying to differentiate between "no quota" and real
error conditions - if the connection to rpc.quotad
is refused it could simply mean that the remote host
has no quota and therefore report this as success with
no quota.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit ce82f66b9fdc611124f7284e32e44ed3df2d7295
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 13:00:29 2016 +0300

xfs-quota: do not fail if user has no quota

XFS fails quotactl(Q_XGETQUOTA) with ENOENT if the user
or group has no quota assigned to it. This is not an error
condition - simply report 0 quota in this case.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fe3c57977b6041d0bac99ff696c4760fdb01
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 14:05:49 2016 +0300

sys-quotas: do not fail if user has no quota

    If the user/group has no quota, do not treat that as
error condition. Instead, return zero quota.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 20a0d59d8c1d80b66a34611bffef1d43a9e1e2b4
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Mar 30 13:59:39 2016 +0300

ntquotas - skip entry if the quota is zero

When listing user quotas, do not list the user
    if the 

[SCM] Samba Shared Repository - branch master updated

2016-03-30 Thread Jeremy Allison
The branch, master has been updated
   via  d378c85 winbind: Fix a typo in a wrong comment...
   via  0fa9f34 examples/perfcounter/perf_writer.c: fix memset
  from  3cc3406 winbind: Remove unused idmap_backends_unixid_to_sid

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


- Log -
commit d378c85f7a51936e78908c2e26552b95e87302c8
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 29 14:49:17 2016 +0200

winbind: Fix a typo in a wrong comment...

While trying to disentangle this knot I could not stand to fix the obvious
typo. The whole comment is not really the whole story anymore, but that's a
commit for another day.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Mar 30 21:54:40 CEST 2016 on sn-devel-144

commit 0fa9f347fd401baad6e2b65d5e4706f458cf5ba4
Author: Aurelien Aptel <aap...@suse.com>
Date:   Tue Mar 29 17:30:36 2016 +0200

examples/perfcounter/perf_writer.c: fix memset

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>

---

Summary of changes:
 examples/perfcounter/perf_writer.c | 2 +-
 source3/winbindd/winbindd_cache.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/perfcounter/perf_writer.c 
b/examples/perfcounter/perf_writer.c
index 4260f95..054d9e8 100644
--- a/examples/perfcounter/perf_writer.c
+++ b/examples/perfcounter/perf_writer.c
@@ -77,7 +77,7 @@ void output_perf_desc(PerfCounter counter, RuntimeSettings rt)
 void initialize(PERF_DATA_BLOCK *data, RuntimeSettings *rt, int argc, char 
**argv)
 {
 memset(data, 0, sizeof(*data));
-memset(rt, 0, sizeof(*data));
+memset(rt, 0, sizeof(*rt));
 
 parse_flags(rt, argc, argv);
 setup_file_paths(rt);
diff --git a/source3/winbindd/winbindd_cache.c 
b/source3/winbindd/winbindd_cache.c
index cf3ed71..6123e96 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -137,7 +137,7 @@ static struct winbind_cache *get_cache(struct 
winbindd_domain *domain)
}
 
/* 
-  OK.  listen up becasue I'm only going to say this once.
+  OK.  Listen up because I'm only going to say this once.
   We have the following scenarios to consider
   (a) trusted AD domains on a Samba DC,
   (b) trusted AD domains and we are joined to a non-kerberos domain


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-03-28 Thread Jeremy Allison
The branch, master has been updated
   via  aa81199 vfs_glusterfs: call clock_gettime_mono() only on 
profile-enabled build
   via  eb2ea0b vfs_aio_fork: call clock_gettime_mono() only on 
profile-enabled build
   via  7616229 vfs_aio_linux: call clock_gettime_mono() only on 
profile-enabled build
   via  98b7486 asys: call clock_gettime_mono() only on profile-enabled 
build
   via  b2ae298 s3-profile: add PROFILE_TIMESTAMP macro
   via  f1c84e4 s3-profile: reduce dependencies of smbprofile.h
   via  644e697 lib/util: fix function comment
  from  82801f9 s3: vfs: Use the new VFS functions for setting and getting 
DOS attributes.

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


- Log -
commit aa81199bec3cb5a3f8f7b990395108a6eb988815
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:20:22 2016 +0300

vfs_glusterfs: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar 29 00:12:14 CEST 2016 on sn-devel-144

commit eb2ea0bbf29a94b4fb4fbd24811448e411f8bbca
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:19:49 2016 +0300

vfs_aio_fork: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7616229e7722124fdc65f32b30a39cb1c17761a9
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:18:46 2016 +0300

vfs_aio_linux: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 98b74866e9caee14d95e363a2c9d0d2f4d4a0843
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:17:03 2016 +0300

asys: call clock_gettime_mono() only on profile-enabled build

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b2ae298526185076d123fe866406ee3719a9e3e8
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:13:50 2016 +0300

s3-profile: add PROFILE_TIMESTAMP macro

This is a get-timestamp macro which works only when
profiling is enabled in the build. The underlying
clock_gettime_mono() function can be costly on some
architectures and we want to avoid it if it's not
    necessary.
    
Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f1c84e49dbd3ba792dbc7386505b03a4545437fb
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:11:33 2016 +0300

s3-profile: reduce dependencies of smbprofile.h

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 644e697fab4af7ccc4143f8d0201cb31c91b8a3f
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 28 10:08:58 2016 +0300

lib/util: fix function comment

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/util/time.c |  2 +-
 source3/include/smbprofile.h|  7 ++-
 source3/lib/asys/asys.c | 13 +++--
 source3/modules/vfs_aio_fork.c  |  5 +++--
 source3/modules/vfs_aio_linux.c |  9 +
 source3/modules/vfs_glusterfs.c |  9 +
 source3/profile/profile.c   | 12 ++--
 source3/profile/profile_dummy.c |  2 +-
 source3/smbd/server.c   |  4 +++-
 9 files changed, 37 insertions(+), 26 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/time.c b/lib/util/time.c
index 3c709af..8c01627 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -477,7 +477,7 @@ _PUBLIC_ int64_t usec_time_diff(const struct timeval *tv1, 
const struct timeval
 }
 
 /**
-  return (tp1 - tp2) in microseconds
+  return (tp1 - tp2) in nanoseconds
 */
 _PUBLIC_ int64_t nsec_time_diff(const struct timespec *tp1, const struct 
timespec *tp2)
 {
diff --git a/source3/include/smbprofile.h b/source3/include/smbprofile.h
index c771fd4..1183af6 100644
--- a/source3/include/smbprofile.h
+++ b/source3/include/smbprofile.h
@@ -565,6 +565,8 @@ static inline uint64_t profile_timestamp(void)
 #define END_PROFILE_BYTES(x) \
SMBPROFILE_BYTES_ASYNC_END(__profasync_##x)
 
+#define PROFILE_TIMESTAMP(x) clock_gettime_mono(x)
+
 #else /* WITH_PROFILE */
 
 #define SMBPROFILE_COUNT_INCREMENT(_name, _area, _v)
@@ -595,6 +597,8 @@ static inline uint64_t profile_timestamp(void)
 #define END_PROFILE(x)
 #define END_PROFILE_BYTES(x)
 
+#define PROFILE_TIMESTAMP(x) (*(x)=(struct timespec){0})
+
 static in

[SCM] Samba Shared Repository - branch master updated

2016-03-27 Thread Jeremy Allison
The branch, master has been updated
   via  82801f9 s3: vfs: Use the new VFS functions for setting and getting 
DOS attributes.
   via  a4e6250 s3: vfs: Add VFS functions for setting and getting DOS 
attributes.
  from  9377f3b s3: smbd: DFS: Pass uint32_t ucf_flags through into 
unix_convert().

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


- Log -
commit 82801f9ec895deb9536a2b0a4e0ce4b3d5853220
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 25 15:32:09 2016 -0700

s3: vfs: Use the new VFS functions for setting and getting DOS attributes.

This will make it easier to support those systems and file systems that
can store DOS attributes.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <rsha...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Mar 27 09:23:42 CEST 2016 on sn-devel-144

commit a4e6250442bb7a4ba93cfdb373212da5493faa33
Author: Richard Sharpe <rsha...@samba.org>
Date:   Sun Mar 20 12:51:32 2016 -0700

s3: vfs: Add VFS functions for setting and getting DOS attributes.

This will make it easier to support those systems and file systems that
can store DOS attributes. It should retain the original functionality if
VFS functions providing these things are not provided.

Signed-off-by: Richard Sharpe <rsha...@samba.org>
Signed-off-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 examples/VFS/skel_opaque.c   |  34 
 examples/VFS/skel_transparent.c  |  42 +++
 source3/include/vfs.h|  29 ++
 source3/include/vfs_macros.h |  18 +++
 source3/modules/vfs_default.c|  32 +++
 source3/modules/vfs_full_audit.c |  94 +
 source3/smbd/dosmode.c   | 111 +++
 source3/smbd/proto.h |   7 +++
 source3/smbd/vfs.c   |  32 +++
 9 files changed, 353 insertions(+), 46 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index 67c387d..81ce184 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -672,6 +672,34 @@ static NTSTATUS skel_readdir_attr(struct vfs_handle_struct 
*handle,
return NT_STATUS_NOT_IMPLEMENTED;
 }
 
+static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
+   struct smb_filename *smb_fname,
+   uint32_t *dosmode)
+{
+   return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
+   struct files_struct *fsp,
+   uint32_t *dosmode)
+{
+   return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_set_dos_attributes(struct vfs_handle_struct *handle,
+   const struct smb_filename *smb_fname,
+   uint32_t dosmode)
+{
+   return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_fset_dos_attributes(struct vfs_handle_struct *handle,
+   struct files_struct *fsp,
+   uint32_t dosmode)
+{
+   return NT_STATUS_NOT_IMPLEMENTED;
+}
+
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
 uint32_t security_info,
 TALLOC_CTX *mem_ctx,
@@ -941,6 +969,12 @@ struct vfs_fn_pointers skel_opaque_fns = {
.fsctl_fn = skel_fsctl,
.readdir_attr_fn = skel_readdir_attr,
 
+   /* DOS attributes. */
+   .get_dos_attributes_fn = skel_get_dos_attributes,
+   .fget_dos_attributes_fn = skel_fget_dos_attributes,
+   .set_dos_attributes_fn = skel_set_dos_attributes,
+   .fset_dos_attributes_fn = skel_fset_dos_attributes,
+
/* NT ACL operations. */
 
.fget_nt_acl_fn = skel_fget_nt_acl,
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 9fc9438..418ee24 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -801,6 +801,42 @@ static NTSTATUS skel_readdir_attr(struct vfs_handle_struct 
*handle,
return SMB_VFS_NEXT_READDIR_ATTR(handle, fname, mem_ctx, pattr_data);
 }
 
+static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
+   struct smb_filename *smb_fname,
+   uint32_t *dosmode)
+{
+   return SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle,
+   smb_fname,
+   dosmode);
+}
+
+static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
+ 

[SCM] Samba Shared Repository - branch master updated

2016-03-25 Thread Jeremy Allison
The branch, master has been updated
   via  9377f3b s3: smbd: DFS: Pass uint32_t ucf_flags through into 
unix_convert().
   via  6156c82 s3: smbd: DFS: Pass uint32_t ucf_flags through into 
dfs_redirect().
   via  b96ae7c s3: smbd: DFS: Pass uint32_t ucf_flags through into 
resolve_dfspath_wcard().
  from  94464ed pam_winbind: Create and use a wbclient context

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


- Log -
commit 9377f3bce0866e2fadeea5ba87f7ee41f7d9ba31
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 25 11:34:30 2016 -0700

s3: smbd: DFS: Pass uint32_t ucf_flags through into unix_convert().

This allows vendors to ensure that flags such as UCF_PREP_CREATEFILE
are always passed to their VFS modules whilst smbd is doing pathname
lookup - even before the create VFS call is done.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <realrichardsha...@gmail.com>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Mar 26 00:08:40 CET 2016 on sn-devel-144

commit 6156c825bbb803cb70a03b0fe22d2576d82bab30
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 25 11:26:39 2016 -0700

s3: smbd: DFS: Pass uint32_t ucf_flags through into dfs_redirect().

Eventually move this down to the call to unix_convert()
inside the DFS code.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <realrichardsha...@gmail.com>

commit b96ae7c69e48ecfc147b032d3d6e00a1ce65d226
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 25 11:23:29 2016 -0700

s3: smbd: DFS: Pass uint32_t ucf_flags through into resolve_dfspath_wcard().

Eventually move this down to the call to unix_convert()
    inside the DFS code.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <realrichardsha...@gmail.com>

---

Summary of changes:
 source3/smbd/filename.c |  3 +--
 source3/smbd/msdfs.c| 17 +++--
 source3/smbd/proto.h|  2 +-
 source3/smbd/trans2.c   |  2 +-
 4 files changed, 14 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index 7271466..89c8bd6 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -1401,7 +1401,6 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
struct smb_filename **pp_smb_fname)
 {
NTSTATUS status;
-   bool allow_wcards = (ucf_flags & 
(UCF_COND_ALLOW_WCARD_LCOMP|UCF_ALWAYS_ALLOW_WCARD_LCOMP));
char *fname = NULL;
 
*pp_smb_fname = NULL;
@@ -1409,7 +1408,7 @@ static NTSTATUS filename_convert_internal(TALLOC_CTX *ctx,
status = resolve_dfspath_wcard(ctx, conn,
dfs_path,
name_in,
-   allow_wcards,
+   ucf_flags,
!conn->sconn->using_smb2,
,
ppath_contains_wcard);
diff --git a/source3/smbd/msdfs.c b/source3/smbd/msdfs.c
index cab6ff3..51e3dff 100644
--- a/source3/smbd/msdfs.c
+++ b/source3/smbd/msdfs.c
@@ -669,7 +669,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
const char *dfspath, /* Incoming complete dfs path */
const struct dfs_path *pdp, /* Parsed out
   server+share+extrapath. */
-   bool search_flag, /* Called from a findfirst ? */
+   uint32_t ucf_flags,
int *consumedcntp,
char **pp_targetpath)
 {
@@ -691,7 +691,7 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
 */
 
status = unix_convert(ctx, conn, pdp->reqpath, _fname,
- search_flag ? UCF_ALWAYS_ALLOW_WCARD_LCOMP : 0);
+ ucf_flags);
 
if (!NT_STATUS_IS_OK(status)) {
if (!NT_STATUS_EQUAL(status,
@@ -707,7 +707,10 @@ static NTSTATUS dfs_path_lookup(TALLOC_CTX *ctx,
 
if (is_msdfs_link_internal(ctx, conn, smb_fname->base_name,
   pp_targetpath, NULL)) {
-   if (search_flag) {
+   /* XX_ALLOW_WCARD_XXX is called from search functions. */
+   if (ucf_flags &
+   (UCF_COND_ALLOW_WCARD_LCOMP|
+UCF_ALWAYS_ALLOW_WCARD_LCOMP)) {
DEBUG(6,("dfs_path_lookup (FindFirst) No redirection "
 "for dfs link %s.\n", dfspath));
status = NT_STATUS_OK;
@@ -817,12 +820,

[SCM] Samba Shared Repository - branch master updated

2016-03-24 Thread Jeremy Allison
The branch, master has been updated
   via  8151ac2 s3: torture. Remove spurious lp_posix_pathnames() included 
by cut-and-paste error.
   via  6ae59eb s3: smbd: Modify vfs_stat_smb_basename() to take a const 
struct smb_filename * instead of const char *.
   via  125a1b5 s3: vfs: vfs_acl_tdb. Remove use of vfs_stat_smb_basename().
   via  f9dc022 s3: vfs: recycle. Remove use of vfs_stat_smb_basename().
   via  ce75fbf s3: smbd: Remove many common uses of lp_posix_pathnames().
   via  be56fff s3: smbd: Remove unneeded lp_posix_pathnames() check in 
SMB2 create.
   via  0f245c5 s3: posix_acls. Always use STAT, not LSTAT here.
   via  91c385c s3: vfs: Remove use of lp_posix_pathnames() below the VFS.
   via  dc5dad4 s3: Filenames: Add uint32_t flags parameter to 
synthetic_smb_fname().
   via  2e302d7 s3: smbd: Add uint32_t flags field to struct smb_filename.
   via  09325a0 s3:smbd: Move lp_posix_pathnames() out of 
ea_list_has_invalid_name().
   via  feb297c s3: vfs: vfs_afsacl. refuse_symlink() means we can always 
use STAT here.
   via  8d8c204 s3:smbd: Fix build for vfs_afsacl.c.
   via  8c90799 Fix an obvious error where we were converting a UNIX error 
to an NT STATUS but not returning it.
  from  5dccb19 selftest/Samba3: use the correct 
"SELFTEST_WINBINDD_SOCKET_DIR" for "net join"

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


- Log -
commit 8151ac21108374cd5b97cc22a81fe9097df8ee23
Author: Jeremy Allison <j...@samba.org>
Date:   Sat Mar 19 21:07:01 2016 -0700

s3: torture. Remove spurious lp_posix_pathnames() included by cut-and-paste 
error.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Mar 25 02:23:56 CET 2016 on sn-devel-144

commit 6ae59eb6d1d2b4a9f3a7c1094c18abe6594aace2
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 22:17:30 2016 -0700

s3: smbd: Modify vfs_stat_smb_basename() to take a const struct 
smb_filename * instead of const char *.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 125a1b50ab2532614cb7e53b2e2979666b02702f
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 22:15:12 2016 -0700

s3: vfs: vfs_acl_tdb. Remove use of vfs_stat_smb_basename().
    
We only need a basic STAT here.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit f9dc02266c799d87f1dba7147f41b6946e0ba4c0
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 22:10:34 2016 -0700

s3: vfs: recycle. Remove use of vfs_stat_smb_basename().

We only need a basic STAT here.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit ce75fbf4e3e59f6be131807e198045485646855f
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 21:58:20 2016 -0700

s3: smbd: Remove many common uses of lp_posix_pathnames().

Check the smb_filename->flags field, or req->posix_pathnames
instead, depending on what is available.

Signed-off-by: Jeremy Allison <j...@samba.org>
    Reviewed-by: Uri Simchoni <u...@samba.org>

commit be56fffe4b83ed14a5e84a5023d5c7a826911261
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 21:55:05 2016 -0700

s3: smbd: Remove unneeded lp_posix_pathnames() check in SMB2 create.
    
Add a comment reminding me to re-add the check when SMB2
unix extensions are re-added.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 0f245c5ff4f175873f94b108b506527ee06d2a28
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 21:50:15 2016 -0700

s3: posix_acls. Always use STAT, not LSTAT here.

We have already refused acls on a symlink.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 91c385cfd3420873ad87731da0742e4d07bc4020
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 21:31:22 2016 -0700

s3: vfs: Remove use of lp_posix_pathnames() below the VFS.

We don't have access to a struct smb_filename here and
can't get one, so simply always set AT_SYMLINK_NOFOLLOW
and remove the optimization if we ended up fstatat()'ing
a symlink, as we don't know if the caller wanted a link
stat or not.
    
Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit dc5dad48139a3dcb4544e4f31aabe269f6401849
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Mar 18 21:19:38 2016 -0700

   

[SCM] Samba Shared Repository - branch master updated

2016-03-23 Thread Jeremy Allison
The branch, master has been updated
   via  725bef6 s4:torture:smb2:rename.c: Fix file permissions.
   via  099c6f3 seltest: add test for "ignore system acls" in vfs_acl_xattr.
   via  765e5f1 vfs_acl_common: avoid setting POSIX ACLs if "ignore system 
acls" is set
  from  acdfa98 s4-libnet: only build python-dckeytab module for Heimdal in 
AD DC mode

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


- Log -
commit 725bef6f5883a86460221ad114ee582050f091f1
Author: Günther Deschner <g...@samba.org>
Date:   Wed Mar 23 14:41:23 2016 +0100

s4:torture:smb2:rename.c: Fix file permissions.

Guenther

Signed-off-by: Günther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Mar 24 06:33:03 CET 2016 on sn-devel-144

commit 099c6f325265a8820e876c83f1d204bcf09e0242
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 21 23:13:25 2016 +0200

seltest: add test for "ignore system acls" in vfs_acl_xattr.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11806

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 765e5f1f2670d3d5d8d62a04b4ccf38a680bcb37
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Mar 21 23:04:24 2016 +0200

vfs_acl_common: avoid setting POSIX ACLs if "ignore system acls" is set

When "ignore system acls" is set, do not mess at all with POSIX ACLS,
do not even calculate the would-be POSIX-ACL-based security descriptor
(for performance reasons).
Instead, just store a V3 blob with zero hash. This means that if we
later read the ACL without ignoring system ACLs, the NT ACL shall be
reset to the info derivable from the POSIX ACL.

File ownership is still modified as it has bearing on disk quotas.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11806

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 selftest/selftesthelpers.py|   1 +
 selftest/target/Samba3.pm  |   4 +
 source3/modules/vfs_acl_common.c   | 147 ++---
 source3/script/tests/test_acl_xattr.sh | 125 
 source3/selftest/tests.py  |   1 +
 source4/torture/smb2/rename.c  |   0
 6 files changed, 230 insertions(+), 48 deletions(-)
 create mode 100755 source3/script/tests/test_acl_xattr.sh
 mode change 100755 => 100644 source4/torture/smb2/rename.c


Changeset truncated at 500 lines:

diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index f26484b..495a0b7 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -186,3 +186,4 @@ vfstest = binpath('vfstest')
 smbcquotas = binpath('smbcquotas')
 smbget = binpath('smbget')
 rpcclient = binpath('rpcclient')
+smbcacls = binpath('smbcacls')
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 5dc4b17..0b16e03 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -649,6 +649,10 @@ sub setup_fileserver($$)
path = $smbget_sharedir
comment = smb username is [%U]
guest ok = yes
+[ign_sysacls]
+   path = $share_dir
+   comment = ignore system acls
+   acl_xattr:ignore system acls = yes
 ";
 
my $vars = $self->provision($path,
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index c8c0650..d21c167 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -745,6 +745,81 @@ static NTSTATUS get_nt_acl_common(vfs_handle_struct 
*handle,
 }
 
 /*
+ Set the underlying ACL (e.g. POSIX ACLS, POSIX owner, etc)
+*/
+static NTSTATUS set_underlying_acl(vfs_handle_struct *handle, files_struct 
*fsp,
+  struct security_descriptor *psd,
+  uint32_t security_info_sent,
+  bool chown_needed)
+{
+   NTSTATUS status =
+   SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
+   if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED)) {
+   return status;
+   }
+
+   /* We got access denied here. If we're already root,
+  or we didn't need to do a chown, or the fsp isn't
+  open with WRITE_OWNER access, just return. */
+   if (get_current_uid(handle->conn) == 0 || chown_needed == false ||
+   !(fsp->access_mask & SEC_STD_WRITE_OWN

[SCM] Samba Shared Repository - branch master updated

2016-03-22 Thread Jeremy Allison
The branch, master has been updated
   via  fb381d8 torture: Fix the O3 developer build
  from  ef1ad0e s3:ntlm_auth: pass manage_squid_request() needs a valid 
struct ntlm_auth_state from within get_password()

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


- Log -
commit fb381d885b0367c0b6f163ce1661b4cc4ae5f5ed
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 22 16:03:58 2016 +0100

torture: Fix the O3 developer build

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar 22 22:48:52 CET 2016 on sn-devel-144

---

Summary of changes:
 source4/torture/smb2/replay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 91bb568..26b5583 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -1497,7 +1497,7 @@ static bool test_channel_sequence_table(struct 
torture_context *tctx,
bool do_replay,
uint16_t opcode)
 {
-   NTSTATUS status;
+   NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
TALLOC_CTX *mem_ctx = talloc_new(tctx);
struct smb2_handle handle;
struct smb2_handle *phandle = NULL;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-03-21 Thread Jeremy Allison
The branch, master has been updated
   via  e9586a6 torture:smb2: add durable-v2-open.reopen1a-lease
   via  b853040 torture:smb2: for oplocks, durable reconnect works with 
different client-guid
   via  cd22980 torture:smb2: get rid of supefluous io2 var in 
durable-v2-open.reopen1a
   via  b0f592d torture:smb2: fix crashes in smb2.durable-v2-open.reopen1a 
test
   via  186cd70 torture:smb2: use assert, not warning in error case in 
durable-v2-open.reopen1a
   via  3e90abe torture:smb2: add durable-open.reopen1a-lease
   via  7b55761 torture:smb2: for oplocks, durable reconnect works with 
different client guid
   via  505546b torture:smb2: durable-open.reopen1a only needs one io struct
   via  37c05f4 torture:smb2: fix crashes in smb2.durable-open.reopen1a test
   via  b7186a0 torture:smb2: use assert, not warning in error case in 
durable-open.reopen1a
   via  e095a61 torture:smb2: Add test replay6 to verify Error Codes for 
DurableHandleReqV2 replay
   via  c5c3f91 lib/torture: add torture_assert_u64_not_equal_goto macro
   via  2b79988 torture:smb2: add test for checking sequence number wrap 
around.
   via  ccda60e libcli:smb:smbXcli_base: add 
smb2cli_session_current_channel_sequence() call.
   via  f81f3a2 smbd:smb2: add some asserts before decrementing the counters
   via  7dbb170 smbd:smb2: update outstanding request counters before 
sending a reply
   via  71d2b19 smbd:smb2: implement channel sequence checks and request 
counters in dispatch
   via  ae6967e smbd:smb2: add request_counters_updated to the 
smbd_smb2_request struct
   via  0884681 smbd:smb2: add a modify flag to dispatch table
   via  31f33a3 s3:smbXsrv.idl: add 8 byte channel_sequence number and 
request counters to IDL.
   via  b9d93e7 lib: Update nss_wrapper to version 1.1.3
   via  9e8876a lib: Update uid_wrapper to version 1.2.1
   via  092d6f9 lib: Update socket_wrapper to version 1.1.6
   via  e4f5925 ctdb-daemon: Replace an unsafe strcpy(3) call
   via  0ffa5d8 ctdb-daemon: Validate length of new interface names
  from  e806824 ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);

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


- Log -
commit e9586a653c62b996f1a183c897308ea0794c1cb7
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 09:06:56 2016 +0100

torture:smb2: add durable-v2-open.reopen1a-lease

Lease variant of the reopen1a test which tests the
relevance of the client guid.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar 22 03:47:02 CET 2016 on sn-devel-144

commit b853040d5f27f0faf8d9a6071e6e6e6b2f840360
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 09:02:28 2016 +0100

torture:smb2: for oplocks, durable reconnect works with different 
client-guid

for durable-v2-open.reopen1a

Try both different and original client guid.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cd2298087583de8d6b352dbbbecb00b1dbffe25c
Author: Michael Adam <ob...@samba.org>
Date:   Thu Mar 17 02:35:35 2016 +0100

torture:smb2: get rid of supefluous io2 var in durable-v2-open.reopen1a

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b0f592d05f66114427b26cd4aeea918e41a2e952
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 09:44:06 2016 +0100

torture:smb2: fix crashes in smb2.durable-v2-open.reopen1a test

If the test failed too early, we dereferenced tree2 which
was still NULL.

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 186cd708291641c507cda0c89cc9c24900634ed2
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 09:39:43 2016 +0100

torture:smb2: use assert, not warning in error case in 
durable-v2-open.reopen1a
    
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3e90abe6704a1af62ce22a6e62539a28a8abfe22
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 10:02:14 2016 +0100

torture:smb2: add durable-open.reopen1a-lease

Lease variant of the reopen1a test which tests the
relevance of the client guid.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7b557617e48e17c2f02801fcd089719f7994488b
Author: Michael Adam <ob...@samba.org>
Date:   Tue Mar 15 08:59:53 2016 +0100

torture:smb2: for oplocks, durable reconnect works with different client 
guid

in dura

[SCM] Samba Shared Repository - branch master updated

2016-03-19 Thread Jeremy Allison
The branch, master has been updated
   via  44f3dde smbd: fix use after free via conn->fsp_fi_cache
   via  a16379c idmap_hash: only allow the hash module for default idmap 
config.
   via  4172491 idmap_hash: rename be_init() --> idmap_hash_initialize()
   via  4632ad9 s3:winbindd:idmap: check loadparm in 
domain_has_idmap_config() helper as well.
   via  55be1ee s3:winbindd:idmap_hash: skip domains that already have 
their own idmap configuration.
   via  fb80e11 s3:winbindd:idmap: add domain_has_idmap_config() helper 
function.
   via  228ab34 build: fix build when --without-quota specified
   via  67a29a8 smbd: remove quota support for some ancient OSs
  from  7d46ea4 samba3.blackbox.smbclient_auth.plain: Add new regression 
test case.

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


- Log -
commit 44f3dde85740d2b9462df2ed76da41dae0774470
Author: Michael Adam <ob...@samba.org>
Date:   Wed Mar 16 23:57:33 2016 +0100

smbd: fix use after free via conn->fsp_fi_cache

Some instrumentation of the the durable reconnect
code uncovered a problem in the fsp_new, fsp_free pair:

vfs_default_durable_reconnect():
  fsp_new() ==> this does DLIST_ADD(fsp->conn->sconn->files, fsp)
  if (fsp->oplock_type == LEASE_OPLOCK) {
find_fsp_lease(fsp, , l) ==> this fills conn->fsp_fi_cache
if (client guids not equal) {
  fsp_free(fsp) ==> this does DLIST_REMOVE(fsp->conn->sconn->files, fsp)
  }

so after this code we have the fsp_fi_cache still pointing to the
free'd memory. The next call to find_fsp_lease will use the cache
and hence access the freed memory.

The fix consists in invalidating the cache in fsp_free() instead
of just in its wrapper file_free().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11799

Pair-Programmed-With: Guenther Deschner <g...@samba.org>

Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Mar 17 04:31:10 CET 2016 on sn-devel-144

commit a16379c585a6f6e9470a8745b6043be8171eb615
Author: Michael Adam <ob...@samba.org>
Date:   Mon Mar 14 17:07:34 2016 +0100

idmap_hash: only allow the hash module for default idmap config.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786

This module only makes sense as the default idmap config
("idmap config * : backend = hash" ...)

Pair-Programmed-With: Guenther Deschner <g...@samba.org>

Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4172491cbe7bb8ad2a7089efe15fbe46fcc123fb
Author: Michael Adam <ob...@samba.org>
Date:   Mon Mar 14 17:06:34 2016 +0100

idmap_hash: rename be_init() --> idmap_hash_initialize()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786

Pair-Programmed-With: Guenther Deschner <g...@samba.org>

    Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4632ad98c4af5a4e0a2723c0cf716439e376e61f
Author: Günther Deschner <g...@samba.org>
Date:   Thu Mar 10 12:21:52 2016 +0100

s3:winbindd:idmap: check loadparm in domain_has_idmap_config() helper as 
well.

Guenther

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786

Pair-Programmed-With: Michael Adam <ob...@samba.org>

Signed-off-by: Guenther Deschner <g...@samba.org>
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 55be1ee69743c94d33f4244ade848517fc98e264
Author: Günther Deschner <g...@samba.org>
Date:   Thu Mar 10 10:39:15 2016 +0100

s3:winbindd:idmap_hash: skip domains that already have their own idmap 
configuration.

Check if the domain from the list is not already configured to use another 
idmap
backend. Not checking this makes the idmap_hash module map IDs for *all* 
domains
implicitly. This is quite dangeorous in multi-idmap-config setups.

Guenther

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11786
    
    Pair-Programmed-With: Michael Adam <ob...@samba.org>

Signed-off-by: Guenther Deschner <g...@samba.org>
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fb80e1158bb1a14f2602e65464909a213296cde1
Author: Michael Adam <ob...@samba.org>
Date:   Thu Mar 10 10:38:29 2016 +0100

 

[SCM] NSS Wrapper Repository - branch master updated

2016-03-19 Thread Jeremy Allison
The branch, master has been updated
   via  962cf22 nwrap: Use snprintf() instead of strcpy()
   via  79f1b29 tests: Add testing for BSD 'struct passwd' members
   via  7df4b1c nwrap: Support FreeBSD 'struct passwd' members
  from  03018f8 Bump version to 1.1.2

https://git.samba.org/?p=nss_wrapper.git;a=shortlog;h=master


- Log -
commit 962cf22a01f07008bb80711f48afaafc9b3bc087
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Mar 16 18:13:00 2016 +0100

nwrap: Use snprintf() instead of strcpy()

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 79f1b29e5daafbb6e624bbee3700ce07e39f72fd
Author: Andreas Schneider <a...@samba.org>
Date:   Thu Jan 21 13:51:08 2016 +0100

tests: Add testing for BSD 'struct passwd' members

Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7df4b1c2bcc2fc96d1203c6814472fe77c9c82a0
Author: Andreas Schneider <a...@samba.org>
Date:   Thu Jan 21 13:47:27 2016 +0100

nwrap: Support FreeBSD 'struct passwd' members

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ConfigureChecks.cmake |  3 +++
 config.h.cmake|  4 
 src/nss_wrapper.c | 34 --
 tests/testsuite.c | 12 
 4 files changed, 51 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 1b6ba01..462b166 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -191,6 +191,9 @@ check_prototype_definition(getnameinfo
 
 # STRUCT MEMBERS
 check_struct_has_member("struct sockaddr" sa_len "sys/socket.h netinet/in.h" 
HAVE_STRUCT_SOCKADDR_SA_LEN)
+check_struct_has_member("struct passwd" pw_class "pwd.h" 
HAVE_STRUCT_PASSWD_PW_CLASS)
+check_struct_has_member("struct passwd" pw_change "pwd.h" 
HAVE_STRUCT_PASSWD_PW_CHANGE)
+check_struct_has_member("struct passwd" pw_expire "pwd.h" 
HAVE_STRUCT_PASSWD_PW_EXPIRE)
 
 # IPV6
 check_c_source_compiles("
diff --git a/config.h.cmake b/config.h.cmake
index f00c2a4..75c92ed 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -86,6 +86,10 @@
 #cmakedefine HAVE_LINUX_GETNAMEINFO_UNSIGNED 1
 
 #cmakedefine HAVE_STRUCT_SOCKADDR_SA_LEN 1
+#cmakedefine HAVE_STRUCT_PASSWD_PW_CLASS 1
+#cmakedefine HAVE_STRUCT_PASSWD_PW_CHANGE 1
+#cmakedefine HAVE_STRUCT_PASSWD_PW_EXPIRE 1
+
 #cmakedefine HAVE_IPV6 1
 
 #cmakedefine HAVE_ATTRIBUTE_PRINTF_FORMAT 1
diff --git a/src/nss_wrapper.c b/src/nss_wrapper.c
index c4f1b33..82581b1 100644
--- a/src/nss_wrapper.c
+++ b/src/nss_wrapper.c
@@ -154,6 +154,14 @@ typedef nss_status_t NSS_STATUS;
 #define SAFE_FREE(x) do { if ((x) != NULL) {free(x); (x)=NULL;} } while(0)
 #endif
 
+#ifndef discard_const
+#define discard_const(ptr) ((void *)((uintptr_t)(ptr)))
+#endif
+
+#ifndef discard_const_p
+#define discard_const_p(type, ptr) ((type *)discard_const(ptr))
+#endif
+
 #ifdef HAVE_IPV6
 #define NWRAP_INET_ADDRSTRLEN INET6_ADDRSTRLEN
 #else
@@ -1963,6 +1971,28 @@ static bool nwrap_pw_parse_line(struct nwrap_cache 
*nwrap, char *line)
 
NWRAP_LOG(NWRAP_LOG_TRACE, "gid[%u]\n", pw->pw_gid);
 
+#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
+   pw->pw_class = discard_const_p(char, "");
+
+   NWRAP_LOG(NWRAP_LOG_TRACE, "class[%s]", pw->pw_class);
+#endif /* HAVE_STRUCT_PASSWD_PW_CLASS */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
+   pw->pw_change = 0;
+
+   NWRAP_LOG(NWRAP_LOG_TRACE,
+ "change[%lu]",
+ (unsigned long)pw->pw_change);
+#endif /* HAVE_STRUCT_PASSWD_PW_CHANGE */
+
+#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
+   pw->pw_expire = 0;
+
+   NWRAP_LOG(NWRAP_LOG_TRACE,
+ "expire[%lu]",
+ (unsigned long)pw->pw_expire);
+#endif /* HAVE_STRUCT_PASSWD_PW_EXPIRE */
+
/* gecos */
p = strchr(c, ':');
if (!p) {
@@ -5421,7 +5451,7 @@ static int nwrap_getnameinfo(const struct sockaddr *sa, 
socklen_t salen,
if (he != NULL && he->h_name != NULL) {
if (strlen(he->h_name) >= hostlen)
return EAI_OVERFLOW;
-   strcpy(host, he->h_name);
+   snprintf(host, hostlen, "%s", he->h_name);
if (flags & NI_NOFQDN)
host[strcspn(host, ".")] = '\0';
} else {
@@ -5439,7 +5469,7 @@ static int nwrap_getnameinfo(const struct sockaddr *sa, 
socklen_t salen,
 

[SCM] Samba Shared Repository - branch master updated

2016-03-19 Thread Jeremy Allison
The branch, master has been updated
   via  3563d79 s3:mdssvc: older glib2 versions require g_type_init()
   via  f50c3fb libsmb: Fix CID 1356312 Explicit null dereferenced
   via  deaab95 ctdb: Fix CID 1356313 Explicit null dereferenced
   via  a243a90 lib: Fix CID 1356315 Dereference before null check
   via  3940d4e crypto: Fix CID 1356314 Resource leak
   via  dcaa881 libads: Fix CID 1356316 Uninitialized pointer read
  from  c06058a s3-auth: check for return code of 
cli_credentials_set_machine_account().

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


- Log -
commit 3563d79a8cb625ae78523cb32330c9f61c6c3a2f
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Mar 17 14:05:58 2016 +0100

s3:mdssvc: older glib2 versions require g_type_init()

Older glib2 versions will crash if g_type_init is not called:

(process:6712): GLib-GObject-CRITICAL **: ... ./gobject/gtype.c:2722:
You forgot to call g_type_init()

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11801

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Mar 18 03:52:55 CET 2016 on sn-devel-144

commit f50c3fb1c58700522f1b742539dab9bd9ae7fd39
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 15 21:00:30 2016 +0100

libsmb: Fix CID 1356312 Explicit null dereferenced

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit deaab95b8dbd412e744b3d2c75e64931d2417969
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 15 20:55:37 2016 +0100

ctdb: Fix CID 1356313 Explicit null dereferenced

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a243a9012feab3c8d0baf3302a285ccd69190344
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 15 20:48:19 2016 +0100

lib: Fix CID 1356315 Dereference before null check

    Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3940d4e386cc641eba28bf23ac48c0a443de0877
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 15 20:38:02 2016 +0100

crypto: Fix CID 1356314 Resource leak

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit dcaa88158e6f0a9964ad051b4062d82e9f279b8c
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Mar 15 20:34:27 2016 +0100

libads: Fix CID 1356316 Uninitialized pointer read

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ctdb/server/ctdb_tunables.c| 14 --
 lib/krb5_wrap/krb5_samba.c |  7 ++-
 source3/libads/sasl.c  |  2 +-
 source3/librpc/crypto/gse_krb5.c   |  3 +++
 source3/libsmb/cliconnect.c|  5 +
 source3/rpc_server/mdssvc/mdssvc.c |  5 -
 6 files changed, 23 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c
index 4e14279..4559aed 100644
--- a/ctdb/server/ctdb_tunables.c
+++ b/ctdb/server/ctdb_tunables.c
@@ -199,19 +199,21 @@ int32_t ctdb_control_list_tunables(struct ctdb_context 
*ctdb, TDB_DATA *outdata)
int i;
struct ctdb_control_list_tunable *t;
 
+   list = talloc_strdup(outdata, ":");
+   CTDB_NO_MEMORY(ctdb, list);
+
for (i=0; i<ARRAY_SIZE(tunable_map); i++) {
if (tunable_map[i].obsolete) {
continue;
}
-   if (list == NULL) {
-   list = talloc_strdup(outdata, tunable_map[i].name);
-   } else {
-   list = talloc_asprintf_append(list, ":%s",
- tunable_map[i].name);
-   }
+   list = talloc_asprintf_append(list, "%s:",
+ tunable_map[i].name);
CTDB_NO_MEMORY(ctdb, list);
}
 
+   /* cut the last ':' */
+   list[strlen(list)-1] = '\0';
+
outdata->dsize = offsetof(struct ctdb_control_list_tunable, data) +
strlen(list) + 1;
outdata->dptr = talloc_size(outdata, outdata->dsize);
diff --git a/lib/krb5_wrap/krb5_samba.c b/lib/krb5_wrap/krb5_samba.c
index 9ee71f5..247b83b 100644
--- a/lib/krb5_wrap/krb5_samba.c
+++ b/lib/krb5_wrap/krb5_samba.c
@@ -1628,12 +1628,9 @@ out:
if (memcmp(_kt_entry, _entry, sizeof(krb5_keytab_entry))

[SCM] Samba Shared Repository - branch master updated

2016-03-18 Thread Jeremy Allison
The branch, master has been updated
   via  e806824 ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);
   via  ac4dc0c s3/vfs:stream_depots: Parse substitutions in 
streams-depot-directory path
  from  e8e2386 s4:selftest: run rpc.netlogon.admin also over ncalrpc and 
ncacn_ip_tcp

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


- Log -
commit e806824fc8841553102eefdd748b5c6d261f1bb7
Author: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
Date:   Wed Mar 16 12:46:12 2016 +1300

ldb client controls: avoid talloc_memdup(x, y, (size_t)-1);

ldb_base64_decode() returns -1 if a string can't be parsed as base64,
and this is not the kind of value you want to use in talloc_memdup().

In these cases it can happen innocently if the strings are truncated
to fit in their buffers.

Signed-off-by: Douglas Bagnall <douglas.bagn...@catalyst.net.nz>
Reviewed-by:  Volker Lendecke <volker.lende...@sernet.de>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Mar 19 00:56:42 CET 2016 on sn-devel-144

commit ac4dc0c678dddf1eab977dddfc4344d835be7824
Author: Shyamsunder Rathi <shyam.ra...@nutanix.com>
Date:   Thu Mar 10 12:37:49 2016 -0800

s3/vfs:stream_depots: Parse substitutions in streams-depot-directory path

At present, substitutions in the streams directory path are ignored. Fix it
by modifying 'stream_dir' function to call 'lp_parm_talloc_string' which
internally calls 'lp_string' on the path.

Signed-off-by: Shyamsunder Rathi <shyam.ra...@nutanix.com>
Reviewed-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/ldb/common/ldb_controls.c   | 31 +++
 source3/modules/vfs_streams_depot.c | 10 --
 2 files changed, 35 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_controls.c b/lib/ldb/common/ldb_controls.c
index 7da0cf0..0fdd13a 100644
--- a/lib/ldb/common/ldb_controls.c
+++ b/lib/ldb/common/ldb_controls.c
@@ -507,8 +507,16 @@ struct ldb_control *ldb_parse_control_from_string(struct 
ldb_context *ldb, TALLO
control->match.byOffset.contentCount = cc;
}
if (ctxid[0]) {
-   control->ctxid_len = ldb_base64_decode(ctxid);
-   control->contextId = talloc_memdup(control, ctxid, 
control->ctxid_len);
+   int len = ldb_base64_decode(ctxid);
+   if (len < 0) {
+   ldb_set_errstring(ldb,
+ "invalid VLV context_id\n");
+   talloc_free(ctrl);
+   return NULL;
+   }
+   control->ctxid_len = len;
+   control->contextId = talloc_memdup(control, ctxid,
+  control->ctxid_len);
} else {
control->ctxid_len = 0;
control->contextId = NULL;
@@ -552,7 +560,14 @@ struct ldb_control *ldb_parse_control_from_string(struct 
ldb_context *ldb, TALLO
control->flags = flags;
control->max_attributes = max_attrs;
if (*cookie) {
-   control->cookie_len = ldb_base64_decode(cookie);
+   int len = ldb_base64_decode(cookie);
+   if (len < 0) {
+   ldb_set_errstring(ldb,
+ "invalid dirsync cookie\n");
+   talloc_free(ctrl);
+   return NULL;
+   }
+   control->cookie_len = len;
control->cookie = (char *)talloc_memdup(control, 
cookie, control->cookie_len);
} else {
control->cookie = NULL;
@@ -597,7 +612,15 @@ struct ldb_control *ldb_parse_control_from_string(struct 
ldb_context *ldb, TALLO
control->flags = flags;
control->max_attributes = max_attrs;
if (*cookie) {
-   control->cookie_len = ldb_base64_decode(cookie);
+   int len = ldb_base64_decode(cookie);
+   if (len < 0) {
+   ldb_set_errstring(ldb,
+ "invalid dirsync_ex cookie"
+

[SCM] Samba Shared Repository - branch master updated

2016-03-14 Thread Jeremy Allison
The branch, master has been updated
   via  e3be771 build: improve comments in tests/oldquotas.c
   via  faf7185 s3:vfs: Change smbacl4_GetFileOwner() to take const struct 
smb_filename * from const char *.
   via  377c7b3 s3:smbd:vfs: Change posix_get_nt_acl() from const char * to 
const struct smb_filename *.
   via  cb70165 s3:smbd:vfs: Change smb_get_nt_acl_nfs4() to take a const 
struct smb_filename *.
   via  6d9e7ad s3:smbd: Fix build for vfs_aixacl2.c.
   via  fca72bf s3: smbd: Remove the last lp_posix_pathnames() in the 
rename path.
  from  b7a050d smbd:smb2: remove an unnecessary !! cast.

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


- Log -
commit e3be771f24cb427be298e0d463ebf2f3a7704d15
Author: Uri Simchoni <u...@samba.org>
Date:   Sun Mar 13 07:17:23 2016 +0200

build: improve comments in tests/oldquotas.c

Add comments to #else and #endif

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar 15 02:18:15 CET 2016 on sn-devel-144

commit faf7185fe407a973c9ae02cbb5f64f199beff8b0
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Mar 10 16:17:32 2016 -0800

s3:vfs: Change smbacl4_GetFileOwner() to take const struct smb_filename * 
from const char *.

Preparing to remove vfs_stat_smb_basename() call.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

commit 377c7b311e427a302b27f3512373e881de432081
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Mar 10 16:05:48 2016 -0800

s3:smbd:vfs: Change posix_get_nt_acl() from const char * to const struct 
smb_filename *.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

commit cb7016594ae67d8f1c0195cf215a5cf1dd12cd9c
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Mar 10 15:56:51 2016 -0800

s3:smbd:vfs: Change smb_get_nt_acl_nfs4() to take a const struct 
smb_filename *.

Push the struct further down closer to places that use
lp_posix_pathname() functions.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

commit 6d9e7ad3de6541b1434b0798a1162816f4967134
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Mar 10 15:34:58 2016 -0800

s3:smbd: Fix build for vfs_aixacl2.c.

Missed conversion of get_nt_acl_fn from const char *
to const struct smb_filename *.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

commit fca72bf4f6dc6a3d82d10e4b865472d9819de136
Author: Jeremy Allison <j...@samba.org>
Date:   Thu Mar 10 15:15:34 2016 -0800

s3: smbd: Remove the last lp_posix_pathnames() in the rename path.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

---

Summary of changes:
 source3/modules/nfs4_acls.c | 15 ++--
 source3/modules/nfs4_acls.h |  2 +-
 source3/modules/vfs_aixacl2.c   | 23 --
 source3/modules/vfs_default.c   |  2 +-
 source3/modules/vfs_gpfs.c  |  4 ++--
 source3/modules/vfs_nfs4acl_xattr.c |  2 +-
 source3/modules/vfs_zfsacl.c|  2 +-
 source3/smbd/posix_acls.c   | 48 ++---
 source3/smbd/proto.h|  9 +++
 source3/smbd/reply.c|  2 +-
 tests/oldquotas.c   | 40 +++
 11 files changed, 85 insertions(+), 64 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index 26a98b7..349b26b 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -268,13 +268,13 @@ bool smbacl4_set_controlflags(struct SMB4ACL_T *acl, 
uint16_t controlflags)
 }
 
 static int smbacl4_GetFileOwner(struct connection_struct *conn,
-   const char *filename,
+   const struct smb_filename *smb_fname,
SMB_STRUCT_STAT *psbuf)
 {
ZERO_STRUCTP(psbuf);
 
/* Get the stat struct for the owner info. */
-   if (vfs_stat_smb_basename(conn, filename, psbuf) != 0)
+   if (vfs_stat_smb_basename(conn, smb_fname->base_name, psbuf) != 0)
{
DEBUG(8, ("vfs_stat_smb_basename failed with error %s\n",
strerror(errno)));
@@ -290,7 +290,7 @@ static int smbacl4_fGetFileOwner(files_struct *fsp, 
SMB_STRUCT_STAT *psbuf)
 
if (fsp->fh->fd == -1) {
return smbacl4_GetFileOwner(fsp

[SCM] Samba Shared Repository - branch master updated

2016-03-12 Thread Jeremy Allison
The branch, master has been updated
   via  0a9acd4 build: fix disk-free quota support on Solaris 10
  from  5fc6d2d smbd: Only check dev/inode in open_directory, not the full 
stat()

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


- Log -
commit 0a9acd445d246c7758e994b0c69cc90bdbbef2fe
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Feb 3 06:41:42 2016 +0200

build: fix disk-free quota support on Solaris 10

Samba has no code to support quota on Solaris 10 (and possibly other
os's such as AIX) using the new quota interface. The new interface
serves both disk size/free space reporting (clamping the underlying
file system numbers with quota), and direct manipulation of the user's
quota.

However, there's legacy code that supports only disk size/free space on
Solaris 10. In the waf build, this code is not compiled because there is
no test for it.

This patch adds a test to see whether the legacy code can be used.

Issue reported and fix tested by Andrew Morgan <mor...@orst.edu>.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11788

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Mar 13 01:37:58 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/wscript   |  24 +++
 source3/wscript_build |   1 +
 tests/oldquotas.c | 174 ++
 3 files changed, 199 insertions(+)
 create mode 100644 tests/oldquotas.c


Changeset truncated at 500 lines:

diff --git a/source3/wscript b/source3/wscript
index c6504c6..c23f621 100644
--- a/source3/wscript
+++ b/source3/wscript
@@ -1455,6 +1455,30 @@ main() {
 conf.DEFINE('HAVE_SYS_QUOTAS', '1')
 conf.DEFINE('WITH_QUOTAS', '1')
 
+#
+# check if Legacy quota code can be brought in
+# if standard interfaces are not supported
+#
+legacy_quota_libs = ''
+if not conf.CONFIG_SET('WITH_QUOTAS'):
+if host_os.rfind('sunos5') > -1:
+conf.DEFINE('SUNOS5', '1')
+legacy_quota_libs = 'nsl'
+conf.CHECK_CODE('''
+#define WITH_QUOTAS 1
+#define AUTOCONF_TEST 1
+#include "../tests/oldquotas.c"
+''',
+cflags=conf.env['WERROR_CFLAGS'],
+define='WITH_QUOTAS',
+lib=legacy_quota_libs,
+msg='Checking whether legacy quota code can be 
used',
+execute=False,
+addmain=False)
+if not conf.CONFIG_SET('WITH_QUOTAS'):
+legacy_quota_libs = ''
+conf.env['legacy_quota_libs'] = legacy_quota_libs
+
 #
 # cluster support (CTDB)
 #
diff --git a/source3/wscript_build b/source3/wscript_build
index 9dc93bf..dce0238 100755
--- a/source3/wscript_build
+++ b/source3/wscript_build
@@ -634,6 +634,7 @@ bld.SAMBA3_LIBRARY('smbd_base',
notifyd
''' +
bld.env['dmapi_lib'] +
+   bld.env['legacy_quota_libs'] +
NOTIFY_DEPS,
private_library=True)
 
diff --git a/tests/oldquotas.c b/tests/oldquotas.c
new file mode 100644
index 000..bdb2beb
--- /dev/null
+++ b/tests/oldquotas.c
@@ -0,0 +1,174 @@
+/* this test should find out whether legacy quota code in disk_quotas.c
+ * compiles. It is a stripped-down version of disk_quotas.c, with samba
+ * stuff removed and only system calls, header files, and constants left.
+ */
+
+#ifndef HAVE_SYS_QUOTAS
+
+/* just a quick hack because sysquotas.h is included before linux/quota.h */
+#ifdef QUOTABLOCK_SIZE
+#undef QUOTABLOCK_SIZE
+#endif
+
+#ifdef WITH_QUOTAS
+
+#if defined(VXFS_QUOTA)
+
+bool disk_quotas_vxfs(const char *name, char *path, uint64_t *bsize,
+ uint64_t *dfree, uint64_t *dsize);
+
+#endif /* VXFS_QUOTA */
+
+#if defined(SUNOS5) || defined(SUNOS4)
+
+#include 
+#include 
+#if defined(SUNOS5)
+#include 
+#include 
+#include 
+#else /* defined(SUNOS4) */
+#include 
+#include 
+#endif
+
+#if defined(SUNOS5)
+
+/
+ Allows querying of remote hosts for quotas on NFS mounted shares.
+ Supports normal NFS and AMD mounts.
+ Alan Romeril <a.rome...@ic.ac.uk> July 2K.
+/
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static bool nfs_quotas(char *nfspath, uid_t euser_id, uint64_t *bsize,
+  uint64_t *dfree, uint6

[SCM] Samba Shared Repository - branch master updated

2016-03-12 Thread Jeremy Allison
The branch, master has been updated
   via  5fc6d2d smbd: Only check dev/inode in open_directory, not the full 
stat()
   via  2e2f811 lib/socket/interfaces: Fix some uninitialied bytes.
  from  2ef0eed selftest: mark samba4.winbind.struct.domain_info.ad_member 
as flapping

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


- Log -
commit 5fc6d2dabdf2aeef74fdefaa67eae0348bbf7a44
Author: Andrew Bartlett <abart...@samba.org>
Date:   Fri Mar 11 14:27:53 2016 +1300

smbd: Only check dev/inode in open_directory, not the full stat()

This is needed because the smb2.create.mkdir-dup test creates a race,
and against an AD DC this can cause a flapping test if the lstat() and
stat() calls are made either side of the chown() due to creation of a
file by administrator.

Fix based on original patches by myself, by Douglas Bagnall
<douglas.bagn...@catalyst.net.nz>.  and Jeremy Allison <j...@samba.org>

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11780

Signed-off-by: Andrew Bartlett <abart...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Mar 12 09:43:21 CET 2016 on sn-devel-144

commit 2e2f81134c86ef3146781d62d9f561f496b74ee2
Author: Günther Deschner <g...@samba.org>
Date:   Wed Mar 2 18:32:53 2016 +0100

lib/socket/interfaces: Fix some uninitialied bytes.

Valgrind reports the following:

==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
==26599==at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so)
==26599==by 0x79D1585: query_iface_speed_from_name (interfaces.c:152)
==26599==by 0x79D1BBA: _get_interfaces (interfaces.c:277)
==26599==by 0x79D1E80: get_interfaces (interfaces.c:368)
==26599==by 0x508A7E3: load_interfaces (interface.c:612)
==26599==by 0x150B30: main (net.c:963)
==26599==  Address 0xffefff0d8 is on thread 1's stack
==26599==  in frame #1, created by query_iface_speed_from_name
(interfaces.c:130)
==26599==
==26599== Syscall param ioctl(SIOCETHTOOL) points to uninitialised byte(s)
==26599==at 0x7014707: ioctl (in /usr/lib64/libc-2.22.so)
==26599==by 0x79D15CC: query_iface_speed_from_name (interfaces.c:164)
==26599==by 0x79D1BBA: _get_interfaces (interfaces.c:277)
==26599==by 0x79D1E80: get_interfaces (interfaces.c:368)
==26599==by 0x508A7E3: load_interfaces (interface.c:612)
==26599==by 0x150B30: main (net.c:963)
==26599==  Address 0xffefff0d8 is on thread 1's stack
==26599==  in frame #1, created by query_iface_speed_from_name
(interfaces.c:130)

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/socket/interfaces.c |  1 +
 source3/smbd/open.c | 14 --
 2 files changed, 13 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
index 2cabf46..dacd118 100644
--- a/lib/socket/interfaces.c
+++ b/lib/socket/interfaces.c
@@ -145,6 +145,7 @@ static void query_iface_speed_from_name(const char *name, 
uint64_t *speed)
goto done;
}
 
+   ZERO_STRUCT(ifr);
strncpy(ifr.ifr_name, name, IF_NAMESIZE);
 
ifr.ifr_data = (void *)
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index baebd7c..e5503f5 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3635,8 +3635,18 @@ static NTSTATUS open_directory(connection_struct *conn,
return status;
}
 
-   /* Ensure there was no race condition. */
-   if (!check_same_stat(_dname->st, >fsp_name->st)) {
+   if(!S_ISDIR(fsp->fsp_name->st.st_ex_mode)) {
+   DEBUG(5,("open_directory: %s is not a directory !\n",
+smb_fname_str_dbg(smb_dname)));
+fd_close(fsp);
+file_free(req, fsp);
+   return NT_STATUS_NOT_A_DIRECTORY;
+   }
+
+   /* Ensure there was no race condition.  We need to check
+* dev/inode but not permissions, as these can change
+* legitimately */
+   if (!check_same_dev_ino(_dname->st, >fsp_name->st)) {
DEBUG(5,("open_directory: stat struct differs for "
"directory %s.\n",
smb_fname_str_dbg(smb_dname)));


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-03-10 Thread Jeremy Allison
The branch, master has been updated
   via  9341c02 smbd: Prevent a crash
   via  a971cfe s3: smbd: Simplify logic inside rename_internals_fsp() part 
2
   via  bffa598 s3: smbd: Simplify logic inside rename_internals_fsp() part 
1.
   via  b4246f8 s3:lib: Move internal lp_posix_pathnames() call out of 
utility function synthetic_smb_fname_split().
   via  153af65 s3:lib: Remove the const SMB_STRUCT_STAT * parameter from 
synthetic_smb_fname_split().
   via  e2056f8 s3:lib: Rewrite synthetic_smb_fname_split() to use 
split_stream_filename().
   via  59f6a73 s3:lib. Add split_stream_filename() Not yet used.
  from  b96511f selftest: add some test cases to net ads join

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


- Log -
commit 9341c02a8998a860d4f390bba2556555a138c71b
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Mar 10 08:54:54 2016 +0100

smbd: Prevent a crash

smb2srv_session_close_previous_check crashes if
ndr_pull_smbXsrv_session_globalB fails for some reason. It depends on 
"is_free"
to be correctly set. All we can do for an invalid database is to discard the
record and set it free.

Signed-off-by: Volker Lendecke <v...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Mar 11 00:12:18 CET 2016 on sn-devel-144

commit a971cfe0ef47c02d119261596c0705275e17e613
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 16:12:00 2016 -0800

s3: smbd: Simplify logic inside rename_internals_fsp() part 2

Removes the use of an extraneous 'struct smb_filename *'
which wasn't being created correctly, only as a place
holder for two char * pointers.

Use split_stream_filename() to create the char * pointers
directly and make it clearer what we're up to here.

The logic here is still complex, but I'm satified
it does the correct thing.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit bffa598c0479b69b9b74a9093f90c8349327f8b7
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 16:01:52 2016 -0800

s3: smbd: Simplify logic inside rename_internals_fsp() part 1.

Use standard parent_dirname() function instead of hand-hacking
using strrchr_m(xxx, '/'). Next commit should enable removal
    of synthetic_smb_fname_split().

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit b4246f863ce15865a772b0be7a949a46688bcc34
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 16:00:47 2016 -0800

s3:lib: Move internal lp_posix_pathnames() call out of utility function 
synthetic_smb_fname_split().
    
Make it a passed in parameter instead.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 153af65e445e8491fb436e7112b579ed4603ca01
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 15:50:02 2016 -0800

s3:lib: Remove the const SMB_STRUCT_STAT * parameter from 
synthetic_smb_fname_split().
    
    Only one caller uses this, and this can be handled externally.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit e2056f843d71fd7b9c3e326d45c71218cf8faaae
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 15:45:55 2016 -0800

s3:lib: Rewrite synthetic_smb_fname_split() to use split_stream_filename().

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 59f6a73c93c100406851d40e1d676f5b44fd355e
Author: Jeremy Allison <j...@samba.org>
Date:   Wed Mar 9 14:56:49 2016 -0800

s3:lib. Add split_stream_filename() Not yet used.

Will replace internals of synthetic_smb_fname_split().

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

---

Summary of changes:
 source3/include/proto.h|  8 +++-
 source3/lib/filename_util.c| 74 +++
 source3/smbd/filename.c|  5 ++-
 source3/smbd/pysmbd.c  |  8 +++-
 source3/smbd/reply.c   | 89 +-
 source3/smbd/smbXsrv_session.c |  8 
 source3/torture/cmd_vfs.c  | 28 +
 7 files changed, 154 insertions(+), 66 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index 8a273c3..dc8fee9 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1141,8 +1141,8 @@ struct smb_filename *synthetic_smb_fname(TALLOC_CTX 
*me

[SCM] Samba Shared Repository - branch master updated

2016-03-09 Thread Jeremy Allison
The branch, master has been updated
   via  cb51e8d s4/heimdal/lib/krb5/pac.c: typo
   via  511c747 s4/heimdal/lib/gssapi/mech/gss_compare_name.c: typo
   via  ad9c1aa s4/client/cifsdd.c: typo
   via  34ae5c5 s4/auth/ntlm/auth_unix.c: add parens
   via  085b687 s3/utils/regedit.c: typo
   via  f28014d docs: update vfs_fruit manpage
   via  3e88ccd testparm: vfs_fruit checks
  from  5741e84 smbd: Avoid an "else"

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


- Log -
commit cb51e8d5cbcee144301bdfa3f51608610c2ddebd
Author: Aurelien Aptel <aap...@suse.com>
Date:   Wed Mar 9 11:35:24 2016 +0100

s4/heimdal/lib/krb5/pac.c: typo

Signed-off-by: Aurelien Aptel <aap...@suse.com>
    Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Mar 10 03:33:46 CET 2016 on sn-devel-144

commit 511c747745b8adf60d03dc4af02a80f4d55e830d
Author: Aurelien Aptel <aap...@suse.com>
Date:   Wed Mar 9 17:46:54 2016 +0100

s4/heimdal/lib/gssapi/mech/gss_compare_name.c: typo

make memcmp() compare the name1 and name2 value instead of comparing
name1 with itself.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Ira Cooper <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit ad9c1aa867d8d5e478f4511a710736da397d5c50
Author: Aurelien Aptel <aap...@suse.com>
Date:   Wed Mar 9 11:37:44 2016 +0100

s4/client/cifsdd.c: typo

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 34ae5c508302383909128b589d6fab6199b32f52
Author: Aurelien Aptel <aap...@suse.com>
Date:   Wed Mar 9 11:43:16 2016 +0100

s4/auth/ntlm/auth_unix.c: add parens

operator | has lower precedence than ?:
so add parens to have the expected result.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit 085b687768a1f10689ec371d4b9e771bfd3f4a07
Author: Aurelien Aptel <aap...@suse.com>
Date:   Wed Mar 9 15:25:26 2016 +0100

s3/utils/regedit.c: typo

    loop should exit on any case of Q.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>

commit f28014d81083e61537ea796f0dd9efa24154f5f6
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Mar 9 14:01:05 2016 +0100

docs: update vfs_fruit manpage

Add documentation that ea support = yes is required and explain why all
shares for OS X clients should use fruit if one uses it.

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3e88ccdd73847c70c76c07eec6334bd15b5c4180
Author: Ralph Boehme <s...@samba.org>
Date:   Wed Mar 9 13:53:09 2016 +0100

testparm: vfs_fruit checks

- vfs_fruit requires "ea support = yes"

- OS X clients negotiate AAPL on the first tcon, so mixing shares with
  and without fruit will globally disable AAPL if the first tcon is
  without fruit

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 docs-xml/manpages/vfs_fruit.8.xml  |  9 
 source3/utils/regedit.c|  2 +-
 source3/utils/testparm.c   | 24 ++
 source4/auth/ntlm/auth_unix.c  |  2 +-
 source4/client/cifsdd.c|  2 +-
 source4/heimdal/lib/gssapi/mech/gss_compare_name.c |  2 +-
 source4/heimdal/lib/krb5/pac.c |  2 +-
 7 files changed, 38 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/vfs_fruit.8.xml 
b/docs-xml/manpages/vfs_fruit.8.xml
index 2ac5db7..36d137e 100644
--- a/docs-xml/manpages/vfs_fruit.8.xml
+++ b/docs-xml/manpages/vfs_fruit.8.xml
@@ -45,6 +45,14 @@
vfs_streams_xattr which must be loaded
together with vfs_fruit.
 
+   vfs_fruit requires "ea support = yes".
+
+   Be careful when mixing shares with and without
+   vfs_fruit. OS X clients negotiate SMB2 AAPL protocol
+   extensions on the first tcon, so mixing shares with and
+   without fruit will globally disable AAPL if the first tcon is
+   without fruit.
+
Having shares with ADS support enabled for OS X client
is worthwhile because it resembles the behavi

[SCM] Samba Shared Repository - branch master updated

2016-03-07 Thread Jeremy Allison
The branch, master has been updated
   via  0dbab0e libnet: make Kerberos domain join site-aware
   via  6d71740 dsgetdcname: fix flag check
   via  ef84f4c dsgetdcname: return an IP address on rediscovery
   via  980f8cf idmap_autorid: Protect against corrupt databases
   via  5652810 idmap_autorid: Fix a use-after-free
  from  f4b4872 s3: smbd: Change open_streams_for_delete() to take a struct 
smb_filename *.

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


- Log -
commit 0dbab0e33e9efc46f72b6a8b0dc894ea251df9aa
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Mar 3 09:18:58 2016 +0200

libnet: make Kerberos domain join site-aware

When joining a domain using Kerberos authentication, create a
configuration file for the Kerberos libs to prefer on-site
domain controllers, without relying on the winbindd Kerberos
locator, which many not be operational at this stage.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar  8 01:30:35 CET 2016 on sn-devel-144

commit 6d717402e42131298ba670ee47686379854ec56d
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Mar 3 09:18:57 2016 +0200

dsgetdcname: fix flag check

Fix the check for zero requseted flags.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit ef84f4c018424b1fcc232a4780dc2c0435701d86
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Mar 3 09:18:44 2016 +0200

dsgetdcname: return an IP address on rediscovery

When dsgetdcname return its result based on discovery
process (instead of retrieving cached value), always
return the found server's IP address in dc_address field,
rather than its netbios name.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11769

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 980f8cfe30577f2b14dfd2ac53a785f4395d980f
Author: Volker Lendecke <v...@samba.org>
Date:   Wed Feb 10 09:02:12 2016 +0100

idmap_autorid: Protect against corrupt databases

    Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 565281029546bd5ec06eb943da063894aeac97c4
Author: Volker Lendecke <v...@samba.org>
Date:   Sun Mar 6 16:39:58 2016 +0100

idmap_autorid: Fix a use-after-free

Parsing the domain_range_index references data.dptr

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/libnet/libnet_join.c | 52 
 source3/libsmb/dsgetdcname.c | 16 ++---
 source3/winbindd/idmap_autorid.c | 12 +-
 3 files changed, 71 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c
index 6dce03c..fc737a2 100644
--- a/source3/libnet/libnet_join.c
+++ b/source3/libnet/libnet_join.c
@@ -2157,6 +2157,17 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
 #ifdef HAVE_ADS
ADS_STATUS ads_status;
 #endif /* HAVE_ADS */
+   const char *pre_connect_realm = NULL;
+   const char *numeric_dcip = NULL;
+   const char *sitename = NULL;
+
+   /* Before contacting a DC, we can securely know
+* the realm only if the user specifies it.
+*/
+   if (r->in.use_kerberos &&
+   r->in.domain_name_type == JoinDomNameTypeDNS) {
+   pre_connect_realm = r->in.domain_name;
+   }
 
if (!r->in.dc_name) {
struct netr_DsRGetDCNameInfo *info;
@@ -2189,6 +2200,47 @@ static WERROR libnet_DomainJoin(TALLOC_CTX *mem_ctx,
dc = strip_hostname(info->dc_unc);
r->in.dc_name = talloc_strdup(mem_ctx, dc);
W_ERROR_HAVE_NO_MEMORY(r->in.dc_name);
+
+   if (info->dc_address == NULL || info->dc_address[0] != '\\' ||
+   info->dc_address[1] != '\\') {
+   DBG_ERR("ill-formed DC address '%s'\n",
+   info->dc_address);
+   return WERR_DCNOTFOUND;
+   }
+
+   numeric_dcip = info->dc_address + 2;
+   sitename = info->dc_site_name;
+   /* info goes out of scope but the memory stays
+  allocated on the talloc con

[SCM] Samba Shared Repository - branch master updated

2016-03-05 Thread Jeremy Allison
The branch, master has been updated
   via  9ee4678 vfs_glusterfs: Fix use after free in AIO callback.
  from  58d3462 source3: Honor the core soft limit of the OS.

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


- Log -
commit 9ee4678b8d92a8ab4ea9a4ff80b2da6bd3da5a16
Author: Ira Cooper <i...@samba.org>
Date:   Fri Mar 4 18:00:07 2016 -0500

vfs_glusterfs: Fix use after free in AIO callback.

The wrapper->state pointer is not getting NULLed during free
allowing use of freed memory, causing a crash.

Thanks to Red Hat for discovering this issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11774

Signed-off-by: Ira Copper <i...@samba.org>
Reviewed-by: Poornima G <pguru...@redhat.com>
Tested-by: Christopher Blum <cb...@redhat.com>
Reviewed-by: Jeremy Allison <j...@samba.org>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Mar  5 09:08:53 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/modules/vfs_glusterfs.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c
index c98e480..2008342 100644
--- a/source3/modules/vfs_glusterfs.c
+++ b/source3/modules/vfs_glusterfs.c
@@ -507,7 +507,9 @@ struct glusterfs_aio_state {
 
 static int aio_wrapper_destructor(struct glusterfs_aio_wrapper *wrap)
 {
-   wrap->state->cancelled = true;
+   if (wrap->state != NULL) {
+   wrap->state->cancelled = true;
+   }
 
return 0;
 }
@@ -744,7 +746,6 @@ static struct tevent_req *vfs_gluster_pwrite_send(struct 
vfs_handle_struct
 static ssize_t vfs_gluster_recv(struct tevent_req *req,
struct vfs_aio_state *vfs_aio_state)
 {
-   struct glusterfs_aio_state *state = NULL;
struct glusterfs_aio_wrapper *wrapper = NULL;
int ret = 0;
 
@@ -754,9 +755,7 @@ static ssize_t vfs_gluster_recv(struct tevent_req *req,
return -1;
}
 
-   state = wrapper->state;
-
-   if (state == NULL) {
+   if (wrapper->state == NULL) {
return -1;
}
 
@@ -764,12 +763,12 @@ static ssize_t vfs_gluster_recv(struct tevent_req *req,
return -1;
}
 
-   *vfs_aio_state = state->vfs_aio_state;
-   ret = state->ret;
+   *vfs_aio_state = wrapper->state->vfs_aio_state;
+   ret = wrapper->state->ret;
 
/* Clean up the state, it is in a NULL context. */
 
-   TALLOC_FREE(state);
+   TALLOC_FREE(wrapper->state);
 
return ret;
 }


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-03-04 Thread Jeremy Allison
The branch, master has been updated
   via  58d3462 source3: Honor the core soft limit of the OS.
   via  85e414a s3/rpc_server/srvsvc/srv_srvsvc_nt.c: change snum to signed 
int
  from  2285519 s3,s4 torture/denytest: fix possible infinite loop

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


- Log -
commit 58d3462bc58290d8eb5e554c6c59cf6b73ccf58a
Author: Ira Cooper <i...@samba.org>
Date:   Thu Mar 3 13:47:32 2016 -0500

source3: Honor the core soft limit of the OS.

We should honor the soft limits set by the operating system.

In any case, 16M doesn't make a useful coredump for modern
Samba.

Signed-off-by: Ira Cooper <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Mar  5 00:39:48 CET 2016 on sn-devel-144

commit 85e414aefc0c3e5db51d8426bdba62dc5bcc5420
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Mar 3 16:30:35 2016 +0100

s3/rpc_server/srvsvc/srv_srvsvc_nt.c: change snum to signed int

snum is used to store the result of the find_service() call which
returns a signed int, with -1 being an error.

with an uint32_t the error check (< 0) is always false.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Volker Lendecke <volker.lende...@sernet.de>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/lib/dumpcore.c| 15 ---
 source3/rpc_server/srvsvc/srv_srvsvc_nt.c |  3 ++-
 2 files changed, 2 insertions(+), 16 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/dumpcore.c b/source3/lib/dumpcore.c
index 487ccec..c72aa88 100644
--- a/source3/lib/dumpcore.c
+++ b/source3/lib/dumpcore.c
@@ -251,21 +251,6 @@ void dump_core_setup(const char *progname, const char 
*log_file)
goto out;
}
 
-
-#ifdef HAVE_GETRLIMIT
-#ifdef RLIMIT_CORE
-   {
-   struct rlimit rlp;
-   getrlimit(RLIMIT_CORE, );
-   rlp.rlim_cur = MAX(16*1024*1024,rlp.rlim_cur);
-   setrlimit(RLIMIT_CORE, );
-   getrlimit(RLIMIT_CORE, );
-   DEBUG(3,("Maximum core file size limits now %d(soft) 
%d(hard)\n",
-(int)rlp.rlim_cur,(int)rlp.rlim_max));
-   }
-#endif
-#endif
-
/* FIXME: if we have a core-plus-pid facility, configurably set
 * this up here.
 */
diff --git a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c 
b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
index 279cd9e..980411e 100644
--- a/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srvsvc/srv_srvsvc_nt.c
@@ -1125,7 +1125,8 @@ static WERROR init_srv_conn_info_1(const char *name,
   uint32_t *resume_handle_p,
   uint32_t *total_entries)
 {
-   uint32_t num_entries = 0, snum = 0;
+   uint32_t num_entries = 0;
+   int snum = 0;
uint32_t resume_handle = resume_handle_p ? *resume_handle_p : 0;
char *share_name = NULL;
struct server_id *svrid_arr = NULL;


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-03-03 Thread Jeremy Allison
The branch, master has been updated
   via  d7ca174 s3:smbd: add negprot remote arch detection for OSX
   via  b69b96f s3:smbd: rework negprot remote arch detection
  from  9c67ff4 selftest: test access based share enum parameter

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


- Log -
commit d7ca174744001fabdc32e1c334dad347bb985756
Author: Justin Maggard <jmaggar...@gmail.com>
Date:   Wed Mar 2 10:19:56 2016 -0800

s3:smbd: add negprot remote arch detection for OSX

Remote arch detection for OSX clients has been broken for some time, since
both Samba and OSX started supporting SMB2.  Fix it by adding modern OSX
client detection support to the negprot remote arch detection routine.

Signed-off-by: Justin Maggard <jmaggar...@gmail.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Mar  3 09:03:53 CET 2016 on sn-devel-144

commit b69b96fc14128f50a906b4f5b34934efbc94afbc
Author: Justin Maggard <jmaggar...@gmail.com>
Date:   Wed Mar 2 10:18:34 2016 -0800

s3:smbd: rework negprot remote arch detection

Negprot remote arch detection is very cryptic.  Rework it so it's easier
to understand, and therefore more extensible, following the protocol table
in inline comments.  This also allows us to remove some hacks.

Signed-off-by: Justin Maggard <jmaggar...@gmail.com>
Reviewed-by: Ralph Boehme <r...@sernet.de>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 libcli/smb/smb_constants.h  |   1 -
 source3/smbd/negprot.c  | 152 ++--
 source3/smbd/smb2_negprot.c |   9 ++-
 3 files changed, 98 insertions(+), 64 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smb_constants.h b/libcli/smb/smb_constants.h
index c4cca15..563a574 100644
--- a/libcli/smb/smb_constants.h
+++ b/libcli/smb/smb_constants.h
@@ -309,7 +309,6 @@ enum csc_policy {
 #define FLAGS2_READ_PERMIT_EXECUTE 0x2000
 #define FLAGS2_32_BIT_ERROR_CODES  0x4000
 #define FLAGS2_UNICODE_STRINGS 0x8000
-#define FLAGS2_WIN2K_SIGNATURE 0xC852 /* Hack alert ! For now... JRA. 
*/
 
 /* FileAttributes (search attributes) field */
 #define FILE_ATTRIBUTE_READONLY0x0001L
diff --git a/source3/smbd/negprot.c b/source3/smbd/negprot.c
index 83baeb1..7590421 100644
--- a/source3/smbd/negprot.c
+++ b/source3/smbd/negprot.c
@@ -442,41 +442,67 @@ protocol [XENIX CORE]
 protocol [LANMAN1.0]
 protocol [LM1.2X002]
 protocol [LANMAN2.1]
+
+OSX:
+protocol [NT LM 0.12]
+protocol [SMB 2.002]
+protocol [SMB 2.???]
 */
 
 /*
   * Modified to recognize the architecture of the remote machine better.
   *
   * This appears to be the matrix of which protocol is used by which
-  * MS product.
-   Protocol   WfWgWin95   WinNT  Win2K  OS/2 Vista
-   PC NETWORK PROGRAM 1.0  1   1   1  1  1 1
-   XENIX CORE  2 2
-   MICROSOFT NETWORKS 3.0  2   2   
-   DOS LM1.2X002   3   3   
-   MICROSOFT NETWORKS 1.03 3
-   DOS LANMAN2.1   4   4   
-   LANMAN1.0   4  2  3 2
-   Windows for Workgroups 3.1a 5   5   5  33
-   LM1.2X002   6  4  4 4
-   LANMAN2.1   7  5  5 5
-   NT LM 0.12  6   8  66
-   SMB 2.001   7
+  * product.
+   Protocol   WfWg Win95 WinNT Win2K OS/2 Vista OSX
+   PC NETWORK PROGRAM 1.0  1 1 1 1 11
+   XENIX CORE  2   2
+   MICROSOFT NETWORKS 3.0  2 2
+   DOS LM1.2X002   3 3
+   MICROSOFT NETWORKS 1.03 3
+   DOS LANMAN2.1   4 4
+   LANMAN1.0   4 2 32
+   Windows for Workgroups 3.1a 5 5 5 3  3
+   LM1.2X002   6 4 44
+   LANMAN2.1   7 5 55
+   NT LM 0.126 8 6 661
+   SMB 2.0017
+   SMB 2.002 2
+   SMB 2.??? 

[SCM] Samba Shared Repository - branch master updated

2016-03-01 Thread Jeremy Allison
The branch, master has been updated
   via  ae2083e vfs:glusterfs: fix build after opendir signature change
   via  5540587 vfs:ceph: fix build after opendir signature change.
   via  7054217 vfs/time_audit: use duration we get from the async backend
   via  d8f71a4 vfs/glusterfs: measure libglusterfs aio function call 
duration
   via  1e2d8d2 vfs/aio_linux: measure libaio aio function call duration
   via  c3892aa vfs/aio_fork: measure async request syscall duration
   via  fd85ee4 vfs/default: store async VFS op duration we got from libasys
   via  0ea6a07 s3:lib/asys: measure async request syscall duration
   via  9892809 s3/vfs: add duration to vfs_aio_state
   via  3884a66 s3/vfs: wrap async io function args inside struct 
vfs_aio_state
  from  6af7ebf passdb: Avoid a "ret == true"

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


- Log -
commit ae2083e1cc0961313a9a9ef9dc1e2af271d2e5b1
Author: Michael Adam <ob...@samba.org>
Date:   Wed Mar 2 00:18:32 2016 +0100

vfs:glusterfs: fix build after opendir signature change

Signed-off-by: Michael Adam <ob...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Mar  2 04:34:15 CET 2016 on sn-devel-144

commit 55405871b9c22849ac9242fe7d2333682f96fbfe
Author: Michael Adam <ob...@samba.org>
Date:   Wed Mar 2 00:15:50 2016 +0100

vfs:ceph: fix build after opendir signature change.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 7054217a790c8d051d78aa7ee6b0144b3f1f55a0
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Feb 26 12:54:23 2016 +0100

vfs/time_audit: use duration we get from the async backend

Finally! The previous commits changed the VFS and the async backend to
pass the duration of an aync operation up the stack.

We now can use this value instead of doing our own sampling which avoids
the following problem:

1. SMB2 read request received, added to the async queue

2. SMB2 create_file request comes in, is processed and blocks for N
   seconds in open()

3. async read completes in the dispatcher thread, completion callback
   will be called when we enter the main tevent loop

4. open() completes after N seconds

5. main tevent event loop is entered, async results are processed

6. async read result is processed, time sampling will include the N
   seconds blocked in open()

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit d8f71a43c37b1c59bb79b5afe6c9daefada95503
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Feb 26 11:14:36 2016 +0100

vfs/glusterfs: measure libglusterfs aio function call duration
    
Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 1e2d8d2c37f03208a12c6a868ef0e03d51191887
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Feb 26 10:52:39 2016 +0100

vfs/aio_linux: measure libaio aio function call duration

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit c3892aa705cea3de0e0fd03de0c0a2f8a8fad669
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Feb 26 09:59:23 2016 +0100

vfs/aio_fork: measure async request syscall duration

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fd85ee43e7234aa41f89b50adb1c108dd2066419
Author: Ralph Boehme <s...@samba.org>
Date:   Fri Feb 26 12:29:02 2016 +0100

vfs/default: store async VFS op duration we got from libasys

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0ea6a070c4aa90e2622b2d245a87821c50f2f0b0
Author: Ralph Boehme <s...@samba.org>
Date:   Thu Feb 25 08:06:00 2016 +0100

s3:lib/asys: measure async request syscall duration

This uses time functions from lib/util/ which requires pulling in
samba-util. This sucks, but there's just no way of rewrapping a minimal
    time utility library without modifying the public samba-util.

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9892809233f50028f6d4d9698861074c00e6fe8f
Author: Ralph Boehme <s...@samba.org>
Date:   Mon Feb 29 12:17:18 2016 +0100

s3/vfs: add duration to vfs_aio_state

This will be used in the aio backends to pass the competion time of the
async request in the backend.

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org

[SCM] Samba Shared Repository - branch master updated

2016-02-29 Thread Jeremy Allison
The branch, master has been updated
   via  2bd28d2 lib/util/util.c: move null-check before use
   via  6d00855 torture:smb2: fix skip message if share is not CA
   via  cd3ee2a torture:smb2: skip replay5 test if server does not support 
persistent handles
   via  95835b9 torture:smb2: skip replay3 if server does not support 
Multi-Channel
  from  7105e171 lib/util: Add tests for strv_addn()

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


- Log -
commit 2bd28d23fdac82f366c0e9d412d2fefca9c077eb
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Feb 25 14:11:10 2016 +0100

lib/util/util.c: move null-check before use

moves a null pointer check *before* the pointer is used in
the strlen() call

- still allocate the `fname` array on the stack
- still compiles under C90 definition/code mixing rules

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Mar  1 02:25:22 CET 2016 on sn-devel-144

commit 6d008556722a5bca73e5881345497ec8f97595dd
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 29 01:52:42 2016 +0100

torture:smb2: fix skip message if share is not CA

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cd3ee2a2aa46cb49e14c451ea8ee64039e5b8fa6
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 29 01:52:07 2016 +0100

torture:smb2: skip replay5 test if server does not support persistent 
handles

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 95835b9280f8b191245786305b43ae802886ee01
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 29 01:51:23 2016 +0100

torture:smb2: skip replay3 if server does not support Multi-Channel

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/util/util.c   |  6 +-
 source4/torture/smb2/replay.c | 18 +-
 2 files changed, 18 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/util.c b/lib/util/util.c
index 03edd7f..683741c 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -66,15 +66,11 @@ _PUBLIC_ const char *tmpdir(void)
 **/
 int create_unlink_tmp(const char *dir)
 {
-   size_t len = strlen(dir);
+   size_t len = strlen(dir ? dir : (dir = tmpdir()));
char fname[len+25];
int fd;
mode_t mask;
 
-   if (!dir) {
-   dir = tmpdir();
-   }
-
len = snprintf(fname, sizeof(fname), "%s/listenerlock_XX", dir);
if (len >= sizeof(fname)) {
errno = ENOMEM;
diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 4b3f569..26c32d1 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -487,12 +487,20 @@ static bool test_replay3(struct torture_context *tctx, 
struct smb2_tree *tree1)
struct smb2_session *session1_2 = NULL;
uint32_t share_capabilities;
bool share_is_so;
+   uint32_t server_capabilities;
 
if (smbXcli_conn_protocol(transport1->conn) < PROTOCOL_SMB3_00) {
torture_skip(tctx, "SMB 3.X Dialect family required for "
   "Replay tests\n");
}
 
+   server_capabilities = smb2cli_conn_server_capabilities(
+   tree1->session->transport->conn);
+   if (!(server_capabilities & SMB2_CAP_MULTI_CHANNEL)) {
+   torture_skip(tctx,
+"Server does not support multi-channel.");
+   }
+
share_capabilities = smb2cli_tcon_capabilities(tree1->smbXcli);
share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT;
 
@@ -869,6 +877,7 @@ static bool test_replay5(struct torture_context *tctx, 
struct smb2_tree *tree)
uint32_t share_capabilities;
bool share_is_ca;
bool share_is_so;
+   uint32_t server_capabilities;
const char *fname = BASEDIR "\\replay5.dat";
struct smb2_transport *transport = tree->session->transport;
struct smbcli_options options = tree->session->transport->options;
@@ -880,11 +889,18 @@ static bool test_replay5(struct torture_context *tctx, 
struct smb2_tree *tree)
"Replay tests\n");
}
 
+   server_capabilities = smb2cli_conn_server_capabilities(
+   tree->ses

[SCM] Samba Shared Repository - branch master updated

2016-02-27 Thread Jeremy Allison
The branch, master has been updated
   via  abd8b18 smbd:smb2_creat: remove outdated TODO comments
   via  0fe29f6 smbXsrv_client: factor fetch-locking of global record into 
function
   via  aaddde1 smbXsrv_session: factor fetch-locking of local record into 
function
   via  37eba90 smbXsrv_session: factor fetch-locking of global record into 
function
   via  a9dcbd0 smbXsrv_tcon: factor fetch-locking of local record into 
function
   via  a5e4f14 smbXsrv_tcon: factor fetch-locking of global record into 
function
  from  9dfd531 s3/libsmb/clirap2.c: use actual buffer size

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


- Log -
commit abd8b182447fce6dc1436e8ff3907b871705d7e0
Author: Michael Adam <ob...@samba.org>
Date:   Sun Feb 28 01:46:47 2016 +0100

smbd:smb2_creat: remove outdated TODO comments

Leases have meanwhile been implemented and the
TODO has been taken care of.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allson <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Feb 28 08:16:26 CET 2016 on sn-devel-144

commit 0fe29f66326e9a39254fdc2fd255075e5055eeb6
Author: Michael Adam <ob...@samba.org>
Date:   Sat Feb 27 01:58:45 2016 +0100

smbXsrv_client: factor fetch-locking of global record into function

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit aaddde12d997c7d35b1e76709afd310990dc9cdb
Author: Michael Adam <ob...@samba.org>
Date:   Sat Feb 27 01:37:34 2016 +0100

smbXsrv_session: factor fetch-locking of local record into function

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 37eba9006e95235785d851f4d4c8110bf77e2b64
Author: Michael Adam <ob...@samba.org>
Date:   Sat Feb 27 01:26:16 2016 +0100

smbXsrv_session: factor fetch-locking of global record into function

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a9dcbd09801ab19c2abdb803c730120bd20d8175
Author: Michael Adam <ob...@samba.org>
Date:   Sat Feb 27 01:06:13 2016 +0100

smbXsrv_tcon: factor fetch-locking of local record into function
    
Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a5e4f14c3b132c886cda2ab4cc14f1f764ff04eb
Author: Michael Adam <ob...@samba.org>
Date:   Sat Feb 27 00:52:59 2016 +0100

smbXsrv_tcon: factor fetch-locking of global record into function

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/smbd/smb2_create.c |   8 ---
 source3/smbd/smbXsrv_client.c  |  62 +++-
 source3/smbd/smbXsrv_session.c | 129 -
 source3/smbd/smbXsrv_tcon.c| 119 +++--
 4 files changed, 156 insertions(+), 162 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 62948a0..7917d42 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -555,10 +555,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX 
*mem_ctx,
 * (Note that the cases of an additional dh2q or dh2c blob
 *  which require a different error code, have been treated
 *  above.)
-*
-* TODO:
-* This is only true for the oplock case:
-* For leases, lease request is required additionally.
 */
 
if (dhnq) {
@@ -595,10 +591,6 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX 
*mem_ctx,
 * (Note that the cases of an additional dhnq, dhnc or dh2q
 *  blob which require a different error code, have been
 *  treated above.)
-*
-* TODO:
-* This is only true for the oplock case:
-* For leases, lease request is required additionally!
 */
 
num_blobs_allowed = 1;
diff --git a/source3/smbd/smbXsrv_client.c b/source3/smbd/smbXsrv_client.c
index 0e21fc6..2dd4cad 100644
--- a/source3/smbd/smbXsrv_client.c
+++ b/source3/smbd/smbXsrv_client.c
@@ -118,6 +118,28 @@ static TDB_DATA smbXsrv_client_global_id_to_key(const 
struct GUID *client_guid,
return key;
 }
 
+static struct db_record *smbXsrv_client_global_fetch_locked(
+   struct db_context *db,
+   const struct GUID *client_guid,
+   TALLOC_CTX *mem_c

[SCM] Samba Shared Repository - branch master updated

2016-02-26 Thread Jeremy Allison
The branch, master has been updated
   via  9dfd531 s3/libsmb/clirap2.c: use actual buffer size
  from  bba426d smbXsrv_open: factor fetch-locking of local record into 
function

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


- Log -
commit 9dfd531c19d3ffd17c4b8ecf6ad9eb1ab246ae5d
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Feb 25 14:39:10 2016 +0100

s3/libsmb/clirap2.c: use actual buffer size

data used to be a stack allocated array but was changed to a heap
allocated buffer by commit 95a81a3. Update sizeof(data) to data_size.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ira Cooper <i...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Feb 27 05:25:40 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/libsmb/clirap2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clirap2.c b/source3/libsmb/clirap2.c
index 931bc23..6c49363 100644
--- a/source3/libsmb/clirap2.c
+++ b/source3/libsmb/clirap2.c
@@ -331,7 +331,7 @@ int cli_NetGroupAdd(struct cli_state *cli, struct 
rap_group_info_1 *grinfo)
 
if (cli_api(cli,
  param, sizeof(param), 1024, /* Param, length, maxlen */
- data, soffset, sizeof(data), /* data, length, maxlen */
+ data, soffset, data_size, /* data, length, maxlen */
  , ,   /* return params, length */
  , ))   /* return data, length */
{


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-02-26 Thread Jeremy Allison
The branch, master has been updated
   via  bba426d smbXsrv_open: factor fetch-locking of local record into 
function
   via  7b8cfa1 smbXsrv_open: factor fetch-locking of global record into 
function
   via  f3ea162 lib/util: Add tests for strv
   via  0d08af7 lib/util/idtree.c: fix UB by using uint in left-shift
  from  39081af selftest: Add a blackbox test for smbget

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


- Log -
commit bba426dbbbe0e4aebd99b78cff037eac754aa282
Author: Michael Adam <ob...@samba.org>
Date:   Fri Feb 26 00:53:22 2016 +0100

smbXsrv_open: factor fetch-locking of local record into function

smbXsrv_open_local_fetch_locked()

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Feb 26 22:35:28 CET 2016 on sn-devel-144

commit 7b8cfa1cbc2738f798fad748ea40c029d99814a0
Author: Michael Adam <ob...@samba.org>
Date:   Fri Feb 26 00:41:24 2016 +0100

smbXsrv_open: factor fetch-locking of global record into function

smbXsrv_open_global_fetch_locked()

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit f3ea162488c52a9b7ca82b191007df3ba8185c87
Author: Martin Schwenke <mar...@meltin.net>
Date:   Fri Feb 26 15:23:31 2016 +1100

lib/util: Add tests for strv

These are blackbox tests against most of the API.

It would be possible to write tests that check the internals of the
strv are as expected but that probably doesn't add much value.

Signed-off-by: Martin Schwenke <mar...@meltin.net>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0d08af70c83f98bf0daeef45a0d76676a1fbde5a
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Feb 25 13:58:01 2016 +0100

lib/util/idtree.c: fix UB by using uint in left-shift

Using negative values on the left-side of a left-shift operation is an
Undefined Behaviour in C.

    Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ira Cooper <i...@samba.org>

---

Summary of changes:
 lib/util/idtree.c   |   2 +-
 lib/util/tests/strv.c   | 169 
 source3/smbd/smbXsrv_open.c | 133 +---
 source4/torture/local/local.c   |   1 +
 source4/torture/local/wscript_build |   1 +
 5 files changed, 234 insertions(+), 72 deletions(-)
 create mode 100644 lib/util/tests/strv.c


Changeset truncated at 500 lines:

diff --git a/lib/util/idtree.c b/lib/util/idtree.c
index e2cfcc5..72266a6 100644
--- a/lib/util/idtree.c
+++ b/lib/util/idtree.c
@@ -289,7 +289,7 @@ static void *_idr_find(struct idr_context *idp, int id)
 * present.  If so, tain't one of ours!
 */
if (n + IDR_BITS < 31 &&
-   ((id & ~(~0 << MAX_ID_SHIFT)) >> (n + IDR_BITS))) {
+   ((id & ~(~0U << MAX_ID_SHIFT)) >> (n + IDR_BITS))) {
return NULL;
}
 
diff --git a/lib/util/tests/strv.c b/lib/util/tests/strv.c
new file mode 100644
index 000..4030c44
--- /dev/null
+++ b/lib/util/tests/strv.c
@@ -0,0 +1,169 @@
+/*
+ * Tests for strv
+ *
+ * Copyright Martin Schwenke <mar...@meltin.net> 2016
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#include 
+
+#include "replace.h"
+
+#include "libcli/util/ntstatus.h"
+#include "torture/torture.h"
+#include "lib/util/data_blob.h"
+#include "torture/local/proto.h"
+
+#include "lib/util/strv.h"
+
+static bool test_strv_empty(struct torture_context *tctx)
+{
+   /* NULL strv contains 0 entries */
+   torture_assert_int_equal(tctx,
+strv_count(NULL),
+0,
+"strv_count() on NULL failed");
+
+   /* NULL strv has no next entry */
+   torture_assert(tctx,
+  strv_next(NULL, NUL

[SCM] Samba Shared Repository - branch master updated

2016-02-25 Thread Jeremy Allison
The branch, master has been updated
   via  a06bbf3 vfs_gpfs: Fix compile after change in get_nt_acl_fn
   via  1f9d1f9 s3/lib/netapi/tests/netuser.c: fix wrong closing paren
   via  cde44d4 s3/vfs_btrfs.c: use sizeof() instead of ARRAY_SIZE()
   via  c11ad90 smbd: ignore SVHDX create context
  from  cd1335e VFS: Modify rmdir to take a const struct smb_filename * 
instead of const char *

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


- Log -
commit a06bbf344707604b612d63195050c5cc8fa19554
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Feb 25 13:42:21 2016 -0700

vfs_gpfs: Fix compile after change in get_nt_acl_fn

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Feb 26 01:21:21 CET 2016 on sn-devel-144

commit 1f9d1f9cd70b4e9b41e53d9cca5025ed31ef7e71
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Feb 25 14:17:46 2016 +0100

s3/lib/netapi/tests/netuser.c: fix wrong closing paren

Signed-off-by: Aurelien Aptel <aap...@suse.com>
Reviewed-by: David Disseldorp <dd...@samba.org>
Reviewed-by: Michael Adam <ob...@samba.org>
Revewied-by: Jeremy Allison <j...@samba.org>

commit cde44d48003499547c6745866b39c3e65bd25d38
Author: Aurelien Aptel <aap...@suse.com>
Date:   Thu Feb 25 15:55:07 2016 +0100

s3/vfs_btrfs.c: use sizeof() instead of ARRAY_SIZE()

The `unused` member being set to zero is an uint64_t array. We want the
byte size here.

Signed-off-by: Aurelien Aptel <aap...@suse.com>
    Reviewed-by: David Disseldorp <dd...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit c11ad90a240a7703e04d290f78c15839ba31d733
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Feb 25 07:08:06 2016 +0200

smbd: ignore SVHDX create context

According to discussions with doch...@microsoft.com, an SMB
server should ignore an SVHDX_OPEN_DEVICE_CONTEXT or
SVHDX_OPEN_DEVICE_CONTEXT_V2 create context if it does not
support the RSVD protocol. This is contrary to [MS-SMB2] rev 48.0
which states (3.3.5.9.14) that the open should fail in this case.

Failing the create fails Windows backup if the SMB dialect is
SMB3.0.2 or higher.

Hopefully a new revision of MS-SMB2 will clear this up in the future.

Meanwhile, this patch modifies smbd to ignore the
SVHDX_OPEN_DEVICE_CONTEXT by default. This can be overriden by a VFS
module if a VFS module adds support for RSVD.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11753
    
Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Richard Sharpe <realrichardsha...@gmail.com>

---

Summary of changes:
 source3/lib/netapi/tests/netuser.c |  2 +-
 source3/modules/vfs_btrfs.c|  2 +-
 source3/modules/vfs_default.c  | 16 
 source3/modules/vfs_gpfs.c | 21 -
 4 files changed, 14 insertions(+), 27 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/netapi/tests/netuser.c 
b/source3/lib/netapi/tests/netuser.c
index beeeb34..de5f0a1 100644
--- a/source3/lib/netapi/tests/netuser.c
+++ b/source3/lib/netapi/tests/netuser.c
@@ -244,7 +244,7 @@ static NET_API_STATUS test_netusermodals(struct 
libnetapi_ctx *ctx,
return status;
}
 
-   if (memcmp(u0, _u0, sizeof(u0) != 0)) {
+   if (memcmp(u0, _u0, sizeof(*u0)) != 0) {
printf("USER_MODALS_INFO_0 struct has changed\n");
return -1;
}
diff --git a/source3/modules/vfs_btrfs.c b/source3/modules/vfs_btrfs.c
index bd95637..154fcc3 100644
--- a/source3/modules/vfs_btrfs.c
+++ b/source3/modules/vfs_btrfs.c
@@ -531,7 +531,7 @@ static NTSTATUS btrfs_snap_create(struct vfs_handle_struct 
*handle,
ioctl_arg.fd = src_fd;
ioctl_arg.transid = 0;
ioctl_arg.flags = (rw == false) ? BTRFS_SUBVOL_RDONLY : 0;
-   memset(ioctl_arg.unused, 0, ARRAY_SIZE(ioctl_arg.unused));
+   memset(ioctl_arg.unused, 0, sizeof(ioctl_arg.unused));
len = strlcpy(ioctl_arg.name, dest_subvolume,
  ARRAY_SIZE(ioctl_arg.name));
if (len >= ARRAY_SIZE(ioctl_arg.name)) {
diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c
index c3ff1bc..b13b517 100644
--- a/source3/modules/vfs_default.c
+++ b/source3/modules/vfs_default.c
@@ -571,22 +571,6 @@ static NTSTATUS vfswrap_create_file(vfs_handle_struct 
*handle,
const struct smb2_create_blobs 
*in_context_blobs,
  

[SCM] Samba Shared Repository - branch master updated

2016-02-22 Thread Jeremy Allison
The branch, master has been updated
   via  fb0d624 torture:smb2: improve torture_comments in connect test
   via  78d7b23 torture:smb2: fix memory leak in connect test.
   via  4d9484e torture:smb2: rewrite connect test to use torture_asserts 
for create errors
   via  358c09b torture:smb2: rewrite connect test to use torture_asserts
   via  def483c winbindd: move a variable into scope
   via  b3931af s3-kerberos: avoid entering a password change dialogue also 
when using MIT.
  from  f6f43c4 winbind: Remove unused WINBINDD_UID_TO_SID

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


- Log -
commit fb0d6244278baa97c35101480b18640796f86bf1
Author: Michael Adam <ob...@samba.org>
Date:   Tue Feb 23 00:27:11 2016 +0100

torture:smb2: improve torture_comments in connect test

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

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Feb 23 04:50:53 CET 2016 on sn-devel-144

commit 78d7b23f2f55ebdc3ed2a2abdd68a294a8ef99f7
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 22 23:23:13 2016 +0100

torture:smb2: fix memory leak in connect test.

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

commit 4d9484e7c40cb3c3517538348fda521dafcd2f9a
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 22 16:22:14 2016 +0100

torture:smb2: rewrite connect test to use torture_asserts for create errors

let torture_smb2_createfile propagate errors

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

commit 358c09b899f62b6f9ac9693b9101639c0cde8d3f
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 22 14:32:44 2016 +0100

torture:smb2: rewrite connect test to use torture_asserts

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit def483c81536be8bf49f27c536fb37bef3e0930e
Author: Michael Adam <ob...@samba.org>
Date:   Mon Feb 22 15:18:26 2016 +0100

winbindd: move a variable into scope

    Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit b3931af2df293a9cb75f21cdbfb6725dff34
Author: Günther Deschner <g...@samba.org>
Date:   Mon Feb 15 12:58:07 2016 +0100

s3-kerberos: avoid entering a password change dialogue also when using MIT.

Without this fix, for accounts with an expired password, a password change
process is initiated and - due to the prompter - this fails with a confusing
error message:

"kerberos_kinit_password administra...@w2k12dom.ber.redhat.com failed: 
Password
mismatch
Failed to join domain: failed to connect to AD: Password mismatch"

    Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/libads/kerberos.c| 59 +++---
 source3/winbindd/winbindd_misc.c |  2 +-
 source4/torture/smb2/connect.c   | 89 
 wscript_configure_system_mitkrb5 |  1 +
 4 files changed, 73 insertions(+), 78 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 9a7a1e7..4774a9f 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -47,33 +47,44 @@ kerb_prompter(krb5_context ctx, void *data,
   krb5_prompt prompts[])
 {
if (num_prompts == 0) return 0;
-#if HAVE_KRB5_PROMPT_TYPE
-
-   /*
-* only heimdal has a prompt type and we need to deal with it here to
-* avoid loops.
-*
-* removing the prompter completely is not an option as at least these
-* versions would crash: heimdal-1.0.2 and heimdal-1.1. Later heimdal
-* version have looping detection and return with a proper error code.
-*/
-
-   if ((num_prompts == 2) &&
-   (prompts[0].type == KRB5_PROMPT_TYPE_NEW_PASSWORD) &&
-   (prompts[1].type == KRB5_PROMPT_TYPE_NEW_PASSWORD_AGAIN)) {
+   if (num_prompts == 2) {
/*
-* We don't want to change passwords here. We're
-* called from heimal when the KDC returns
-* KRB5KDC_ERR_KEY_EXPIRED, but at this point we don't
-* have the chance to ask the user for a new
-* password. If we return 0 (i.e. success), we will be
-* spinning in the endless for-loop in
-* change_password() in
-* source4/heimdal/lib/krb5/init_creds_pw.c:526ff
+* only heimdal has a prompt type and we need to deal with it 
here to
+* avoid loops.
+*
+ 

[SCM] Samba Shared Repository - branch master updated

2016-02-19 Thread Jeremy Allison
The branch, master has been updated
   via  4164111 testprogs/blackbox/subunit: Fix testok
   via  66f5d09 test_sharesec: Fix check for deleted ACL
   via  2272c97 test_sharesec: Fix usage message
   via  4a80114 test_sharesec: Add new test for ACL entry from numerical 
input
   via  4b56ce3 util_sd: Also accept hex input for ALLOW/DENIED
  from  da74d0c tevent: version 0.9.28

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


- Log -
commit 4164111f55a8104c8e9690dee0d824ac24d28089
Author: Christof Schmitt <c...@samba.org>
Date:   Mon Feb 8 14:20:56 2016 -0700

testprogs/blackbox/subunit: Fix testok

The fail count is always in the second parameter. Omit the shift
operations, so that the value can be read correctly from $2.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Feb 20 03:58:01 CET 2016 on sn-devel-144

commit 66f5d0902da209276124fb7c504a3e0d926d989b
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Feb 4 16:39:59 2016 -0700

test_sharesec: Fix check for deleted ACL

Remove semicolon; without this change the test could not detect a
failure of removing the ACL.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 2272c9723d1e8478a3173c297f809c539ac1fd5c
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Feb 4 16:35:25 2016 -0700

test_sharesec: Fix usage message

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4a80114a0e48d129cfd8a02ff97a2d5f17784a25
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Feb 4 16:35:08 2016 -0700

test_sharesec: Add new test for ACL entry from numerical input

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4b56ce3abdb459bffc182a55e2bc82eaf135635f
Author: Christof Schmitt <c...@samba.org>
Date:   Mon Feb 8 13:56:23 2016 -0700

util_sd: Also accept hex input for ALLOW/DENIED

Implement this by explicitly checking for decimal or hexadecimal input.
This avoids using sscanf with %i and a signed integer type, and it also
matches the code paths for flags and mask that also have an explicit
    check.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/lib/util_sd.c | 37 +--
 source3/script/tests/test_sharesec.sh | 18 +++--
 testprogs/blackbox/subunit.sh |  2 --
 3 files changed, 43 insertions(+), 14 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/util_sd.c b/source3/lib/util_sd.c
index 8065a0f..9a7b34f 100644
--- a/source3/lib/util_sd.c
+++ b/source3/lib/util_sd.c
@@ -418,14 +418,6 @@ bool parse_ace(struct cli_state *cli, struct security_ace 
*ace,
}
*p = '\0';
p++;
-   /* Try to parse numeric form */
-
-   if (sscanf(p, "%u/%u/%u", , , ) == 3 &&
-   StringToSid(cli, , str)) {
-   goto done;
-   }
-
-   /* Try to parse text form */
 
if (!StringToSid(cli, , str)) {
printf("ACE '%s': failed to convert '%s' to SID\n",
@@ -448,6 +440,33 @@ bool parse_ace(struct cli_state *cli, struct security_ace 
*ace,
atype = SEC_ACE_TYPE_ACCESS_ALLOWED;
} else if (strncmp(tok, "DENIED", strlen("DENIED")) == 0) {
atype = SEC_ACE_TYPE_ACCESS_DENIED;
+
+   } else if (strnequal(tok, "0x", 2)) {
+   int result;
+
+   result = sscanf(tok, "%x", );
+   if (result == 0 ||
+   (atype != SEC_ACE_TYPE_ACCESS_ALLOWED &&
+atype != SEC_ACE_TYPE_ACCESS_DENIED)) {
+   printf("ACE '%s': bad hex value for type at '%s'\n",
+  orig_str, tok);
+   SAFE_FREE(str);
+   TALLOC_FREE(frame);
+   return false;
+   }
+   } else if(tok[0] >= '0' && tok[0] <= '9') {
+   int result;
+
+   result = sscanf(tok, "%u", );
+   if (result == 0 ||
+   (atype != SEC_ACE_TYPE_ACCESS_ALLOWED &&
+atype != SEC_ACE_TYPE_ACCESS_DENIED)) {
+   printf("ACE '%s': bad integer value for type at '%s'\n",
+  orig_str, tok);
+ 

[SCM] Samba Shared Repository - branch master updated

2016-02-17 Thread Jeremy Allison
The branch, master has been updated
   via  03081c2 Real memeory leak(buildup) issue in loadparm.
  from  7eab9e5 s4:selftest: run samba4.ldap.notification.python

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


- Log -
commit 03081c2c1484504bdcc0e111b2df95e073c1c166
Author: Hemanth Thummala <hemanth.thumm...@nutanix.com>
Date:   Tue Feb 16 14:44:38 2016 -0800

Real memeory leak(buildup) issue in loadparm.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11740

As part of reload services, unused service ptr structures are getting
unloaded without actually freeingup the memory associated to them.

Made changes to freeup those allocations on unload. On reload, reuse the
slots in ServicePtr global array instead of extending the array with
holes.

Also we should mark shares like IPC$ as auto loaded as they never be
exposed to users.

Signed-off-by: Hemanth Thummala <hemanth.thumm...@nutanix.com>
Reviewed-by: Volker Lendecke <volker.lende...@sernet.de>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Feb 17 22:30:25 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/param/loadparm.c | 40 +++-
 1 file changed, 27 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 7c3195b..50b29e3 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -93,8 +93,11 @@ static struct smbconf_csn conf_last_csn;
 static int config_backend = CONFIG_BACKEND_FILE;
 
 /* some helpful bits */
-#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && (ServicePtrs != 
NULL) && ServicePtrs[(i)]->valid)
-#define VALID(i) (ServicePtrs != NULL && ServicePtrs[i]->valid)
+#define LP_SNUM_OK(i) (((i) >= 0) && ((i) < iNumServices) && \
+   (ServicePtrs != NULL) && \
+  (ServicePtrs[(i)] != NULL) && ServicePtrs[(i)]->valid)
+#define VALID(i) ((ServicePtrs != NULL) && (ServicePtrs[i]!= NULL) && \
+  ServicePtrs[i]->valid)
 
 #define USERSHARE_VALID 1
 #define USERSHARE_PENDING_DELETE 2
@@ -1358,7 +1361,7 @@ static void free_service_byindex(int idx)
}
 
free_service(ServicePtrs[idx]);
-   talloc_free_children(ServicePtrs[idx]);
+   TALLOC_FREE(ServicePtrs[idx]);
 }
 
 /***
@@ -1380,20 +1383,30 @@ static int add_a_service(const struct loadparm_service 
*pservice, const char *na
}
}
 
-   /* if not, then create one */
-   i = iNumServices;
-   tsp = talloc_realloc(NULL, ServicePtrs, struct loadparm_service *, 
num_to_alloc);
-   if (tsp == NULL) {
-   DEBUG(0,("add_a_service: failed to enlarge ServicePtrs!\n"));
-   return (-1);
+   /* Re use empty slots if any before allocating new one.*/
+   for (i=0; i < iNumServices; i++) {
+   if (ServicePtrs[i] == NULL) {
+   break;
+   }
}
-   ServicePtrs = tsp;
-   ServicePtrs[iNumServices] = talloc_zero(ServicePtrs, struct 
loadparm_service);
-   if (!ServicePtrs[iNumServices]) {
+   if (i == iNumServices) {
+   /* if not, then create one */
+   tsp = talloc_realloc(NULL, ServicePtrs,
+struct loadparm_service *,
+num_to_alloc);
+   if (tsp == NULL) {
+   DEBUG(0, ("add_a_service: failed to enlarge "
+ "ServicePtrs!\n"));
+   return (-1);
+   }
+   ServicePtrs = tsp;
+   iNumServices++;
+   }
+   ServicePtrs[i] = talloc_zero(ServicePtrs, struct loadparm_service);
+   if (!ServicePtrs[i]) {
DEBUG(0,("add_a_service: out of memory!\n"));
return (-1);
}
-   iNumServices++;
 
ServicePtrs[i]->valid = true;
 
@@ -1559,6 +1572,7 @@ static bool lp_add_ipc(const char *ipc_name, bool 
guest_ok)
ServicePtrs[i]->guest_ok = guest_ok;
ServicePtrs[i]->printable = false;
ServicePtrs[i]->browseable = sDefault.browseable;
+   ServicePtrs[i]->autoloaded = true;
 
DEBUG(3, ("adding IPC service\n"));
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-02-16 Thread Jeremy Allison
The branch, master has been updated
   via  a077e2a FIXUP: s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const 
struct smb_filename *
   via  616d068 s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct 
smb_filename * instead of const char *
  from  3330c79 tdb: eliminate deprecation warnings in python tests

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


- Log -
commit a077e2ae62fea085f392cc32f1eb48942f5d43c7
Author: Ralph Boehme <s...@samba.org>
Date:   Sun Feb 14 21:36:15 2016 +0100

FIXUP: s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct 
smb_filename *

Signed-off-by: Ralph Boehme <s...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Tue Feb 16 23:26:48 CET 2016 on sn-devel-144

commit 616d068f0cebb8e50a855b6e30f36fccb7f5a3c8
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Feb 12 10:30:10 2016 -0800

s3: VFS: Modify SMB_VFS_GET_NT_ACL to take a const struct smb_filename * 
instead of const char *

Bumps VFS version to 35.

Preparing to reduce use of lp_posix_pathnames().

Most of this is boilerplate, the only subtleties are in
the modules:

vfs_catia.c
vfs_media_harmony.c
vfs_shadow_copy2.c
vfs_unityed_media.c

Where the path is modified then passed to SMB_VFS_NEXT_GET_NT_ACL().
In these cases the change uses synthetic_smb_fname() to
create a new struct smb_filename from the modified path.
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Ralph Boehme <r...@sernet.de>

---

Summary of changes:
 examples/VFS/skel_opaque.c  |  3 ++-
 examples/VFS/skel_transparent.c | 10 +++---
 source3/include/vfs.h   |  9 ++---
 source3/include/vfs_macros.h|  8 
 source3/modules/vfs_acl_common.c| 21 ++---
 source3/modules/vfs_catia.c | 16 ++--
 source3/modules/vfs_default.c   |  9 ++---
 source3/modules/vfs_full_audit.c|  6 +++---
 source3/modules/vfs_media_harmony.c | 21 -
 source3/modules/vfs_nfs4acl_xattr.c |  4 +++-
 source3/modules/vfs_shadow_copy2.c  | 36 ++--
 source3/modules/vfs_snapper.c   | 33 +++--
 source3/modules/vfs_time_audit.c|  8 +---
 source3/modules/vfs_unityed_media.c | 21 -
 source3/smbd/dir.c  |  2 +-
 source3/smbd/file_access.c  | 12 +++-
 source3/smbd/open.c | 27 +++
 source3/smbd/posix_acls.c   | 15 ++-
 source3/smbd/pysmbd.c   | 18 --
 source3/smbd/vfs.c  |  8 ++--
 source3/torture/cmd_vfs.c   | 12 +++-
 21 files changed, 235 insertions(+), 64 deletions(-)


Changeset truncated at 500 lines:

diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c
index a4309d4..0d5571c 100644
--- a/examples/VFS/skel_opaque.c
+++ b/examples/VFS/skel_opaque.c
@@ -667,7 +667,8 @@ static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, 
files_struct *fsp,
 }
 
 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
-   const char *name, uint32_t security_info,
+   const struct smb_filename *smb_fname,
+   uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
 {
diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c
index 2d1ed79..fc3c818 100644
--- a/examples/VFS/skel_transparent.c
+++ b/examples/VFS/skel_transparent.c
@@ -794,12 +794,16 @@ static NTSTATUS skel_fget_nt_acl(vfs_handle_struct 
*handle, files_struct *fsp,
 }
 
 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
-   const char *name, uint32_t security_info,
+   const struct smb_filename *smb_fname,
+   uint32_t security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
 {
-   return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, mem_ctx,
-  ppdesc);
+   return SMB_VFS_NEXT_GET_NT_ACL(handle,
+   smb_fname,
+   security_info,
+   mem_ctx,
+   ppdesc);
 }
 
 static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index c18ea59..d416a5b 100644
--- a/s

[SCM] Samba Shared Repository - branch master updated

2016-02-12 Thread Jeremy Allison
The branch, master has been updated
   via  92afa1b smbd: Simplify chroot option in smbd
  from  b504918 s3-waf: Install smbspool_krb5_wrapper in LIBEXECDIR

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


- Log -
commit 92afa1b165841356d6a3fb2ac44d9a5460bffea5
Author: Andreas Schneider <a...@samba.org>
Date:   Wed Feb 10 16:19:56 2016 +0100

smbd: Simplify chroot option in smbd

rpmlint has a check for this and prefers to call chdir() before
chroot(). If not it will complain with
missing-call-to-chdir-with-chroot. The old code equivalent secure. See

http://unixwiz.net/techtips/chroot-practices.html

This removes several unneeded talloc_tos() calls.

Signed-off-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Feb 13 03:50:54 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/process.c | 23 +++
 1 file changed, 15 insertions(+), 8 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 25c6d05..34939f0 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -3903,6 +3903,8 @@ void smbd_process(struct tevent_context *ev_ctx,
NTSTATUS status;
struct timeval tv = timeval_current();
NTTIME now = timeval_to_nttime();
+   char *chroot_dir = NULL;
+   int rc;
 
status = smbXsrv_client_create(ev_ctx, ev_ctx, msg_ctx, now, );
if (!NT_STATUS_IS_OK(status)) {
@@ -4024,17 +4026,22 @@ void smbd_process(struct tevent_context *ev_ctx,
exit_server("Could not open account policy tdb.\n");
}
 
-   if (*lp_root_directory(talloc_tos())) {
-   if (chroot(lp_root_directory(talloc_tos())) != 0) {
-   DEBUG(0,("Failed to change root to %s\n",
-lp_root_directory(talloc_tos(;
-   exit_server("Failed to chroot()");
+   chroot_dir = lp_root_directory(talloc_tos());
+   if (chroot_dir[0] != '\0') {
+   rc = chdir(chroot_dir);
+   if (rc != 0) {
+   DBG_ERR("Failed to chdir to %s\n", chroot_dir);
+   exit_server("Failed to chdir()");
}
-   if (chdir("/") == -1) {
-   DEBUG(0,("Failed to chdir to / on chroot to %s\n", 
lp_root_directory(talloc_tos(;
+
+   rc = chroot(chroot_dir);
+   if (rc != 0) {
+   DBG_ERR("Failed to change root to %s\n", chroot_dir);
exit_server("Failed to chroot()");
}
-   DEBUG(0,("Changed root to %s\n", 
lp_root_directory(talloc_tos(;
+   DBG_WARNING("Changed root to %s\n", chroot_dir);
+
+   TALLOC_FREE(chroot_dir);
}
 
if (!file_init(sconn)) {


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-02-10 Thread Jeremy Allison
The branch, master has been updated
   via  dcf6a60 nss_netbsd: Remove unimplemented prototypes
   via  dfe5139 nss_linux: Remove non-nss functions
  from  519564b ctdb-scripts: Drop use of "smbcontrol winbindd ip-dropped 
..."

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


- Log -
commit dcf6a606cfa5321fdabedb6d535d3b4353993898
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Feb 9 07:52:31 2016 +0100

nss_netbsd: Remove unimplemented prototypes

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>

    Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Feb 11 04:43:53 CET 2016 on sn-devel-144

commit dfe51390a0c61e676b325155be6f126755ad5c78
Author: Volker Lendecke <v...@samba.org>
Date:   Tue Feb 9 07:50:10 2016 +0100

nss_linux: Remove non-nss functions

These functions were meant as a standard interface before libwbclient was
developed.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 nsswitch/winbind_nss_linux.c  | 371 --
 nsswitch/winbind_nss_netbsd.c |  13 --
 2 files changed, 384 deletions(-)


Changeset truncated at 500 lines:

diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
index 3099413..2b31bac 100644
--- a/nsswitch/winbind_nss_linux.c
+++ b/nsswitch/winbind_nss_linux.c
@@ -57,19 +57,6 @@ NSS_STATUS _nss_winbind_getgrgid_r(gid_t gid, struct group 
*result, char *buffer
 NSS_STATUS _nss_winbind_initgroups_dyn(char *user, gid_t group, long int 
*start,
   long int *size, gid_t **groups,
   long int limit, int *errnop);
-NSS_STATUS _nss_winbind_getusersids(const char *user_sid, char **group_sids,
-   int *num_groups, char *buffer, size_t 
buf_size,
-   int *errnop);
-NSS_STATUS _nss_winbind_nametosid(const char *name, char **sid, char *buffer,
- size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_sidtoname(const char *sid, char **name, char *buffer,
- size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_sidtouid(const char *sid, uid_t *uid, int *errnop);
-NSS_STATUS _nss_winbind_sidtogid(const char *sid, gid_t *gid, int *errnop);
-NSS_STATUS _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer,
-size_t buflen, int *errnop);
-NSS_STATUS _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer,
-size_t buflen, int *errnop);
 
 /*
  /
@@ -1158,361 +1145,3 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, 
long int *start,
 
return ret;
 }
-
-
-/* return a list of group SIDs for a user SID */
-NSS_STATUS
-_nss_winbind_getusersids(const char *user_sid, char **group_sids,
-int *num_groups,
-char *buffer, size_t buf_size, int *errnop)
-{
-   NSS_STATUS ret;
-   struct winbindd_request request;
-   struct winbindd_response response;
-
-#ifdef DEBUG_NSS
-   fprintf(stderr, "[%5d]: getusersids %s\n", getpid(), user_sid);
-#endif
-
-#if HAVE_PTHREAD
-   pthread_mutex_lock(_nss_mutex);
-#endif
-
-   ZERO_STRUCT(request);
-   ZERO_STRUCT(response);
-
-   strncpy(request.data.sid, user_sid,sizeof(request.data.sid) - 1);
-   request.data.sid[sizeof(request.data.sid) - 1] = '\0';
-
-   ret = winbindd_request_response(NULL, WINBINDD_GETUSERSIDS,
-   , );
-
-   if (ret != NSS_STATUS_SUCCESS) {
-   goto done;
-   }
-
-   if (buf_size < response.length - sizeof(response)) {
-   ret = NSS_STATUS_TRYAGAIN;
-   errno = *errnop = ERANGE;
-   goto done;
-   }
-
-   *num_groups = response.data.num_entries;
-   *group_sids = buffer;
-   memcpy(buffer, response.extra_data.data, response.length - 
sizeof(response));
-   errno = *errnop = 0;
-
- done:
-   winbindd_free_response();
-
-#if HAVE_PTHREAD
-   pthread_mutex_unlock(_nss_mutex);
-#endif
-
-   return ret;
-}
-
-
-/* map a user or group name to a SID string */
-NSS_STATUS
-_nss_winbind_nametosid(const char *name, char **sid, char *buffer,
-  size_t buflen, int *errnop)
-{
-   NSS_STATUS ret;
-   struct winbindd_re

[SCM] Samba Shared Repository - branch master updated

2016-02-09 Thread Jeremy Allison
The branch, master has been updated
   via  1d26012 asn1: Ensure asn1_tag_remaining() only ever returns -1 as 
an error condition.
   via  697088e asn1: Make asn1_peek_tag_needed_size() use the same 
overflow protection as asn1_start_tag().
   via  f60f7a6 asn1: Protect against overlong tag lengths
  from  171fdc2 ctdb-recovery: Fix newlines in log messages

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


- Log -
commit 1d26012ce84d12cba236e5a88be25e6d489c9144
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Feb 5 13:21:29 2016 -0800

asn1: Ensure asn1_tag_remaining() only ever returns -1 as an error 
condition.

Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Volker Lendecke <v...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Feb 10 01:38:03 CET 2016 on sn-devel-144

commit 697088ef165d9ee42502d7a8ab51edc90010386e
Author: Jeremy Allison <j...@samba.org>
Date:   Fri Feb 5 13:15:57 2016 -0800

asn1: Make asn1_peek_tag_needed_size() use the same overflow protection as 
asn1_start_tag().
    
    Signed-off-by: Jeremy Allison <j...@samba.org>
Reviewed-by: Volker Lendecke <v...@samba.org>

commit f60f7a62e259ec518c94c08b23ef0dce9d41083b
Author: Volker Lendecke <v...@samba.org>
Date:   Fri Feb 5 12:58:45 2016 -0800

asn1: Protect against overlong tag lengths

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/util/asn1.c | 31 +--
 1 file changed, 29 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/asn1.c b/lib/util/asn1.c
index 9aa9772..9d6d416 100644
--- a/lib/util/asn1.c
+++ b/lib/util/asn1.c
@@ -593,12 +593,24 @@ static bool asn1_peek_tag_needed_size(struct asn1_data 
*data, uint8_t tag,
}
taglen = b;
while (n > 1) {
+   size_t tmp_taglen;
+
if (!asn1_read_uint8(data, )) {
data->ofs = start_ofs;
data->has_error = false;
return false;
}
-   taglen = (taglen << 8) | b;
+
+   tmp_taglen = (taglen << 8) | b;
+
+   if ((tmp_taglen >> 8) != taglen) {
+   /* overflow */
+   data->ofs = start_ofs;
+   data->has_error = false;
+   return false;
+   }
+   taglen = tmp_taglen;
+
n--;
}
} else {
@@ -641,9 +653,20 @@ bool asn1_start_tag(struct asn1_data *data, uint8_t tag)
return false;
nesting->taglen = b;
while (n > 1) {
+   size_t taglen;
+
if (!asn1_read_uint8(data, ))
return false;
-   nesting->taglen = (nesting->taglen << 8) | b;
+
+   taglen = (nesting->taglen << 8) | b;
+
+   if ((taglen >> 8) != nesting->taglen) {
+   /* overflow */
+   data->has_error = true;
+   return false;
+   }
+   nesting->taglen = taglen;
+
n--;
}
} else {
@@ -698,6 +721,10 @@ int asn1_tag_remaining(struct asn1_data *data)
data->has_error = true;
return -1;
}
+   if (remaining < 0) {
+   data->has_error = true;
+   return -1;
+   }
return remaining;
 }
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-02-06 Thread Jeremy Allison
The branch, master has been updated
   via  1f6495b ctdb/server: fix gcc6 build warning.
   via  1a4b8cc s4-libgpo: fix gcc6 build warning.
   via  3b230d2 s4-torture: fix gcc6 build warnings.
   via  1c80f10 s4-torture: fix gcc6 build warning.
   via  3536a23 s4-torture: fix gcc6 build warning.
   via  a3f7b51 s4-torture: fix gcc6 build warning.
   via  5544756 s4-torture: fix gcc6 build warning.
   via  d44f488 ldb: remove outdated comment about type argument in dlist
   via  310da05 tevent: remove outdated comment about type argument in dlist
   via  025c59d dlist: remove outdated comment about type argument
   via  2fd63ec dlist: remove unneeded type argument from 
DLIST_CONCATENATE()
   via  0f6c00b tevent: remove unneeded type argument from 
DLIST_CONCATENATE()
   via  1441824 ldb: remove unneeded argument type from DLIST_CONCATENATE()
   via  be2a341 tevent: remove uneeded type argument from DLIST_DEMOTE()
   via  a1c5d66 ldb: remove uneeded type argument from DLIST_DEMOTE()
   via  d6f5fc8 dlist: remove unneeded argument from DLIST_DEMOTE()
   via  66af807 ldb: remove unneeded type arg from DLIST_ADD_END
   via  a091c0a tevent: remove unneeded type argument from DLIST_ADD_END
   via  476672b dlist: remove unneeded type argument from DLIST_ADD_END()
  from  5d759bd pdb: Fix segfault in pdb_ldap for missing gecos

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


- Log -
commit 1f6495b2f5e49e25176f97ef9aa7516403db91d6
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:39:46 2016 +0100

ctdb/server: fix gcc6 build warning.

ctdb/server/ipalloc_lcp2.c:264:29: warning: 'minimbl' may be used 
uninitialized
in this function [-Wmaybe-uninitialized]

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sun Feb  7 00:56:44 CET 2016 on sn-devel-144

commit 1a4b8cc70772f36b02cf8b464a5364f0196ef0d1
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:37:45 2016 +0100

s4-libgpo: fix gcc6 build warning.

source4/lib/policy/gp_ldap.c:48:35: warning: 'gpo_inheritance' defined but 
not
used [-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3b230d21bc270bef1c309471749d2081744152cd
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:36:15 2016 +0100

s4-torture: fix gcc6 build warnings.

source4/torture/nbt/winsreplication.c:523:30: warning: 'addresses_X_1_2' 
defined but not used [-Wunused-const-variable]
source4/torture/nbt/winsreplication.c:470:30: warning: 'addresses_B_2' 
defined but not used [-Wunused-const-variable]
source4/torture/nbt/winsreplication.c:445:30: warning: 
'addresses_A_3_4_X_1_2' defined but not used [-Wunused-const-variable]

Guenther

Signed-off-by: Günther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 1c80f102994901d9af455da9a42a2c66e6839c68
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:33:32 2016 +0100

s4-torture: fix gcc6 build warning.

source4/torture/rpc/forest_trust.c:408:22: warning: 'my_blob' defined but 
not
used [-Wunused-const-variable]

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3536a2318f40d7af19c3e364e42c4f816d7a409a
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:32:17 2016 +0100

s4-torture: fix gcc6 build warning.

source4/torture/ndr/samr.c:277:22: warning:
'samr_changepassworduser3_w2k_out_data' defined but not used
[-Wunused-const-variable]

Guenther

    Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a3f7b51688662f049243968e5bb2eef1e9f1801b
Author: Günther Deschner <g...@samba.org>
Date:   Mon Feb 1 16:06:18 2016 +0100

s4-torture: fix gcc6 build warning.

source4/torture/ndr/drsuapi.c:272:22: warning: 'DsBind_req2_dat' defined but
not used [-Wunused-const-variable]

    Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 5544756733ced826e1f42fdeae1b67348501668f
Author: Günther Deschner <g...@samba.org>
Date:   Fri Feb 5 11:14:58 2016 +0100

s4-torture: fix gcc6 build warning.

source4/torture/raw/eas.c:322:17: warning: comparison of constant '0' with
boolean expression is always false [-Wbool-compare]

Guenther

Signed-off-by: Guenther Deschner &

[SCM] Samba Shared Repository - branch master updated

2016-02-04 Thread Jeremy Allison
The branch, master has been updated
   via  aec07b8 s3:smbd:open: Skip redundant call to file_set_dosmode when 
creating a new file.
  from  8247d93 loadparm: Fix memory leak issue.

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


- Log -
commit aec07b8b60ff9589a3c84eef6adeca464e6c01f6
Author: Jose A. Rivera <jar...@samba.org>
Date:   Wed Feb 3 20:58:19 2016 -0600

s3:smbd:open: Skip redundant call to file_set_dosmode when creating a new 
file.

Signed-off-by: Jose A. Rivera <jar...@samba.org>
Pair-programmed-with: Ira Cooper <i...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Feb  5 04:37:43 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/open.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index ed0594b..fa817e4 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -3169,8 +3169,8 @@ static NTSTATUS open_file_ntcreate(connection_struct 
*conn,
}
 
if (info != FILE_WAS_OPENED) {
-   /* Files should be initially set as archive */
-   if (lp_map_archive(SNUM(conn)) ||
+   /* Overwritten files should be initially set as archive */
+   if ((info == FILE_WAS_OVERWRITTEN && 
lp_map_archive(SNUM(conn))) ||
lp_store_dos_attributes(SNUM(conn))) {
if (!posix_open) {
if (file_set_dosmode(conn, smb_fname,


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-01-27 Thread Jeremy Allison
The branch, master has been updated
   via  526a387 selftest: un-flap samba3.blackbox.dfree_quota
   via  e7a8ef4 selftest: fix test_dfree_quota.sh
   via  05a1ba8 selftest: add test case for different quote/dfree block size
   via  67c8971 smbd: show correct disk size for different quota and dfree 
block sizes
  from  6bbf7d8 ctdb: NAT gateway capability and control to set it are 
obsolete

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


- Log -
commit 526a3878382582d2f83aee900d9afeadfc53462a
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Jan 27 22:09:51 2016 +0200

selftest: un-flap samba3.blackbox.dfree_quota

Remove test from flapping list after fix.

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Jan 28 01:10:54 CET 2016 on sn-devel-144

commit e7a8ef4f260cc3d07654664c9e547263a2bc8ee6
Author: Uri Simchoni <u...@samba.org>
Date:   Wed Jan 27 21:47:30 2016 +0200

selftest: fix test_dfree_quota.sh

Eliminate backslashes from smbcquotas output so that we
don't have to deal with them correctly when parsing the output.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11697

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 05a1ba899583d38a85f460990e946fa2fde30cd1
Author: Uri Simchoni <u...@samba.org>
Date:   Tue Jan 19 14:38:03 2016 +0200

selftest: add test case for different quote/dfree block size

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11681

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 67c89715d00abc588239d8220f09cf51a58db05a
Author: Uri Simchoni <u...@samba.org>
Date:   Tue Jan 19 14:57:16 2016 +0200

smbd: show correct disk size for different quota and dfree block sizes

When file system stats (VFS disk_free_fn) and quota (VFS get_quota_fn)
return different block sizes, normalize values before comparing.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11681

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 selftest/flapping| 1 -
 source3/script/tests/test_dfree_quota.sh | 9 +++--
 source3/smbd/dfree.c | 9 -
 3 files changed, 15 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/selftest/flapping b/selftest/flapping
index 8b05593..1928180 100644
--- a/selftest/flapping
+++ b/selftest/flapping
@@ -30,4 +30,3 @@
 ^samba4.blackbox.samba_tool_demote # flakey on sn-devel
 ^samba4.blackbox.dbcheck # flakey on sn-devel
 ^samba4.smb2.create.mkdir-dup\(ad_dc_ntvfs\) # This test (for bug 11486) 
involves a race, not always protected against in the NTVFS file server
-^samba3.blackbox.dfree_quota #flakey on sn-devel
diff --git a/source3/script/tests/test_dfree_quota.sh 
b/source3/script/tests/test_dfree_quota.sh
index c693b7b..6240b56 100755
--- a/source3/script/tests/test_dfree_quota.sh
+++ b/source3/script/tests/test_dfree_quota.sh
@@ -64,6 +64,8 @@ trygrp1:g$gid:block size = 4096:hard limit = 60:soft limit = 
60:cur blocks = 55
 trygrp2:df:block size = 4096:disk free = 10:disk size = 80
 trygrp2:u$uid:block size = 4096:hard limit = 0:soft limit = 0:cur blocks = 41
 trygrp2:g$gid:block size = 4096:hard limit = 60:soft limit = 60:cur blocks = 56
+blksize:df:block size = 512:disk free = 614400:disk size = 614400
+blksize:u$uid:block size = 1024:hard limit = 512000:soft limit = 0:cur blocks 
= 0
 ABC
 }
 
@@ -128,10 +130,10 @@ test_smbcquotas() {
 shift
subunit_start_test "$name"
 setup_conf "$conf" "."
-   output=$($VALGRIND $smbcquotas //$SERVER/dfq $@ 2>/dev/null)
+   output=$($VALGRIND $smbcquotas //$SERVER/dfq $@ 2>/dev/null | tr '\\' 
'/')
status=$?
if [ "$status" = "0" ]; then
-   received=$(echo "$output" | awk "/$SERVER$user/ {printf 
\"%s%s%s\", \$3, \$4, \$5}")
+   received=$(echo "$output" | awk "/$SERVER\\/$user/ {printf 
\"%s%s%s\", \$3, \$4, \$5}")
if [ "$expected" = "$received" ]; then
subunit_pass_test "$name"
else
@@ -170,5 +172,8 @@ test_smbclient_dfree "Test quota->dfree inode hard limit" 
"subdir1" "ihlimit sub
 test_smbclient_dfree "Test quota->dfree err try group" "subdir1" "trygrp1 
subdir1" "240 1024. 2

[SCM] Samba Shared Repository - branch master updated

2016-01-26 Thread Jeremy Allison
The branch, master has been updated
   via  f0c43ce dbwrap_file: fix use of read_data()
   via  32e545e s4-torture: let smb2.replay.replay4 test deal with scale 
out shares.
   via  757ade6 s4-torture: let smb2.replay.replay3 test deal with scale 
out shares.
   via  9c23f43 s4-torture: let smb2.replay.replay2 test deal with scale 
out shares.
  from  07bb954 VERSION: Bump version up to 4.5.0pre1

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


- Log -
commit f0c43ceec5185ef4bc429e201339f3eb3e7c094b
Author: Uri Simchoni <u...@samba.org>
Date:   Thu Jan 21 13:18:20 2016 +0200

dbwrap_file: fix use of read_data()

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jan 27 00:09:05 CET 2016 on sn-devel-144

commit 32e545ecea4f217c8b723fbea5d9131573a50488
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 18:30:15 2016 +0100

s4-torture: let smb2.replay.replay4 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 757ade67e6830ed66eeeb4954d1fd24d83effb13
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 18:24:08 2016 +0100

s4-torture: let smb2.replay.replay3 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 9c23f43f9edd8cfbfdd56e397748e2f74b1ef29b
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 18:07:31 2016 +0100

s4-torture: let smb2.replay.replay2 test deal with scale out shares.

Guenther

Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 lib/dbwrap/dbwrap_file.c  | 11 +++---
 source4/torture/smb2/replay.c | 80 ++-
 2 files changed, 68 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/dbwrap/dbwrap_file.c b/lib/dbwrap/dbwrap_file.c
index a3b1737..46e62c8 100644
--- a/lib/dbwrap/dbwrap_file.c
+++ b/lib/dbwrap/dbwrap_file.c
@@ -171,7 +171,7 @@ static struct db_record *db_file_fetch_locked(struct 
db_context *db,
result->value.dptr = NULL;
 
if (statbuf.st_ex_size != 0) {
-   NTSTATUS status;
+   ssize_t read_bytes;
 
result->value.dsize = statbuf.st_ex_size;
result->value.dptr = talloc_array(result, uint8_t,
@@ -182,11 +182,10 @@ static struct db_record *db_file_fetch_locked(struct 
db_context *db,
return NULL;
}
 
-   status = read_data(file->fd, (char *)result->value.dptr,
- result->value.dsize);
-   if (!NT_STATUS_IS_OK(status)) {
-   DEBUG(3, ("read_data failed: %s\n",
- nt_errstr(status)));
+   read_bytes = read_data(file->fd, (char *)result->value.dptr,
+  result->value.dsize);
+   if (read_bytes != result->value.dsize) {
+   DEBUG(3, ("read_data failed: %s\n", strerror(errno)));
TALLOC_FREE(result);
return NULL;
}
diff --git a/source4/torture/smb2/replay.c b/source4/torture/smb2/replay.c
index 57b14f1..4b3f569 100644
--- a/source4/torture/smb2/replay.c
+++ b/source4/torture/smb2/replay.c
@@ -302,12 +302,17 @@ static bool test_replay2(struct torture_context *tctx, 
struct smb2_tree *tree)
bool ret = true;
const char *fname = BASEDIR "\\replay2.dat";
struct smb2_transport *transport = tree->session->transport;
+   uint32_t share_capabilities;
+   bool share_is_so;
 
if (smbXcli_conn_protocol(transport->conn) < PROTOCOL_SMB3_00) {
torture_skip(tctx, "SMB 3.X Dialect family required for "
   "replay tests\n");
}
 
+   share_capabilities = smb2cli_tcon_capabilities(tree->smbXcli);
+   share_is_so = share_capabilities & SMB2_SHARE_CAP_SCALEOUT;
+
ZERO_STRUCT(break_info);
break_info.tctx = tctx;
tree->session->transport->oplock.handler = torture_oplock_ack_handler;
@@ -336,10 +341,16 @@ static bool test_replay2(struct torture_context *tctx, 
struct smb2_tree *tree)
_h = io.out.file.handle;
h = &_h;
CHECK_CREATED(, CREATED, FILE_ATTRIBUTE_ARCHIVE);
-   CHECK_VAL(io.o

[SCM] Samba Shared Repository - branch master updated

2016-01-26 Thread Jeremy Allison
The branch, master has been updated
   via  465c3d9 smbd quotas: avoid stat of foreign file systems
   via  c6ed45f s3-lib: introduce sys_realpath()
  from  f0c43ce dbwrap_file: fix use of read_data()

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


- Log -
commit 465c3d9a4e1a30e334922149f3ed1057f09fe169
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Jan 18 23:34:48 2016 +0200

smbd quotas: avoid stat of foreign file systems

When determining the block device of our file system, avoid
stat'ing paths which are definitely not the mount point of
our file system. This is done to avoid stalling smbd due to
unresponsive network file systems (e.g. NFS) which are not
related to the SMB shares.

See discussion in samba-technical for vfs_fileid:
https://lists.samba.org/archive/samba-technical/2016-January/111553.html

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jan 27 03:35:48 CET 2016 on sn-devel-144

commit c6ed45fe710924f847f46d505ceabfec21e7cf38
Author: Uri Simchoni <u...@samba.org>
Date:   Mon Jan 18 23:34:06 2016 +0200

s3-lib: introduce sys_realpath()

Add sys_realpath() function that captures the OS variations
on realpath().

Signed-off-by: Uri Simchoni <u...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/include/proto.h   |  1 +
 source3/lib/sysquotas.c   | 71 +--
 source3/lib/system.c  | 25 +++
 source3/modules/vfs_default.c | 15 +
 4 files changed, 88 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index e18aaf4..09e9915 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -264,6 +264,7 @@ int sys_setxattr (const char *path, const char *name, const 
void *value, size_t
 int sys_fsetxattr (int filedes, const char *name, const void *value, size_t 
size, int flags);
 uint32_t unix_dev_major(SMB_DEV_T dev);
 uint32_t unix_dev_minor(SMB_DEV_T dev);
+char *sys_realpath(const char *path);
 #if 0
 int sys_get_number_of_cores(void);
 #endif
diff --git a/source3/lib/sysquotas.c b/source3/lib/sysquotas.c
index 2ef1d1b..bacc4b2 100644
--- a/source3/lib/sysquotas.c
+++ b/source3/lib/sysquotas.c
@@ -40,35 +40,84 @@
 
 #endif /* NO_QUOTACTL_USED */
 
-#ifdef HAVE_MNTENT
+#if defined(HAVE_MNTENT) && defined(HAVE_REALPATH)
 static int sys_path_to_bdev(const char *path, char **mntpath, char **bdev, 
char **fs)
 {
int ret = -1;
SMB_STRUCT_STAT S;
FILE *fp;
-   struct mntent *mnt;
+   struct mntent *mnt = NULL;
SMB_DEV_T devno;
+   char *stat_mntpath = NULL;
+   char *p;
 
/* find the block device file */
-
-   if (!path||!mntpath||!bdev||!fs)
-   smb_panic("sys_path_to_bdev: called with NULL pointer");
-
(*mntpath) = NULL;
(*bdev) = NULL;
(*fs) = NULL;
-   
-   if ( sys_stat(path, , false) == -1 )
-   return (-1);
+
+   if (sys_stat(path, , false) != 0) {
+   return -1;
+   }
 
devno = S.st_ex_dev ;
 
+   stat_mntpath = sys_realpath(path);
+   if (stat_mntpath == NULL) {
+   DBG_WARNING("realpath(%s) failed - %s\n", path,
+   strerror(errno));
+   goto out;
+   }
+
+   if (sys_stat(stat_mntpath, , false) != 0) {
+   DBG_WARNING("cannot stat real path %s - %s\n", stat_mntpath,
+   strerror(errno));
+   goto out;
+   }
+
+   if (S.st_ex_dev != devno) {
+   DBG_WARNING("device on real path has changed\n");
+   goto out;
+   }
+
+   while (true) {
+   p = strrchr(stat_mntpath, '/');
+   if (p == NULL) {
+   DBG_ERR("realpath for %s does not begin with a '/'\n",
+   path);
+   goto out;
+   }
+
+   if (p == stat_mntpath) {
+   ++p;
+   }
+
+   *p = 0;
+   if (sys_stat(stat_mntpath, , false) != 0) {
+   DBG_WARNING("cannot stat real path component %s - %s\n",
+   stat_mntpath, strerror(errno));
+   goto out;
+   }
+   if (S.st_ex_dev != devno) {
+   *p = '/';
+   break;
+   }
+
+   if (p <= stat_mntpath + 1) {

[SCM] Samba Shared Repository - branch master updated

2016-01-21 Thread Jeremy Allison
The branch, master has been updated
   via  ef269c9 substitute: Fix talloc_sub_basic for %G in the case of a 
local user.
   via  2f2b57a passdb: change ABI version to 0.25.0 due to removed symbol.
   via  8ff3257 s3:passdb: move my_sam_name() from passdb to util_name.c
   via  a929913 s4-torture: let smb2.replay.replay5 test deal with scale 
out shares.
   via  c9218c4 smbd:smb2_close: remove an irritating blank line
   via  718007b docs:smbdotconf: fix tabs/space mixup in logon parameter 
metadata
  from  6ed3985 vfs_shadow_copy2: check crossmountpoints against 
snapdirseverywhere

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


- Log -
commit ef269c9ddc865a450f4e594ec9133e1f304452a7
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jan 21 12:42:14 2016 +0100

substitute: Fix talloc_sub_basic for %G in the case of a local user.

This fixes a regression introduced by the fix for bug 10286.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10286

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jan 22 05:03:25 CET 2016 on sn-devel-144

commit 2f2b57a648624dee346dbc9481a36d38c5d21ec3
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jan 21 12:41:43 2016 +0100

passdb: change ABI version to 0.25.0 due to removed symbol.

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 8ff3257c4c129a941f50e78ede4905bae3712f33
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jan 21 12:40:33 2016 +0100

s3:passdb: move my_sam_name() from passdb to util_name.c

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit a929913cb1dd3fd94676c0b417a663c064961be9
Author: Michael Adam <ob...@samba.org>
Date:   Fri Jan 15 17:34:43 2016 +0100

s4-torture: let smb2.replay.replay5 test deal with scale out shares.

Scale out shares don't hand out batch or exclusive oplocks.
Hence no durable handles either.
The important point here is that the behaviour tested
does largely not rely on the fact that we had a durable
handle but that we were using a durable handle create
context to specify a CreateGUID.

Pair-Programmed-With: Guenther Deschner <g...@samba.org>

Signed-off-by: Michael Adam <ob...@samba.org>
Signed-off-by: Guenther Deschner <g...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit c9218c40e6037e4f38a719aa0b47c3040cdf2080
Author: Michael Adam <ob...@samba.org>
Date:   Tue May 19 12:19:22 2015 +0200

smbd:smb2_close: remove an irritating blank line

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 718007b2236084113163e4c40b33a95d7d247ec3
Author: Michael Adam <ob...@samba.org>
Date:   Thu Jan 21 10:39:35 2016 +0100

docs:smbdotconf: fix tabs/space mixup in logon parameter metadata

Signed-off-by: Michael Adam <ob...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 docs-xml/smbdotconf/logon/logondrive.xml   |  2 +-
 docs-xml/smbdotconf/logon/logonhome.xml|  2 +-
 docs-xml/smbdotconf/logon/logonpath.xml|  2 +-
 docs-xml/smbdotconf/logon/logonscript.xml  |  2 +-
 source3/include/passdb.h   |  1 -
 source3/include/proto.h|  1 +
 source3/lib/substitute.c   |  4 +++-
 source3/lib/util_names.c   | 18 ++
 ...mba-passdb-0.24.2.sigs => samba-passdb-0.25.0.sigs} |  1 -
 source3/passdb/passdb.c| 18 --
 source3/smbd/smb2_close.c  |  1 -
 source3/wscript_build  |  2 +-
 source4/torture/smb2/replay.c  | 16 +---
 13 files changed, 40 insertions(+), 30 deletions(-)
 copy source3/passdb/ABI/{samba-passdb-0.24.2.sigs => samba-passdb-0.25.0.sigs} 
(99%)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/logon/logondrive.xml 
b/docs-xml/smbdotconf/logon/logondrive.xml
index dc12080..9f61598 100644
--- a/docs-xml/smbdotconf/logon/logondrive.xml
+++ b/docs-xml/smbdotconf/logon/logondrive.xml
@@ -1,6 +1,6 @@
 http://www.samba.org/samba/DTD/samba-doc;>
 
diff --git a/docs-xml/smbdotconf/logon/logonhome.xml 
b/docs-xml/smbdotconf/logon/logonhome.xml
index 3e9d150..d211674 100644
--- a/docs-xml/smbdotconf/logon/logonhome.xml
+++ b/docs-

[SCM] Samba Shared Repository - branch master updated

2016-01-15 Thread Jeremy Allison
The branch, master has been updated
   via  ecc7022 s3-util: skip S-1-18 sids in token generaion in 
sid_array_from_info3().
   via  a924209 s3-util: add helper functions to deal with the S-1-18 
domain.
   via  cf163ac security: Add Asserted Identity sids (S-1-18)
  from  d1235c7 ldb: Fix CID 1348110 Uninitialized scalar variable

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


- Log -
commit ecc7022d7c3cd481b0caf6c9c48c72ea3e7ac822
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 14:43:48 2016 +0100

s3-util: skip S-1-18 sids in token generaion in sid_array_from_info3().

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11677

Guenther

Signed-off-by: Günther Deschner <g...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Sat Jan 16 01:24:04 CET 2016 on sn-devel-144

commit a92420911d4786e6fe58091f9641e2b193513f0c
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 14:43:12 2016 +0100

s3-util: add helper functions to deal with the S-1-18 domain.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11677

Guenther

Signed-off-by: Günther Deschner <g...@samba.org>
Reviewed-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit cf163ac359ee8414dd34723bdce79c33e225d3c9
Author: Günther Deschner <g...@samba.org>
Date:   Fri Jan 15 14:46:07 2016 +0100

security: Add Asserted Identity sids (S-1-18)

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11677

definitions taken from [MS-DTYP]: Windows Data Types,
2.4.2.4 Well-Known SID Structures.

Guenther

Signed-off-by: Günther Deschner <g...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 libcli/security/dom_sid.h  |  3 +++
 libcli/security/util_sid.c |  8 ++
 librpc/idl/security.idl|  3 +++
 source3/include/proto.h|  5 
 source3/lib/util_sid.c |  5 
 .../winbindd_async.c => lib/util_specialsids.c}| 30 +-
 source3/wscript_build  |  1 +
 7 files changed, 43 insertions(+), 12 deletions(-)
 copy source3/{winbindd/winbindd_async.c => lib/util_specialsids.c} (62%)


Changeset truncated at 500 lines:

diff --git a/libcli/security/dom_sid.h b/libcli/security/dom_sid.h
index 990a4c4..bdcec94 100644
--- a/libcli/security/dom_sid.h
+++ b/libcli/security/dom_sid.h
@@ -36,6 +36,9 @@ extern const struct dom_sid global_sid_System;
 extern const struct dom_sid global_sid_NULL;
 extern const struct dom_sid global_sid_Authenticated_Users;
 extern const struct dom_sid global_sid_Network;
+extern const struct dom_sid global_sid_Asserted_Identity;
+extern const struct dom_sid global_sid_Asserted_Identity_Service;
+extern const struct dom_sid 
global_sid_Asserted_Identity_Authentication_Authority;
 extern const struct dom_sid global_sid_Creator_Owner;
 extern const struct dom_sid global_sid_Creator_Group;
 extern const struct dom_sid global_sid_Owner_Rights;
diff --git a/libcli/security/util_sid.c b/libcli/security/util_sid.c
index 3399801..ab3018a 100644
--- a/libcli/security/util_sid.c
+++ b/libcli/security/util_sid.c
@@ -55,6 +55,14 @@ const struct dom_sid global_sid_Authenticated_Users =
/* All authenticated rids
 const struct dom_sid global_sid_Restriced =/* Restriced 
Code */
 { 1, 1, {0,0,0,0,0,5}, {12,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
 #endif
+
+const struct dom_sid global_sid_Asserted_Identity =   /* Asserted Identity 
*/
+{ 1, 0, {0,0,0,0,0,18}, {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
+const struct dom_sid global_sid_Asserted_Identity_Service =/* Asserted 
Identity Service */
+{ 1, 1, {0,0,0,0,0,18}, {1,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
+const struct dom_sid global_sid_Asserted_Identity_Authentication_Authority =   
/* Asserted Identity Authentication Authority */
+{ 1, 1, {0,0,0,0,0,18}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
+
 const struct dom_sid global_sid_Network =  /* Network rids 
*/
 { 1, 1, {0,0,0,0,0,5}, {2,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};
 
diff --git a/librpc/idl/security.idl b/librpc/idl/security.idl
index b78307e..f412ffe 100644
--- a/librpc/idl/security.idl
+++ b/librpc/idl/security.idl
@@ -285,6 +285,9 @@ interface security
const string SID_NT_TRUSTED_INSTALLER =

"S-1-5-80-956008885-3418522649-1831038044-1853292631-2271478464";
 
+   c

[SCM] Samba Shared Repository - branch master updated

2016-01-14 Thread Jeremy Allison
The branch, master has been updated
   via  d1235c7 ldb: Fix CID 1348110 Uninitialized scalar variable
  from  cf05ba5 s3-libads: Use the configured LDAP page size.

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


- Log -
commit d1235c79ec8dbd4a79d0d14442098fc427f79ac3
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jan 14 21:10:39 2016 +0100

ldb: Fix CID 1348110 Uninitialized scalar variable

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jan 15 07:12:06 CET 2016 on sn-devel-144

---

Summary of changes:
 lib/ldb/common/ldb_dn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/common/ldb_dn.c b/lib/ldb/common/ldb_dn.c
index 5bf72ac..b7d2de7 100644
--- a/lib/ldb/common/ldb_dn.c
+++ b/lib/ldb/common/ldb_dn.c
@@ -1916,7 +1916,7 @@ int ldb_dn_set_component(struct ldb_dn *dn, int num,
return LDB_ERR_OTHER;
}
 
-   if (v.length > v.length + 1) {
+   if (val.length > val.length + 1) {
return LDB_ERR_OTHER;
}
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-01-13 Thread Jeremy Allison
The branch, master has been updated
   via  0f57acc s4:acl LDB module - fix error message
  from  39bc356 ctdb-ipalloc: Document the steps involved in a takeover run

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


- Log -
commit 0f57acc531792684b57c2e4906551e776dc8ceac
Author: Matthias Dieter Wallnöfer <m...@samba.org>
Date:   Wed Jan 13 12:53:26 2016 -0800

s4:acl LDB module - fix error message

Signed-off-by: Matthias Dieter Wallnöfer <m...@samba.org>
Reviewed-by: Andrew Bartlett <abart...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Thu Jan 14 04:54:26 CET 2016 on sn-devel-144

---

Summary of changes:
 source4/dsdb/samdb/ldb_modules/acl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/acl.c 
b/source4/dsdb/samdb/ldb_modules/acl.c
index 78e6461..62e560f 100644
--- a/source4/dsdb/samdb/ldb_modules/acl.c
+++ b/source4/dsdb/samdb/ldb_modules/acl.c
@@ -867,7 +867,7 @@ static int acl_add(struct ldb_module *module, struct 
ldb_request *req)
 >schemaIDGUID, req);
if (ret != LDB_SUCCESS) {
ldb_asprintf_errstring(ldb_module_get_ctx(module),
-  "acl: unable to find or validate 
structural objectClass on %s\n",
+  "acl: unable to get access to %s\n",
   
ldb_dn_get_linearized(req->op.add.message->dn));
return ret;
}


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2016-01-12 Thread Jeremy Allison
The branch, master has been updated
   via  6f3656c Revert "winbind: Retry after SESSION_EXPIRED error in 
ping-dc"
   via  aa3883e winbindd: Retry on expired session in cm_connect_netlogon
   via  276d604 winbindd: Retry on expired session in cm_connect_sam
   via  3b6b545 winbindd: Retry on expired session in cm_connect_lsa
   via  4c6804e winbindd: Remove double retry from some ADS methods
   via  e4adf55 winbindd: Add retry also for ADS method calls
   via  fb5b0ce winbindd: Reset connection for expired session before 
reconnecting
  from  3ac2d4b ctdb-tests: Fix some incorrect memory allocations

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


- Log -
commit 6f3656c47d8ae6a3ac10591ffd7a60797775b469
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Jan 7 13:27:49 2016 -0700

Revert "winbind: Retry after SESSION_EXPIRED error in ping-dc"

This reverts commit a2670f15dea27c10e3827216adf572f9c3894f85.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

cm_connect_netlogon now handles the retry for an expired session.

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>
    
Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jan 13 03:35:57 CET 2016 on sn-devel-144

commit aa3883eae6e7891efb1e6f9ec74e6073bee43250
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Jan 5 15:10:45 2016 -0700

winbindd: Retry on expired session in cm_connect_netlogon

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 276d604aa5ccc32d18b69c04ae13e2dc7c21f3ee
Author: Christof Schmitt <c...@samba.org>
Date:   Thu Jan 7 15:03:22 2016 -0700

winbindd: Retry on expired session in cm_connect_sam

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

    Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 3b6b5456424be6997b32c23b7c149c8060c3102d
Author: Christof Schmitt <c...@samba.org>
Date:   Wed Jan 6 14:15:30 2016 -0700

winbindd: Retry on expired session in cm_connect_lsa

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670
    
Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4c6804e414087fb61e66133cefbe5590d1d9b283
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Jan 5 14:42:09 2016 -0700

winbindd: Remove double retry from some ADS methods

The retry through the new reconnect_ads layer is enough. This structure
also makes the distinction between retry layer and actual methods call a
bit clearer.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit e4adf55e242aa5f000570bf554fcd15d7e86c126
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Jan 5 14:37:30 2016 -0700

winbindd: Add retry also for ADS method calls

RPC calls can return IO_DEVICE_ERROR on expired SMB2 sessions. Retrying
on a new connection avoids surfacing this error to winbindd clients.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit fb5b0cec3c0c2e0cf9cb04f8b52ee910ac245aeb
Author: Christof Schmitt <c...@samba.org>
Date:   Tue Jan 5 13:39:25 2016 -0700

winbindd: Reset connection for expired session before reconnecting

A RPC call on a expired SMB2 session returns IO_DEVICE_ERROR. In this
case, reset the connection before issuing the same call
again.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670

Signed-off-by: Christof Schmitt <c...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 source3/winbindd/winbindd_ads.c|  26 +--
 source3/winbindd/winbindd_cache.c  |   4 +-
 source3/winbindd/winbindd_cm.c | 104 +
 source3/winbindd/winbindd_dual_srv.c   |   8 -
 source3/winbindd/winbindd_ndr.c|   3 +
 source3/winbindd/winbindd_proto.h  |   4 +
 source3/winbindd/winbindd_reconnect.c  |  38 ++--
 ...nbindd_reconnect.c => winbindd_reconnect_ads.c} | 249 +
 source3/wscript_build  |   1 +
 9 files changed, 257 insertions(+), 180 deletions(-)
 copy source3/winbindd/{winbindd_reconnect.c => winbindd_rec

[SCM] Samba Shared Repository - branch master updated

2016-01-07 Thread Jeremy Allison
The branch, master has been updated
   via  657610a smbd: Fix 240393 Uninitialized pointer read
   via  fc4c2dc bind_dlz: Fix CID 1347318 Unchecked return value
   via  0cb8b9d ctdb: Fix CID 1347319 Unchecked return value
   via  4a3ad42 samdb: Fix CID 1347320 Dereference null return value
  from  78e9f1e build: Add space before -D option

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


- Log -
commit 657610a0e423aa0cd17f9137845a335b02217884
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jan 7 21:33:18 2016 +0100

smbd: Fix 240393 Uninitialized pointer read

If we run into the "This is a stream on the root of the share" case,
in old line 409 (new line 417) we "goto done;". If then in old line 1027
(new line 1035) "build_stream_path" fails, "start" is uninitialized.

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Fri Jan  8 05:44:15 CET 2016 on sn-devel-144

commit fc4c2dcd526851fa938f6d8edb15b58fbb644a45
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jan 7 21:17:43 2016 +0100

bind_dlz: Fix CID 1347318 Unchecked return value

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 0cb8b9d113b322f784100365669d2be8b7fa635a
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jan 7 21:14:05 2016 +0100

ctdb: Fix CID 1347319 Unchecked return value

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

commit 4a3ad425b92122f5b5e61b140eb52d3fe06b724e
Author: Volker Lendecke <v...@samba.org>
Date:   Thu Jan 7 21:10:24 2016 +0100

samdb: Fix CID 1347320 Dereference null return value

Signed-off-by: Volker Lendecke <v...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

---

Summary of changes:
 ctdb/common/system_linux.c  |  8 +++-
 source3/smbd/filename.c | 10 +-
 source4/dns_server/dlz_bind9.c  | 16 +---
 source4/dsdb/samdb/ldb_modules/samldb.c |  6 ++
 4 files changed, 35 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index 6447f56..55c22c5 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -247,7 +247,13 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const 
char *iface)
ip6->ip6_hlim = 255;
ip6->ip6_src  = addr->ip6.sin6_addr;
/* all-nodes multicast */
-   inet_pton(AF_INET6, "ff02::1", >ip6_dst);
+
+   ret = inet_pton(AF_INET6, "ff02::1", >ip6_dst);
+   if (ret != 1) {
+   close(s);
+   DEBUG(DEBUG_CRIT,(__location__ " failed inet_pton\n"));
+   return -1;
+   }
 
nd_na = (struct nd_neighbor_advert *)(ip6+1);
nd_na->nd_na_type = ND_NEIGHBOR_ADVERT;
diff --git a/source3/smbd/filename.c b/source3/smbd/filename.c
index c2ed1fc..f2c9184 100644
--- a/source3/smbd/filename.c
+++ b/source3/smbd/filename.c
@@ -235,7 +235,15 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
  uint32_t ucf_flags)
 {
struct smb_filename *smb_fname = NULL;
-   char *start, *end;
+
+   /*
+* This looks strange. But we need "start" initialized to "" here but
+* it can't be a const char *, so 'char *start = "";' does not work.
+*/
+   char cnull = '\0';
+   char *start = 
+
+   char *end;
char *dirpath = NULL;
char *stream = NULL;
bool component_was_mangled = False;
diff --git a/source4/dns_server/dlz_bind9.c b/source4/dns_server/dlz_bind9.c
index 7a76fe5..4c21a5e 100644
--- a/source4/dns_server/dlz_bind9.c
+++ b/source4/dns_server/dlz_bind9.c
@@ -1438,10 +1438,20 @@ static bool b9_record_match(struct dlz_bind9_data 
*state,
switch (rec1->wType) {
case DNS_TYPE_A:
return strcmp(rec1->data.ipv4, rec2->data.ipv4) == 0;
-   case DNS_TYPE_:
-   inet_pton(AF_INET6, rec1->data.ipv6, _in_addr6);
-   inet_pton(AF_INET6, rec2->data.ipv6, _in_addr6);
+   case DNS_TYPE_: {
+   int ret;
+
+   ret = inet_pton(AF_INET6, rec1->data.ipv6, _in_addr6);
+   if (ret != 1) {
+   return false;
+   }
+   ret = inet_pton(AF_INET6, rec2->data.ipv6, _in_addr6);
+   

[SCM] Samba Shared Repository - branch master updated

2016-01-06 Thread Jeremy Allison
The branch, master has been updated
   via  eda6aaf s3:smbd/oplock obey kernel oplock setting when releasing 
oplocks
  from  3e1b26b selftest: more dfree command and smbclient disk usage tests

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


- Log -
commit eda6aaf1533b69d093ba67ff5e22fcda0073dd3f
Author: Christian Ambach <a...@samba.org>
Date:   Mon Jan 4 23:12:25 2016 +0100

s3:smbd/oplock obey kernel oplock setting when releasing oplocks

otherwise smbd asks the kernel to release an oplock that was never requested

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11400

Signed-off-by: Christian Ambach <a...@samba.org>
Reviewed-by: Jeremy Allison <j...@samba.org>

Autobuild-User(master): Jeremy Allison <j...@samba.org>
Autobuild-Date(master): Wed Jan  6 08:58:56 CET 2016 on sn-devel-144

---

Summary of changes:
 source3/smbd/oplock.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c
index 4d84347..4f108d9 100644
--- a/source3/smbd/oplock.c
+++ b/source3/smbd/oplock.c
@@ -96,9 +96,10 @@ static void release_file_oplock(files_struct *fsp)
 {
struct smbd_server_connection *sconn = fsp->conn->sconn;
struct kernel_oplocks *koplocks = sconn->oplocks.kernel_ops;
+   bool use_kernel = lp_kernel_oplocks(SNUM(fsp->conn)) && koplocks;
 
if ((fsp->oplock_type != NO_OPLOCK) &&
-   koplocks) {
+   use_kernel) {
koplocks->ops->release_oplock(koplocks, fsp, NO_OPLOCK);
}
 


-- 
Samba Shared Repository



<    6   7   8   9   10   11   12   13   14   15   >