unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Richard M. Stallman" <rms@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Race-condition ?
Date: Sun, 03 Jul 2005 11:49:03 -0400	[thread overview]
Message-ID: <E1Dp6iN-0005qq-Nz@fencepost.gnu.org> (raw)
In-Reply-To: <qlky88ursxv.fsf@clipper.ens.fr> (gaetan.leurent@ens.fr)

    Some (including GNU mv and GNU cp) do even use chown and
    chmod in the same unsafe way that we did previously, so I will report
    that to them.

Thank you.

    Now, as for as I can tell, there is no way to move a file asking the
    user what to do if needed and avoid every race-conditions in a Unix-like
    OS. I will try to come with a solution that avoids the worse problems.

That is good.

     Those two ways will have different effects if the file we
    overwrite/remove has a link count > 1. Current emacs implementation use
    "overwrite mode" in copy and "remove mode" in rename if it is in the
    same filesystem,

Those are clearly the right things.  copy-file is defined to overwrite
an existing file; it would be wrong to do anything else (at least in
the default case).  Rename, in the case where it is implemented by the
rename system call, will replace the existing file.

		     but cross-filesystem rename use the "overwrite
    mode".

In principle, that ought to replace the existing file, to be
consistent with other cases of renaming.

The easiest way might be to create an option (or reuse an existing
option) in copy-file, so that rename-file can continue to handle this
case by calling copy-file.

  parent reply	other threads:[~2005-07-03 15:49 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-24  9:08 "Preserve owner and group" on MSDOS/Windows Juanma Barranquero
2005-06-24 11:45 ` Eli Zaretskii
2005-06-24 11:02   ` Juanma Barranquero
2005-06-24 15:07 ` Race-condition ? (was: "Preserve owner and group" on MSDOS/Windows) Gaëtan LEURENT
2005-06-24 20:07   ` Eli Zaretskii
2005-06-24 20:46     ` Race-condition ? Gaëtan LEURENT
2005-06-25  9:27       ` Eli Zaretskii
2005-06-24 21:01     ` David Kastrup
2005-06-25 22:25       ` Gaëtan LEURENT
2005-06-26 18:48         ` David Kastrup
2005-06-26  4:46   ` Race-condition ? (was: "Preserve owner and group" on MSDOS/Windows) Richard M. Stallman
2005-06-26 19:52     ` Race-condition ? Gaëtan LEURENT
2005-06-27  5:38       ` Richard M. Stallman
2005-06-28 22:57         ` Gaëtan LEURENT
2005-06-28 23:50           ` Lennart Borgman
2005-06-30  5:42             ` David Kastrup
2005-07-03 15:49           ` Richard M. Stallman [this message]
2005-06-26  4:46   ` Race-condition ? (was: "Preserve owner and group" on MSDOS/Windows) Richard M. Stallman
2005-06-26 17:12     ` Race-condition ? Gaëtan LEURENT
2005-06-26 18:59     ` Race-condition ? (was: "Preserve owner and group" on MSDOS/Windows) Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=E1Dp6iN-0005qq-Nz@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=emacs-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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