Skip to Content.
Sympa Menu

sm-sorcery-bugs - [SM-Sorcery-Bugs] [Bug 7524] Menu option to set editor

sm-sorcery-bugs AT lists.ibiblio.org

Subject: Bugs for Sorcery are reported here

List archive

Chronological Thread  
  • From: bugzilla-daemon AT metalab.unc.edu
  • To: sm-sorcery-bugs AT lists.ibiblio.org
  • Subject: [SM-Sorcery-Bugs] [Bug 7524] Menu option to set editor
  • Date: Sun, 17 Oct 2004 04:06:16 -0400

http://bugs.sourcemage.org/show_bug.cgi?id=7524





------- Additional Comments From acedit AT armory.com 2004-10-17 04:06 -------
Why not instead of trying to source ourselves into root's environment we
just preserve the calling users environment? I believe if we do su with
-p we keep the calling users environment, their EDITOR field, and
all that other stuff that should be setup from /etc/profile. The only
thing is thats different is the user id and group id are that of root.

I dont really know any compelling reason for why we have to get
root's environment, especially since we have to fight so hard to get it!
I also think it'd solve your head -1 issue from sm-discuss because,
presumably your regular user has all that stuff setup right, and
its only because of the "-" and lack of "-p" arguments to su that
you lose them and sorcery acts stupid.

Finally, lets picture a box partially administrated by two people,
one person likes emacs and the other likes vi, they have their
own respective EDITOR variable set. So under the "keep the old user's
env" scheme both users get their choice of editor if they invoke
sorcery as their normal user. In the other scheme sorcery runs
with whatever editor root has set up, and now one of our users
has to use the others editor. Also, this would be consistent behavior
if the user was running as root, whatever they had set for EDITOR
would be used, its just we wouldnt have to su -p to get there.

In other words consider the situation if we were to adopt the "use root's
environment" scheme. root's editor could be vi and user1's editor is emacs,
user1 su -'s to root, and his editor is now vi, he runs sorcery and since he
is root, there is no need to run the program as root, and so it keeps the
editor as vi, now lets say he su's to root without a login shell, in that
case his editor is emacs, and thats what sorcery uses (since he's root
already it doesnt reload config files on su). I think this behavior would
be inconsistent since if he let sorcery su for him, the editor would of
become vi again.

So I say we go for option c, which is preserve the callers environment
where possible. I think this is also the simplest solution, and IMO is
the most consistent and follows the principle of least surprise. My main
concern is that whatever we do it should be 1) consistent 2) easy if
possible. Adding a -p to all the su's is certainly easier than fighing
to get a new environment sourced from commands that specifically dont want
to do that.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




Archive powered by MHonArc 2.6.24.

Top of Page