public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Marco Atzeri <marco.atzeri@gmail.com>
To: binutils@sourceware.org
Subject: Re: [PATCH] binutils: Attempt to retain permissions on copying file
Date: Tue, 23 Feb 2021 19:49:25 +0100	[thread overview]
Message-ID: <5730a7d8-cd6e-46ab-dd6c-6cf2edf49fc4@gmail.com> (raw)
In-Reply-To: <20210223065259.878257-1-siddhesh@gotplt.org>



On 23.02.2021 07:52, Siddhesh Poyarekar wrote:
> Writing into an existing file clears its S_ISUID and S_ISGID bits.
> Attempt to restore those permission bits but don't fail if it doesn't
> work.
> 
> Also, since the output file always exists (all callers create an empty
> file before calling smart_rename), open the file without any
> permission hints or O_CREAT.
> 
> binutils/
> 
> 	* rename.c (simple_copy): Don't use O_CREAT.
> 	(simple_copy)[!defined (_WIN32) || defined (__CYGWIN32__)]:
> 	Attempt to retain permission bits.


pay attention that __CYGWIN32__ is deprecated and
instead should be used __CYGWIN__

it exists only for obsolete compatibility

on 32bit platform

$ gcc -E -dM - </dev/null | grep CYGWIN
#define __CYGWIN__ 1
#define __CYGWIN32__ 1

on 64 bit

$ gcc -E -dM - </dev/null | grep CYGWIN
#define __CYGWIN__ 1


      parent reply	other threads:[~2021-02-23 18:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 19:17 [PATCH] binutils: Avoid renaming over existing files Siddhesh Poyarekar
2021-02-09  3:33 ` Fangrui Song
2021-02-15  5:17 ` [PING][PATCH] " Siddhesh Poyarekar
2021-02-15 15:59   ` Michael Matz
2021-02-15 16:11     ` Siddhesh Poyarekar
2021-02-18 19:20   ` Nick Clifton
2021-02-19  2:37     ` Siddhesh Poyarekar
2021-02-19  7:44       ` Matthias Klose
2021-02-19  8:02         ` Siddhesh Poyarekar
2021-02-19 16:45           ` Nick Clifton
2021-02-22 15:30             ` Siddhesh Poyarekar
2021-02-23  0:00               ` Alan Modra
2021-02-23  2:23                 ` Siddhesh Poyarekar
2021-02-23  4:44                   ` Fangrui Song
2021-02-23  5:10                     ` Siddhesh Poyarekar
2021-02-23  6:52                       ` [PATCH] binutils: Attempt to retain permissions on copying file Siddhesh Poyarekar
2021-02-23 11:56                         ` Alan Modra
2021-02-24 10:27                           ` Siddhesh Poyarekar
2021-02-24 23:47                             ` Alan Modra
2021-02-25  2:28                               ` Siddhesh Poyarekar
2021-02-26  7:33                                 ` Alan Modra
2021-02-23 18:49                         ` Marco Atzeri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5730a7d8-cd6e-46ab-dd6c-6cf2edf49fc4@gmail.com \
    --to=marco.atzeri@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).