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

2017-07-13 Thread Stefan Metzmacher
The branch, v4-7-test has been updated
   via  7cf9a52 unittests: Add missing stdint.h include
   via  a235bb4 WHATSNEW: CTDB changes for 4.7
   via  dc35068 Add code to run the tests for 'samba-tool user edit'
   via  a1874cd Add test for 'samba-tool user edit'
   via  ec0545f Easily edit a users object in AD, as if using ldbedit.
   via  21f9477 waf: Only build unit tests with selftest enabled
   via  fdd1dc7 s3:smbd: consistently use talloc_tos() memory for 
rpc_pipe_open_interface()
   via  c6d2d56 selftest: add a test for accessing previous version of 
directories with snapdirseverywhere
   via  b1916bf s3/smbd: let non_widelink_open() chdir() to directories 
directly
   via  08f8402 unittests: Do not install the test_dummy rpc module
   via  e1b217c waf: Do not install _ldb_text.py if we have system libldb
  from  3d9dddb VERSION: Bump version up to 4.6.0rc3...

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-7-test


- Log -
commit 7cf9a52487a9f8fc4778da2f7313222ada873846
Author: Andreas Schneider 
Date:   Wed Jul 5 08:59:23 2017 +0200

unittests: Add missing stdint.h include

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 
(cherry picked from commit 5d18c5e5ec52a185991f9de6883171f85f7d4fa7)

Autobuild-User(v4-7-test): Stefan Metzmacher 
Autobuild-Date(v4-7-test): Thu Jul 13 12:08:53 CEST 2017 on sn-devel-144

commit a235bb4bcb80a01c6b6566320d624ce975cd8105
Author: Martin Schwenke 
Date:   Wed Jul 5 16:31:48 2017 +1000

WHATSNEW: CTDB changes for 4.7

Signed-off-by: Martin Schwenke 
Reviewed-by: Stefan Metzmacher 

commit dc3506874da888c0ff53f2df5cd2ffc4d7fac1fc
Author: Rowland Penny 
Date:   Tue Jul 4 15:07:53 2017 +0100

Add code to run the tests for 'samba-tool user edit'

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

Signed-off-by: Rowland Penny 
Reviewed-by: Alexander Bokovoy 

Autobuild-User(master): Alexander Bokovoy 
Autobuild-Date(master): Wed Jul  5 17:53:24 CEST 2017 on sn-devel-144

(cherry picked from commit e3707c1b19a27d431722e1b355dc39a39f7f8f1c)

commit a1874cd86a2f2c12ce2b40c7c3a115f0e50a238e
Author: Rowland Penny 
Date:   Tue Jul 4 15:04:36 2017 +0100

Add test for 'samba-tool user edit'

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

Signed-off-by: Rowland Penny 
Reviewed-by: Alexander Bokovoy 
(cherry picked from commit 3c03ac750f4dea00da21f21302beeaf5b12a35b8)

commit ec0545f5efeb9ff3e87c03a45e6484b8ba4d92c6
Author: Rowland Penny 
Date:   Tue Jul 4 15:00:58 2017 +0100

Easily edit a users object in AD, as if using ldbedit.

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

Signed-off-by: Rowland Penny 
Reviewed-by: Alexander Bokovoy 
(cherry picked from commit 2ab239be0d69389b451816ec72d548d1156e495b)

commit 21f94775f0d33c1fee4702af43c684261f5c1c16
Author: Andreas Schneider 
Date:   Wed Jul 5 10:08:49 2017 +0200

waf: Only build unit tests with selftest enabled

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 
(cherry picked from commit 25ef27b2e6d80f0afa271e73a195caa2105be648)

commit fdd1dc7b71404c5a84352d8611edd6ab18d773c1
Author: Stefan Metzmacher 
Date:   Mon Jul 10 11:29:58 2017 +0200

s3:smbd: consistently use talloc_tos() memory for rpc_pipe_open_interface()

The result is only used temporary and should not be leaked on a long term
memory context as 'conn'.

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

Signed-off-by: Stefan Metzmacher 
Reviewed-by: Jeremy Allison 
(cherry picked from commit 77cbced5d2f8bf65c8d02f5edfaba8cbad519d08)

commit c6d2d56e500d8d66e4b8e81be37814a0b5d7704f
Author: Ralph Boehme 
Date:   Fri Jul 7 13:12:19 2017 +0200

selftest: add a test for accessing previous version of directories with 
snapdirseverywhere

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Sat Jul  8 00:33:51 CEST 2017 on sn-devel-144

(cherry picked from commit cc9ba98c08665e0ed6927fd81fa43a7bb7842e45)

commit b1916bf355cea38056e999c093d7ddb05b52d7e6
Author: Ralph Boehme 
Date:   Fri Jul 7 12:57:57 2017 +0200

s3/smbd: let non_widelink_open() chdir() to directories directly

If the caller passes O_DIRECTORY we just try to chdir() to smb_fname
directly, not to the parent directory.

The security check in check_reduced_name() will continue to work, but
this fixes the case of an open() for a previous version of a
subdirectory that contains snapshopt.

Eg:

[shar

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

2017-07-13 Thread Stefan Metzmacher
The branch, v4-5-test has been updated
   via  6512059 selftest:Samba3: call "net primarytrust dumpinfo" 
setup_nt4_member() after the join
   via  6c728cc s3:secrets: remove unused 
secrets_store_[prev_]machine_password()
   via  ad1e456 s3:libads: make use of secrets_*_password_change() in 
ads_change_trust_account_password()
   via  7d86014 net: make use of secrets_*_password_change() for "net 
changesecretpw"
   via  ab5109f s3:trusts_util: make use the workstation password change 
more robust
   via  75a05ad s3:libnet: make use of secrets_store_JoinCtx()
   via  d9a2394 net: add "net primarytrust dumpinfo" command that dumps the 
details of the workstation trust
   via  f3da295 s3:secrets: add infrastructure to use secrets_domain_infoB 
to store credentials
   via  97b72e3 secrets.idl: add secrets_domain_info that will be used in 
secrets.tdb for machine account trusts
   via  4d66652 netlogon.idl: use lsa_TrustType and lsa_TrustAttributes in 
netr_trust_extension
   via  19addd1 netlogon.idl: make netr_TrustFlags [public]
   via  e635a4f lsa.idl: make lsa_DnsDomainInfo [public]
   via  1e5489d s3:trusts_util: also pass the previous_nt_hash to 
netlogon_creds_cli_auth()
   via  399945b libcli/auth: pass the cleartext blob to 
netlogon_creds_cli_ServerPasswordSet*()
   via  0c7de3c libcli/auth: add const to set_pw_in_buffer()
   via  09461fe libcli/auth: pass an array of nt_hashes to 
netlogon_creds_cli_auth*()
   via  c1d6f18 s3:trusts_util: pass dcname to trust_pw_change()
   via  9afd00e s3:secrets: use secrets_delete for all keys in 
secrets_delete_machine_password_ex()
   via  3c3765f s3:secrets: let secrets_delete_machine_password_ex() also 
remove the des_salt key
   via  64b3919 s3:secrets: let secrets_delete_machine_password_ex() remove 
SID and GUID too
   via  04384a4 s3:secrets: rewrite secrets_delete_machine_password_ex() 
using helper variables
   via  a920733 s3:secrets: replace secrets_delete_prev_machine_password() 
by secrets_delete()
   via  fdbf0de s3:secrets: let secrets_store_machine_pw_sync() delete the 
des_salt_key when there's no value
   via  96319f6 s3:secrets: make use of secrets_delete() in 
secrets_store_machine_pw_sync()
   via  1bbefc1 s3:secrets: re-add secrets_delete() helper to simplify 
deleting optional keys
   via  f5dc61c s3:secrets: rename secrets_delete() to 
secrets_delete_entry()
   via  f30adda s3:secrets: make use of des_salt_key() in 
secrets_store_machine_pw_sync()
   via  0a36325 s3:secrets: add some const to secrets_store_domain_guid()
   via  ec6b939 s3:secrets: split out a domain_guid_keystr() function
   via  de0f730 s3:secrets: rework des_salt_key() to take the realm as 
argument
   via  fd161f1 s3:secrets: move kerberos_secrets_*salt related functions 
to machine_account_secrets.c
   via  701361c s3:libads: remove unused 
kerberos_fetch_salt_princ_for_host_princ()
   via  24478a5 s3:libads: make use of kerberos_secrets_fetch_salt_princ() 
in ads_keytab_add_entry()
   via  aa2f79b s3:libnet: make use of kerberos_secrets_fetch_salt_princ()
   via  0aa6bfd s3:gse_krb5: simplify fill_keytab_from_password() by using 
kerberos_fetch_salt_princ()
   via  2ef7d5a s3:libads: provide a simpler kerberos_fetch_salt_princ() 
function
   via  0f4d181 s3:libads: remove 
kerberos_secrets_fetch_salting_principal() fallback
   via  87b27a5 s3:libnet_join: move kerberos_secrets_store_des_salt() to 
libnet_join_joindomain_store_secrets()
   via  00a2ce6 s3:libnet_join: move libnet_join_joindomain_store_secrets() 
to libnet_join_post_processing()
   via  a210289 s3:libnet_join: call do_JoinConfig() after we did remote 
changes on the server
   via  7110ea3 s3:libnet_join: split libnet_join_post_processing_ads() 
into modify/sync
   via  4765cb4 s3:libnet_join: move kerberos_secrets_store_des_salt() out 
of libnet_join_derive_salting_principal()
   via  9d818ce s3:libnet_join: remember r->out.krb5_salt in 
libnet_join_derive_salting_principal()
   via  18cd978 s3:libnet_join.idl: add krb5_salt to libnet_JoinCtx
   via  f18c0ca s3:libnet_join: remember the domain_guid for AD domains
   via  d68b34b s3:libnet_join.idl: return the domain_guid in libnet_JoinCtx
   via  35b6d50 s3:libnet_join: calculate r->out.account_name in 
libnet_join_pre_processing()
   via  77980ad s3:libnet_join: remove dead code from 
libnet_join_connect_ads()
   via  cef8c67 krb5_wrap: add smb_krb5_salt_principal2data()
   via  5b96252 krb5_wrap: add smb_krb5_salt_principal()
   via  88abba9 s3:libads: remove unused 
kerberos_secrets_store_salting_principal()
   via  208c771 s3:librpc: let NDR_SECRETS depend on NDR_SECURITY
   via  899c0d5 idl_types.h: add NDR_SECRET shortcut
   via  9bbacf5 librpc/ndr: add LIBNDR_FLAG_IS_SECRET handling
   via  7b3bfd5 librpc/ndr: align the definiti

[SCM] Samba Shared Repository - branch master updated

2017-07-13 Thread Amitay Isaacs
The branch, master has been updated
   via  4e68d37 ctdb-docs: Update documentation of ipreallocated event
   via  3e85cbf ctdb-common: Set close-on-exec when creating PID file
  from  bebf90f libwbclient: Fix CID 1414781 Dereference null return value

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


- Log -
commit 4e68d377a7227042b3cc09274ecf8dd820c3d386
Author: Martin Schwenke 
Date:   Wed Jul 12 12:22:10 2017 +1000

ctdb-docs: Update documentation of ipreallocated event

This was out of date due to the removal of service_check_reconfigure()
and similar.

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

Autobuild-User(master): Amitay Isaacs 
Autobuild-Date(master): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144

commit 3e85cbfd7541d8f30ce1f3244ebcc44332b394fe
Author: Martin Schwenke 
Date:   Wed Jul 12 13:41:17 2017 +1000

ctdb-common: Set close-on-exec when creating PID file

Otherwise, for example, the file descriptor for the main PID file will
leak all the way down to event scripts.

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

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

---

Summary of changes:
 ctdb/common/pidfile.c   |  8 
 ctdb/config/events.d/README | 35 +--
 2 files changed, 25 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/common/pidfile.c b/ctdb/common/pidfile.c
index b3f29e3..51c0c25 100644
--- a/ctdb/common/pidfile.c
+++ b/ctdb/common/pidfile.c
@@ -22,6 +22,8 @@
 
 #include 
 
+#include "lib/util/blocking.h"
+
 #include "common/pidfile.h"
 
 struct pidfile_context {
@@ -61,6 +63,12 @@ int pidfile_create(TALLOC_CTX *mem_ctx, const char *pidfile,
goto fail;
}
 
+   if (! set_close_on_exec(fd)) {
+   close(fd);
+   ret = EIO;
+   goto fail;
+   }
+
pid_ctx->fd = fd;
 
lck = (struct flock) {
diff --git a/ctdb/config/events.d/README b/ctdb/config/events.d/README
index 11da702..36f94bb 100644
--- a/ctdb/config/events.d/README
+++ b/ctdb/config/events.d/README
@@ -159,33 +159,32 @@ updateip

 
 ipreallocated
 
-   This event is triggered after "releaseip", "takeip" and
-   "updateip" events during public IP address (re)assignment.
+   This event is triggered on all nodes as the last step of
+   public IP address (re)assignment.  It is unconditionally
+   triggered after any "releaseip", "takeip" and "updateip"
+   events, even though these events may not run on some nodes if
+   there are no relevant changes.  That is, the "ipreallocated"
+   event is triggered unconditionally, even on nodes where public
+   IP addresses assignements have not changed.
 
This event is used to reconfigure services.
 
-This event runs even if public IP addresses on a node have not
-   been changed.  This allows reconfiguration to depend on the
-   states of other nodes rather that just IP addresses.
+   Since "ipreallocated" is always run, this allows
+   reconfiguration to depend on the states of other nodes rather
+   that just IP addresses.
 
Example: 11.natgw recalculates the NAT gateway master and
updates the relevant network configuration on each node if the
NAT gateway master has changed.
 
 Additional notes for "takeip", "releaseip", "updateip",
-ipreallocated":
+"ipreallocated":
 
 * Failure of any of these events causes IP allocation to be retried.
 
-* The "ipreallocated" event is run on all nodes.  It is even run if no
-  "takeip", "releaseip" or "updateip" events were triggered.
-
-* An event script can use ctdb_service_set_reconfigure() in "takeip"
-  or "releaseip" events to flag that its service needs to be
-  reconfigured.  The event script can then define a
-  service_reconfigure() function, which will be implicitly run before
-  the "ipreallocated" event.  This is a useful way of performing
-  reconfiguration that is conditional upon public IP address changes.
-
-  This means an explicit "ipreallocated" event handler is usually not
-  necessary.
+* An event script can use ctdb_service_set_reconfigure() in "takeip",
+  "releaseip" or "updateip" events to flag that its service needs to
+  be reconfigured.  The "ipreallocated" event can then use
+  ctdb_service_needs_reconfigure() to test if there were public IPs
+  changes to determine what type of reconfiguration (if any) is
+  needed.


-- 
Samba Shared Repository



autobuild[sn-devel-144]: intermittent test failure detected

2017-07-13 Thread autobuild
The autobuild test system (on sn-devel-144) has detected an intermittent 
failing test in 
the current master tree.

The autobuild log of the failure is available here:

   http://git.samba.org/autobuild.flakey.sn-devel-144/2017-07-13-2139/flakey.log

The samba build logs are available here:

   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-07-13-2139/samba.stderr
   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-07-13-2139/samba.stdout
  
The top commit at the time of the failure was:

commit 4e68d377a7227042b3cc09274ecf8dd820c3d386
Author: Martin Schwenke 
Date:   Wed Jul 12 12:22:10 2017 +1000

ctdb-docs: Update documentation of ipreallocated event

This was out of date due to the removal of service_check_reconfigure()
and similar.

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

Autobuild-User(master): Amitay Isaacs 
Autobuild-Date(master): Thu Jul 13 17:57:11 CEST 2017 on sn-devel-144



[SCM] Samba Shared Repository - branch master updated

2017-07-13 Thread Günther Deschner
The branch, master has been updated
   via  df0db9d vfs_fruit: don't use MS NFS ACEs with Windows clients
  from  4e68d37 ctdb-docs: Update documentation of ipreallocated event

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


- Log -
commit df0db9d8f893f9245c6289200303b94a6e2d48d0
Author: Ralph Boehme 
Date:   Wed Jul 12 09:33:59 2017 +0200

vfs_fruit: don't use MS NFS ACEs with Windows clients

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Guenther Deschner 

Autobuild-User(master): Günther Deschner 
Autobuild-Date(master): Thu Jul 13 22:21:08 CEST 2017 on sn-devel-144

---

Summary of changes:
 source3/modules/vfs_fruit.c | 6 ++
 1 file changed, 6 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index 3482d4e..7c481cd 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -2606,6 +2606,9 @@ static NTSTATUS check_ms_nfs(vfs_handle_struct *handle,
struct fruit_config_data,
return NT_STATUS_UNSUCCESSFUL);
 
+   if (!global_fruit_config.nego_aapl) {
+   return NT_STATUS_OK;
+   }
if (psd->dacl == NULL || !config->unix_info_enabled) {
return NT_STATUS_OK;
}
@@ -5280,6 +5283,9 @@ static NTSTATUS fruit_fget_nt_acl(vfs_handle_struct 
*handle,
/*
 * Add MS NFS style ACEs with uid, gid and mode
 */
+   if (!global_fruit_config.nego_aapl) {
+   return NT_STATUS_OK;
+   }
if (!config->unix_info_enabled) {
return NT_STATUS_OK;
}


-- 
Samba Shared Repository



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

2017-07-13 Thread Stefan Metzmacher
The branch, v4-6-test has been updated
   via  9251372 selftest:Samba3: call "net primarytrust dumpinfo" 
setup_nt4_member() after the join
   via  dd573c0 s3:secrets: remove unused 
secrets_store_[prev_]machine_password()
   via  d71aa30 s3:libads: make use of secrets_*_password_change() in 
ads_change_trust_account_password()
   via  15a7a36 net: make use of secrets_*_password_change() for "net 
changesecretpw"
   via  13a2325 s3:trusts_util: make use the workstation password change 
more robust
   via  de1faa7 s3:libnet: make use of secrets_store_JoinCtx()
   via  56403c7 net: add "net primarytrust dumpinfo" command that dumps the 
details of the workstation trust
   via  835cc12 s3:secrets: add infrastructure to use secrets_domain_infoB 
to store credentials
   via  cc67ccb secrets.idl: add secrets_domain_info that will be used in 
secrets.tdb for machine account trusts
   via  d80ef0b netlogon.idl: use lsa_TrustType and lsa_TrustAttributes in 
netr_trust_extension
   via  59e23da netlogon.idl: make netr_TrustFlags [public]
   via  b7e7ac3 lsa.idl: make lsa_DnsDomainInfo [public]
   via  fc98574 s3:trusts_util: also pass the previous_nt_hash to 
netlogon_creds_cli_auth()
   via  f7c05a3 libcli/auth: pass the cleartext blob to 
netlogon_creds_cli_ServerPasswordSet*()
   via  5d56612 libcli/auth: add const to set_pw_in_buffer()
   via  29fa179 libcli/auth: pass an array of nt_hashes to 
netlogon_creds_cli_auth*()
   via  d41f361 s3:trusts_util: pass dcname to trust_pw_change()
   via  324af75 s3:secrets: use secrets_delete for all keys in 
secrets_delete_machine_password_ex()
   via  7481722 s3:secrets: let secrets_delete_machine_password_ex() also 
remove the des_salt key
   via  36ae6bc s3:secrets: let secrets_delete_machine_password_ex() remove 
SID and GUID too
   via  fc8506d s3:secrets: rewrite secrets_delete_machine_password_ex() 
using helper variables
   via  bce615d s3:secrets: replace secrets_delete_prev_machine_password() 
by secrets_delete()
   via  c54cf09 s3:secrets: let secrets_store_machine_pw_sync() delete the 
des_salt_key when there's no value
   via  dd0f49a s3:secrets: make use of secrets_delete() in 
secrets_store_machine_pw_sync()
   via  4e649f7 s3:secrets: re-add secrets_delete() helper to simplify 
deleting optional keys
   via  45ed7f3 s3:secrets: rename secrets_delete() to 
secrets_delete_entry()
   via  e67bc70 s3:secrets: make use of des_salt_key() in 
secrets_store_machine_pw_sync()
   via  f8dc7f3 s3:secrets: add some const to secrets_store_domain_guid()
   via  f297455 s3:secrets: split out a domain_guid_keystr() function
   via  3341df2 s3:secrets: rework des_salt_key() to take the realm as 
argument
   via  cfba2c4 s3:secrets: move kerberos_secrets_*salt related functions 
to machine_account_secrets.c
   via  f68f8f6 s3:libads: remove unused 
kerberos_fetch_salt_princ_for_host_princ()
   via  0ce8cd8 s3:libads: make use of kerberos_secrets_fetch_salt_princ() 
in ads_keytab_add_entry()
   via  bf90563 s3:libnet: make use of kerberos_secrets_fetch_salt_princ()
   via  14add2c s3:gse_krb5: simplify fill_keytab_from_password() by using 
kerberos_fetch_salt_princ()
   via  6e1f7e2 s3:libads: provide a simpler kerberos_fetch_salt_princ() 
function
   via  bfccba4 s3:libads: remove 
kerberos_secrets_fetch_salting_principal() fallback
   via  beb5f2b s3:libnet_join: move kerberos_secrets_store_des_salt() to 
libnet_join_joindomain_store_secrets()
   via  4e5c9b5 s3:libnet_join: move libnet_join_joindomain_store_secrets() 
to libnet_join_post_processing()
   via  cb36b61 s3:libnet_join: call do_JoinConfig() after we did remote 
changes on the server
   via  1b648aa s3:libnet_join: split libnet_join_post_processing_ads() 
into modify/sync
   via  b098b48 s3:libnet_join: move kerberos_secrets_store_des_salt() out 
of libnet_join_derive_salting_principal()
   via  e709972 s3:libnet_join: remember r->out.krb5_salt in 
libnet_join_derive_salting_principal()
   via  15cefb9 s3:libnet_join.idl: add krb5_salt to libnet_JoinCtx
   via  d353c40 s3:libnet_join: remember the domain_guid for AD domains
   via  0c9f0d5 s3:libnet_join.idl: return the domain_guid in libnet_JoinCtx
   via  43cce73 s3:libnet_join: calculate r->out.account_name in 
libnet_join_pre_processing()
   via  b76556f s3:libnet_join: remove dead code from 
libnet_join_connect_ads()
   via  691d69f krb5_wrap: add smb_krb5_salt_principal2data()
   via  ea40c72 krb5_wrap: add smb_krb5_salt_principal()
   via  cf5d62e s3:libads: remove unused 
kerberos_secrets_store_salting_principal()
   via  5687cb0 s3:librpc: let NDR_SECRETS depend on NDR_SECURITY
   via  6297a35 idl_types.h: add NDR_SECRET shortcut
   via  48a9a30 librpc/ndr: add LIBNDR_FLAG_IS_SECRET handling
   via  e73f37d librpc/ndr: align the definiti

[SCM] Samba Shared Repository - branch master updated

2017-07-13 Thread Jeremy Allison
The branch, master has been updated
   via  a4c3ee6 s3:smbclient: Allow last dos attribute to be cleared
  from  df0db9d vfs_fruit: don't use MS NFS ACEs with Windows clients

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


- Log -
commit a4c3ee6767d768365a47bfda32a26cb7994b3787
Author: Steve French 
Date:   Thu Jul 13 13:57:53 2017 -0500

s3:smbclient: Allow last dos attribute to be cleared

With the upgrade to SMB3.1.1 from cifs for smbclient,
setmode no longer works when removing attributes,
if the resultant attribute is 0 it is skipped
(unlike for the old cifs setpathinfo).

When clearing the final attribute, pass in ATTRIBUTE_NORMAL
instead of zero.

This also removes a redundant cli_setatr call
when clearing attributes (cli_setatr was being called
twice).

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

Signed-off-by: Steve French 
Reviewed-by: Anne Marie Merritt 
Reviewed-by: Richard Sharpe 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Fri Jul 14 02:43:47 CEST 2017 on sn-devel-144

---

Summary of changes:
 source3/client/client.c | 24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/client/client.c b/source3/client/client.c
index d8c96e6..aa8d949 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -4961,11 +4961,21 @@ int set_remote_attr(const char *filename, uint16_t 
new_attr, int mode)
}
 
if (mode == ATTR_SET) {
+   if (new_attr == old_attr) {
+   d_printf("attributes unchanged, cli_setatr skipped\n");
+   return 0;
+   }
new_attr |= old_attr;
} else {
new_attr = old_attr & ~new_attr;
}
-
+   /*
+* if we are clearing attributes - can't pass 0 in
+* since that means "skip this field. See MS-FSCC section 2.6
+*/
+   if (new_attr == 0) {
+   new_attr = FILE_ATTRIBUTE_NORMAL;
+   }
status = cli_setatr(cli, filename, new_attr, 0);
if (!NT_STATUS_IS_OK(status)) {
d_printf("cli_setatr failed: %s\n", nt_errstr(status));
@@ -4990,6 +5000,8 @@ int cmd_setmode(void)
int mode = ATTR_SET;
int err = 0;
bool ok;
+   bool set = false;
+   bool unset = false;
TALLOC_CTX *ctx = talloc_new(NULL);
if (ctx == NULL) {
return 1;
@@ -5017,9 +5029,11 @@ int cmd_setmode(void)
while (*s) {
switch (*s++) {
case '+':
+   set = true;
mode = ATTR_SET;
break;
case '-':
+   unset = true;
mode = ATTR_UNSET;
break;
case 'r':
@@ -5051,8 +5065,12 @@ int cmd_setmode(void)
DEBUG(2, ("perm set %d %d\n", attr[ATTR_SET], attr[ATTR_UNSET]));
 
/* ignore return value: server might not store DOS attributes */
-   set_remote_attr(fname, attr[ATTR_SET], ATTR_SET);
-   set_remote_attr(fname, attr[ATTR_UNSET], ATTR_UNSET);
+   if (set) {
+   set_remote_attr(fname, attr[ATTR_SET], ATTR_SET);
+   }
+   if (unset) {
+   set_remote_attr(fname, attr[ATTR_UNSET], ATTR_UNSET);
+   }
 out:
talloc_free(ctx);
return err;


-- 
Samba Shared Repository