all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: unable to copy directory recursively to a vfat partition
@ 2008-07-23 22:51 Chong Yidong
  2008-07-24  5:30 ` Sven Joachim
  0 siblings, 1 reply; 10+ messages in thread
From: Chong Yidong @ 2008-07-23 22:51 UTC (permalink / raw
  To: Sven Joachim; +Cc: emacs-devel

Regarding bug 268 in the bug tracker:

> Copying a directory recursively in dired to a vfat partition fails
> because `dired-copy-file-recursive' calls `set-file-modes' on
> directories after creating them.  This behaviour appears to be
> new in 22.2, same recursive copy worked in 22.1.

This appears to be due to the following change:

2007-10-31  Sven Joachim  <svenjoac@gmx.de>

	* dired-aux.el (dired-copy-file-recursive):
	Preserve directory permissions.

Could someone fix this in both the trunk and the branch?
It looks like a simple condition-case around the call to
set-file-modes in dired-copy-file-recursive should be
enough; but someone with access to vfat needs to test this.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  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
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Joachim @ 2008-07-24  5:30 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

On 2008-07-24 00:51 +0200, Chong Yidong wrote:

> Regarding bug 268 in the bug tracker:
>
>> Copying a directory recursively in dired to a vfat partition fails
>> because `dired-copy-file-recursive' calls `set-file-modes' on
>> directories after creating them.  This behaviour appears to be
>> new in 22.2, same recursive copy worked in 22.1.
>
> This appears to be due to the following change:
>
> 2007-10-31  Sven Joachim  <svenjoac@gmx.de>
>
> 	* dired-aux.el (dired-copy-file-recursive):
> 	Preserve directory permissions.
>
> Could someone fix this in both the trunk and the branch?
> It looks like a simple condition-case around the call to
> set-file-modes in dired-copy-file-recursive should be
> enough; but someone with access to vfat needs to test this.

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.

Sven




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24  5:30 ` Sven Joachim
@ 2008-07-24  5:54   ` Sven Joachim
  2008-07-24 13:23     ` Chong Yidong
  0 siblings, 1 reply; 10+ messages in thread
From: Sven Joachim @ 2008-07-24  5:54 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

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.

Sven




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24  5:54   ` Sven Joachim
@ 2008-07-24 13:23     ` Chong Yidong
  2008-07-24 14:05       ` Sven Joachim
  2008-07-24 14:35       ` unable to copy directory recursively to a vfat partition Jason Rumney
  0 siblings, 2 replies; 10+ messages in thread
From: Chong Yidong @ 2008-07-24 13:23 UTC (permalink / raw
  To: Sven Joachim; +Cc: emacs-devel

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24 13:23     ` Chong Yidong
@ 2008-07-24 14:05       ` Sven Joachim
  2008-07-24 14:59         ` Stefan Monnier
  2008-07-24 16:19         ` Chong Yidong
  2008-07-24 14:35       ` unable to copy directory recursively to a vfat partition Jason Rumney
  1 sibling, 2 replies; 10+ messages in thread
From: Sven Joachim @ 2008-07-24 14:05 UTC (permalink / raw
  To: Chong Yidong; +Cc: emacs-devel

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24 13:23     ` Chong Yidong
  2008-07-24 14:05       ` Sven Joachim
@ 2008-07-24 14:35       ` Jason Rumney
  1 sibling, 0 replies; 10+ messages in thread
From: Jason Rumney @ 2008-07-24 14:35 UTC (permalink / raw
  To: Chong Yidong; +Cc: Sven Joachim, emacs-devel

Chong Yidong wrote:

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

Also what do other versions of the Linux kernel do on other more capable
filesystems if you set up ACLs in such a way that new files can be
created but their permissions can't be later changed (it may be possible
to set up the same scenario without ACLs by using combinations of setuid
and sticky bits on the destination directory)?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24 14:59         ` Stefan Monnier
@ 2008-07-24 14:57           ` Sven Joachim
  0 siblings, 0 replies; 10+ messages in thread
From: Sven Joachim @ 2008-07-24 14:57 UTC (permalink / raw
  To: Stefan Monnier; +Cc: Chong Yidong, emacs-devel

On 2008-07-24 16:59 +0200, Stefan Monnier wrote:

>> 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:
>
> Assuming your meant "chmod", I agree.

Yes, of course I meant that.

Sven




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24 14:05       ` Sven Joachim
@ 2008-07-24 14:59         ` Stefan Monnier
  2008-07-24 14:57           ` Sven Joachim
  2008-07-24 16:19         ` Chong Yidong
  1 sibling, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2008-07-24 14:59 UTC (permalink / raw
  To: Sven Joachim; +Cc: Chong Yidong, emacs-devel

> 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:

Assuming your meant "chmod", I agree.


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: unable to copy directory recursively to a vfat partition
  2008-07-24 14:05       ` Sven Joachim
  2008-07-24 14:59         ` Stefan Monnier
@ 2008-07-24 16:19         ` Chong Yidong
       [not found]           ` <871w41jb5o.fsf@river.rdd.mine.nu>
  1 sibling, 1 reply; 10+ messages in thread
From: Chong Yidong @ 2008-07-24 16:19 UTC (permalink / raw
  To: Sven Joachim; +Cc: 268-done, emacs-devel

Sven Joachim <svenjoac@gmx.de> writes:

> 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:

Checked in, thanks.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#268: marked as done (unable to copy directory recursively to  a vfat partition)
       [not found]           ` <871w41jb5o.fsf@river.rdd.mine.nu>
@ 2008-07-24 16:25             ` Emacs bug Tracking System
  0 siblings, 0 replies; 10+ messages in thread
From: Emacs bug Tracking System @ 2008-07-24 16:25 UTC (permalink / raw
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 877 bytes --]


Your message dated Thu, 24 Jul 2008 12:19:23 -0400
with message-id <87vdyvfe5w.fsf@stupidchicken.com>
and subject line Re: unable to copy directory recursively to a vfat partition
has caused the Emacs bug report #268,
regarding unable to copy directory recursively to a vfat partition
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact don@donarmstrong.com
immediately.)


-- 
268: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=268
Emacs Bug Tracking System
Contact don@donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 5285 bytes --]

From: rdd@comhem.se (Richard Dörwaldt)
To: bug-gnu-emacs@gnu.org
Subject: unable to copy directory recursively to a vfat partition
Date: Sat, 17 May 2008 15:46:43 +0200
Message-ID: <871w41jb5o.fsf@river.rdd.mine.nu>


Please write in English if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.

Your bug report will be posted to the bug-gnu-emacs@gnu.org mailing list,
and to the gnu.emacs.bug news group.

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Copying a directory recursively in dired to a vfat partition fails because
`dired-copy-file-recursive' calls `set-file-modes' on directories after creating
them.  This behaviour appears to be new in 22.2, same recursive copy worked in
22.1.

If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
If you would like to further debug the crash, please read the file
/usr/share/emacs/22.2/etc/DEBUG for instructions.


In GNU Emacs 22.2.1 (x86_64-pc-linux-gnu, GTK+ Version 2.12.9)
 of 2008-05-13 on river
Windowing system distributor `The X.Org Foundation', version 11.0.10400090
configured using `configure  '--prefix=/usr' '--host=x86_64-pc-linux-gnu' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--datadir=/usr/share' '--sysconfdir=/etc' '--localstatedir=/var/lib' '--program-suffix=-emacs-22' '--infodir=/usr/share/info/emacs-22' '--without-carbon' '--with-sound' '--with-x' '--with-toolkit-scroll-bars' '--with-jpeg' '--with-tiff' '--with-gif' '--with-png' '--with-xpm' '--with-x-toolkit=gtk' '--without-hesiod' '--without-kerberos' '--without-kerberos5' '--libdir=/usr/lib64' '--build=x86_64-pc-linux-gnu' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=x86_64-pc-linux-gnu' 'CFLAGS=-O2 -march=athlon64 -pipe' 'LDFLAGS=''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: en_US.UTF-8
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: utf-8
  default-enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  paredit-mode: t
  eldoc-mode: t
  partial-completion-mode: t
  iswitchb-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t

Recent input:
C-x 3 C-x 3 C-x + C-x C-f / m n t / u 3 RET C-u s R 
RET C-x 2 C-x C-f ~ / m s <tab> <backspace> u s <tab> 
s o r t <tab> RET C-s a r c C-s RET RET C-n C-n C-p 
C m u s i c <tab> RET y C-n C-p g M-o g C-s 2 0 0 7 
RET d x y M-o C-x 2 C-x + M-x r e p o r t - e m a c 
s - b u g RET

Recent messages:
Recursive copies of /home/rdd/music/sorted/arctic_monkeys/2007-favourite_worst_nightmare? (y or n) 
Copy: 1 of 1
Copying error for /home/rdd/music/sorted/arctic_monkeys/2007-favourite_worst_nightmare:
(file-error Doing chmod operation not permitted /mnt/u3/music/2007-favourite_worst_nightmare)

Mark saved where search started
Delete music/2007-favourite_worst_nightmare (y or n) 
1 of 1 deletions
1 deletion done
Loading emacsbug...done

-- 
rdd




[-- Attachment #3: Type: message/rfc822, Size: 1545 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Sven Joachim <svenjoac@gmx.de>
Cc: emacs-devel@gnu.org, 268-done@emacsbugs.donarmstrong.com
Subject: Re: unable to copy directory recursively to a vfat partition
Date: Thu, 24 Jul 2008 12:19:23 -0400
Message-ID: <87vdyvfe5w.fsf@stupidchicken.com>

Sven Joachim <svenjoac@gmx.de> writes:

> 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:

Checked in, thanks.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-24 16:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.