From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 272493857C71; Thu, 4 Nov 2021 20:55:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 272493857C71 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: fix permission problem when writing DAC info on Samba shares X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/master X-Git-Oldrev: e37bfc8ba1b619fc666715cae9aaf5cbe35b14d0 X-Git-Newrev: 55dd0676ce50391ed0ee29c630925dd5a0c7123c Message-Id: <20211104205513.272493857C71@sourceware.org> Date: Thu, 4 Nov 2021 20:55:13 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Nov 2021 20:55:13 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=55dd0676ce50391ed0ee29c630925dd5a0c7123c commit 55dd0676ce50391ed0ee29c630925dd5a0c7123c Author: Corinna Vinschen 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 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.