emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Emacs doesn't preserve the file access permission.


From: Eric Hanchrow
Subject: Re: Emacs doesn't preserve the file access permission.
Date: Sun, 02 Jan 2005 16:43:52 -0800
User-agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.3.50 (gnu/linux)

>>>>> "Eric" == Eric Hanchrow <address@hidden> writes:

    Eric> I'd seen this behavior, too, some time ago (I can't remember
    Eric> when, sorry; maybe a week) but now it seems to be gone (as
    Eric> of CVS 30 December).  I wonder if it was a bug that got
    Eric> fixed.

I've changed my mind: it is indeed a bug.  I've sent a bug report by
using M-x report-emacs-bug, but I've had trouble with that method
before, so I'm duplicating the report here.

Symptoms:

Run the following shell script
    
    #!/bin/sh

    # We can't use /tmp, because Emacs won't make backup files there.
    cd $HOME

    rm -rf yZOG4pbWPzQNM
    mkdir  yZOG4pbWPzQNM
    cd     yZOG4pbWPzQNM

    rm -f zap
    touch zap
    chmod 700 zap
    echo Newly created file has execute permission.
    ls -l zap*

    echo Now we edit the file with Emacs 21.3.
    /usr/bin/emacs --no-site-file --batch zap --eval='(insert 65)' 
--eval='(save-buffer)'
    ls -l zap*
    echo See?  Emacs21 didn\'t change the file\'s permission bits.

    echo Now we similarly edit the file with Emacs 21.3.50
    /usr/local/src/emacs-cvs/src/emacs --batch zap --eval='(insert 65)' 
--eval='(save-buffer)'
    ls -l zap*
    echo See?  CVS Emacs _did_ change the file\'s permission bits.

On my system, I see this:

    /tmp/repro.sh  
    Newly created file has execute permission.
    -rwx------  1 erich erich 0 Jan  2 16:37 zap
    Now we edit the file with Emacs 21.3.
    Wrote /home/erich/yZOG4pbWPzQNM/zap
    -rwx------  1 erich erich 1 Jan  2 16:37 zap
    -rwx------  1 erich erich 0 Jan  2 16:37 zap~
    See? Emacs21 didn't change the file's permission bits.
    Now we similarly edit the file with Emacs 21.3.50
    Wrote /home/erich/yZOG4pbWPzQNM/zap
    -rw-------  1 erich erich 2 Jan  2 16:37 zap
    -rwx------  1 erich erich 1 Jan  2 16:37 zap~
    See? CVS Emacs _did_ change the file's permission bits.
    16:37:53 address@hidden guile]$ 

The bug is that the file `zap' now has mode 600, instead of 700.

In GNU Emacs 21.3.50.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2004-12-30 on debian
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  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: nil
  default-enable-multibyte-characters: t

Major mode: Shell-script

Minor modes in effect:
  erc-autojoin-mode: t
  erc-button-mode: t
  erc-ring-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  desktop-save-mode: t
  mouse-wheel-mode: t
  display-time-mode: t
  auto-compression-mode: t
  iswitchb-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  unify-8859-on-encoding-mode: t
  utf-translate-cjk-mode: t
  line-number-mode: t

Recent input:
C-a ESC C-f / e m a c s C-x C-s C-x o ESC p RET C-x 
o C-u C-p C-p C-e ESC b ESC b C-b C-b ' SPC - - e v 
a l = ' ESC \ C-n C-n C-n C-n C-n ESC b ESC b ESC b 
ESC b ESC b ESC f C-k C-u C-p C-p ESC b C-b C-b C-@ 
C-e ESC w C-n C-n C-n C-n C-n C-y C-x C-x SPC C-x C-s 
C-x o ESC p RET C-x 0 ESC x r e p l DEL o r TAB b TAB 
RET

Recent messages:
History item: 3
Wrote /tmp/repro.sh [2 times]
History item: 1
Wrote /tmp/repro.sh
History item: 1
Auto-saving...done
Mark set [2 times]
Wrote /tmp/repro.sh
History item: 1
Loading emacsbug...done





reply via email to

[Prev in Thread] Current Thread [Next in Thread]