all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Sven Joachim <svenjoac@gmx.de>
To: Chong Yidong <cyd@stupidchicken.com>
Cc: emacs-devel@gnu.org
Subject: Re: unable to copy directory recursively to a vfat partition
Date: Thu, 24 Jul 2008 16:05:25 +0200	[thread overview]
Message-ID: <87ljzre5sq.fsf@gmx.de> (raw)
In-Reply-To: <87prp3a01h.fsf@stupidchicken.com> (Chong Yidong's message of "Thu, 24 Jul 2008 09:23:22 -0400")

On 2008-07-24 15:23 +0200, Chong Yidong wrote:

> Sven Joachim <svenjoac@gmx.de> writes:
>
>> On 2008-07-24 07:30 +0200, Sven Joachim wrote:
>>
>>> I do have access to vfat, but I cannot reproduce the bug.  IIRC there
>>> was some change in Linux 2.6.25 that caused the chmod call to report
>>> failure (it never works on vfat anyway, but that used to be silently
>>> ignored).  This change seems to have been reverted in the meantime,
>>> though; I'm running 2.6.26 here.
>>
>> The change in 2.6.25 also broke rsync, as can be seen on
>> https://bugzilla.redhat.com/show_bug.cgi?id=449080.  I'll have a look at
>> the problem when I get around to reboot with a 2.6.25 kernel.
>
> Does anyone know what the BSDs do?  In other words, is reporting failure
> for chmod simply "undefined behavior" that is up to the discretion of
> the kernel (i.e., we need to be able to handle it), or is it simply a
> Linux bug (i.e., we can probably get away with doing nothing)?

I think we should avoid the first chown and create the directory with
correct permissions from the start.  Here is a patch for EMACS_22_BASE:

2008-07-24  Sven Joachim  <svenjoac@gmx.de>

	* dired-aux.el (dired-copy-file-recursive): Avoid calling
	set-file-modes when creating target directories.

--8<---------------cut here---------------start------------->8---
--- dired-aux.el.~1.151.2.7.~	2008-04-07 18:03:21.000000000 +0200
+++ dired-aux.el	2008-07-24 15:43:30.000000000 +0200
@@ -1180,9 +1180,12 @@
 	    (if (file-exists-p to)
 		(or top (dired-handle-overwrite to))
 	      (condition-case err
-		  (progn
-		    (make-directory to)
-		    (set-file-modes to #o700))
+		  (let ((default-mode (default-file-modes)))
+		    (unwind-protect
+			(progn
+			  (set-default-file-modes #o700)
+			  (make-directory to))
+		      (set-default-file-modes default-mode)))
 		(file-error
 		 (push (dired-make-relative from)
 		       dired-create-files-failures)
--8<---------------cut here---------------end--------------->8---

If the directory permissions fail to be restored later, this will still
be reported as an error, but I think it's correct to do that.  Note that
any program that recursively copies files and preserves permissions will
have this problem on Linux 2.6.25 and vfat.  Unless you mount the vfat
filesystem with the `quiet' option, that is.

Sven




  reply	other threads:[~2008-07-24 14:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-23 22:51 unable to copy directory recursively to a vfat partition Chong Yidong
2008-07-24  5:30 ` Sven Joachim
2008-07-24  5:54   ` Sven Joachim
2008-07-24 13:23     ` Chong Yidong
2008-07-24 14:05       ` Sven Joachim [this message]
2008-07-24 14:59         ` Stefan Monnier
2008-07-24 14:57           ` Sven Joachim
2008-07-24 16:19         ` Chong Yidong
     [not found]           ` <871w41jb5o.fsf@river.rdd.mine.nu>
2008-07-24 16:25             ` bug#268: marked as done (unable to copy directory recursively to a vfat partition) Emacs bug Tracking System
2008-07-24 14:35       ` unable to copy directory recursively to a vfat partition Jason Rumney

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=87ljzre5sq.fsf@gmx.de \
    --to=svenjoac@gmx.de \
    --cc=cyd@stupidchicken.com \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.