Bug 81820 - emacs gets into loop trying to create /root/.emacs.d
Summary: emacs gets into loop trying to create /root/.emacs.d
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: emacs
Version: 1.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jens Petersen
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-01-14 08:50 UTC by Jonathan Kamens
Modified: 2015-01-08 00:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-01-21 08:18:44 UTC
Embargoed:


Attachments (Terms of Use)

Description Jonathan Kamens 2003-01-14 08:50:40 UTC
I used "sudo -s" to get a root shell and then "su news" to get a news shell, and
then ran "emacs -nw /etc/news/incoming.conf" to edit a configuration file. 
Part-way through that editing task, Emacs started beeping repeatedly and
displaying a message in the minibuffer indicating that it could not create
/root/.emacs.d.  I finally had to send a kill signal to the Emacs process, at
which point it coredumped.

I'm current WRT Raw Hide, including emacs-21.2-27.

Comment 1 Jens Petersen 2003-01-15 17:52:02 UTC
I don't have an "/etc/news/incoming" files, but I just tried editting
a new file in "/etc/news" and emacs created an autosave backup file in
"/etc/news" without any problems.

Comment 2 Jens Petersen 2003-01-15 17:56:50 UTC
Further I should have said "/etc/news/.emacs.d/auto-save-list/"
was created in the process.  Is your "/etc/news" owned by news?

Comment 3 Jonathan Kamens 2003-01-15 19:14:45 UTC
The sequence of steps I used to get to where the problem exhibited itself is
significant.  Using "sudo -s" followed by "su news" leaves the environment in a
state where some environment variables say that the user is root rather than
news.  If you used some other mechanism to become news before editing the file
in /etc/news, the environment probably wasn't set up in such a way as to confuse
Emacs.

How did you become "news" before attempting to edit the file in /etc/news?


Comment 4 Jonathan Kamens 2003-01-15 19:15:55 UTC
Whether or not my /etc/news is owned by news is irrelevant, since as I said, the
infinite loop was while Emacs was trying to create a directory in /root, not in
/etc/news.


Comment 5 Jens Petersen 2003-01-16 03:49:13 UTC
I did

% sudo -s
% su news
% emacs /etc/news/test.file

My default shell is zsh, if that matters?

Comment 6 Jonathan Kamens 2003-01-16 03:52:23 UTC
Aha.  I forgot a crucial fact.  I used "su -m", not "su", which means that
root's environment was preserved, including the HOME environment variable, which
is probably the culprit.  Try that.

(Please don't say this is the fault of using "su -m"; Emacs needs to be able to
cope with an unwritable HOME without going into an infinite loop. :-)


Comment 7 Jens Petersen 2003-01-28 09:11:23 UTC
Yep, reproduced from a bash login shell.  (Fwiw this problem doesn't
to occur if one starts from zsh AFAICT.)

With "sudo -s" the error seems to be in the original user's homedir;
with "su" the error is in /root.



Comment 8 Jens Petersen 2004-01-15 05:43:21 UTC
Any better with 21.3?  I can't seem to reproduce it any more.

Comment 9 Jonathan Kamens 2004-01-15 14:45:31 UTC
I can no longer duplicate the problem with emacs-21.3-7.



Note You need to log in before you can comment on or make changes to this bug.