public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_3-branch] Cygwin: fix permission problem when writing DAC info on Samba shares
@ 2021-11-04 20:55 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-11-04 20:55 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=0390cc85727b0165b5cdfcff7578cac94ae3371d

commit 0390cc85727b0165b5cdfcff7578cac94ae3371d
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Thu Nov 4 21:48:45 2021 +0100

    Cygwin: fix permission problem when writing DAC info on Samba shares
    
    Cygwin always requests FILE_WRITE_ATTRIBUTES permissions when trying to
    change DAC information.  This can lead to permission problems when
    trying to chmod/chown files on Samba shares.  Drop requesting
    FILE_WRITE_ATTRIBUTES on Samba shares and go with WRITE_DAC/WRITE_OWNER
    only.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler.cc   | 6 ++++--
 winsup/cygwin/release/3.3.2 | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 36862c712..2a07e6cf9 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -561,10 +561,12 @@ fhandler_base::open (int flags, mode_t mode)
       access = READ_CONTROL | FILE_READ_ATTRIBUTES;
       break;
     case query_write_control:
-      access = READ_CONTROL | WRITE_OWNER | WRITE_DAC | FILE_WRITE_ATTRIBUTES;
+      access = READ_CONTROL | WRITE_OWNER | WRITE_DAC
+	       | (pc.fs_is_samba () ? 0 : FILE_WRITE_ATTRIBUTES);
       break;
     case query_write_dac:
-      access = READ_CONTROL | WRITE_DAC | FILE_WRITE_ATTRIBUTES;
+      access = READ_CONTROL | WRITE_DAC
+	       | (pc.fs_is_samba () ? 0 : FILE_WRITE_ATTRIBUTES);
       break;
     case query_write_attributes:
       access = READ_CONTROL | FILE_WRITE_ATTRIBUTES;
diff --git a/winsup/cygwin/release/3.3.2 b/winsup/cygwin/release/3.3.2
index 548c6a690..263c3efe6 100644
--- a/winsup/cygwin/release/3.3.2
+++ b/winsup/cygwin/release/3.3.2
@@ -6,3 +6,5 @@ Bug Fixes
 
 - Fix a float rounding issue in newlib.
   Addresses: https://sourceware.org/pipermail/newlib/2021/018626.html
+
+- Fix a permission problem when writing ACLs on Samba.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-04 20:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 20:55 [newlib-cygwin/cygwin-3_3-branch] Cygwin: fix permission problem when writing DAC info on Samba shares Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).