public inbox for
 help / color / mirror / Atom feed
From: Ian Lance Taylor <>
Subject: Re: strip looses original file ownership and file permissions
Date: Thu, 06 May 1999 09:27:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

   Date: Thu, 06 May 1999 13:44:47 +0200
   From: Franz Sirl <>

   >I just verified that strip out of gas-990418 looses original ownership and 
   >permissions of a file.
   >This is on glibc-2.1.1pre2, Linux-2.2.6 (PPC).
   >Is this platform specific or does anybody else notice this?

   After a quick browse through the source I came up with the following 
   untested patch. Does it look right?

It doesn't look right to me.

We need to rename the file FROM to TO.  In the normal case of strip,
FROM is a temporary file, and TO is the original file which we are
stripping.  However, this function is also used in other cases.

If TO does not exist, we should just use rename.  This is not the
normal case of strip, but it happens in other cases.  Your patch
breaks that.  That seems to be only significant change in your patch.
Perhaps I am missing something.

I think the only way to reliably preserve ownership is to avoid using
rename.  Perhaps the code should be changed to call simple_copy when
the owner of the file differs from the effective uid.


  reply	other threads:[~1999-05-06  9:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-06  3:48 Franz Sirl
1999-05-06  4:45 ` Franz Sirl
1999-05-06  9:27   ` Ian Lance Taylor [this message]
1999-05-06  9:54     ` Franz Sirl
1999-05-06 11:03       ` Ian Lance Taylor
1999-05-06 11:43         ` Franz Sirl
1999-05-06 13:57           ` Ian Lance Taylor

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:

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

  git send-email \ \ \ \ \

* 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).