Gentoo Archives: gentoo-user

From: Joshua Murphy <poisonbl@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Am I wrong?..
Date: Fri, 02 Oct 2009 06:39:05
Message-Id: c30988c30910012339s2b8161d9n7f46c37a207ec106@mail.gmail.com
In Reply to: Re: [gentoo-user] Am I wrong?.. by Joshua Murphy
1 On Fri, Oct 2, 2009 at 2:30 AM, Joshua Murphy <poisonbl@×××××.com> wrote:
2 > 2009/10/2 Arthur D. <spinal.by@××××.ru>:
3 >>>> You appear to be demonstrating that you don't fully understand the
4 >>>> problem:
5 >>>>
6 >>>> 828 ~ $ grep nano /usr/portage/app-admin/sudo/sudo-1.7.2_p1.ebuild
7 >>>>        # XXX: /bin/vi may not be available, make nano visudo's default.
8 >>>>                --with-editor=/bin/nano \
9 >>>
10 >>> How so? That config option for sudo sets the DEFAULT editor, what to use
11 >>> if nothing is defined in the config file or environment variable. That's
12 >>> what both my text and the portion of the ebuild that you have quoted
13 >>> state. It in no way forces the use of nano in order to use visudo. If
14 >>> that were the case, DEPENDS would specify nano instead of accepting
15 >>> virtual/editor.
16 >>
17 >> Agree. There's no need in making vim as depends. But in other hand in
18 >> vanilla sudo
19 >> package there's VI hardcoded by default. And MOST if not ALL users who have
20 >> VIM
21 >> installed on their shiny Gentoo systems expect that VIsudo will behave as it
22 >> did
23 >> for long tim ago. There are historical (or some other) reasons for making VI
24 >> default
25 >> editor for this utility. It's like they don't respect not only endusers
26 >> favours but
27 >> the developers' too, no?
28 >>
29 >> WHY NOT CHECK if vim binary is in place and ONLY THEN (when it's obviously
30 >> absent)
31 >> hardcode the Gentoo Best Award of Choice Editor?
32 >>
33 >> I repeat once more.
34 >> Every user who has VIM installed on theirs systems is forced to do extra
35 >> configuration, to make sudo work as expected, just because someone prefer
36 >> other editor and thinks that vanilla choice is bad. Isn't that just stupid?
37 >>
38 >> --
39 >> Best regards, Spinal
40 >
41 > And everyone who has emacs has to do extra work too, in order to get
42 > sudo to respect their chosen editor. Changing the default fallback for
43 > visudo when the environment variable isn't defined will add in further
44 > dependencies and/or put a dependency on a package that can't be
45 > reasonably assumed to be on the system in the near future. You're not
46 > being forced to do more work because you use vim, you're doing more
47 > work because you remove the sane default editor from the system. As
48 > does everyone removing nano and using pico.... and... how many others?
49 > Go to LFS, build it all, build emacs, set EDITOR to emacs, and run
50 > sudo visudo. Please. I have a rather good guess that you'll be,
51 > amazingly, using the default that was set at build time for the sane
52 > default editor, in LFS's case vim (whether called by that or the vi
53 > symlink to it), that the distro creators chose. Or if you vary from
54 > the instructions, choosing some other editor at sudo's build time,
55 > you'll be running that. The ebuild does the logical thing in choosing
56 > an editor that a) is in place by default and b) is less likely to be
57 > on the system or off the system by the admin's whim. Most leave the
58 > default in place. I suppose, really, the only more guaranteed editor
59 > would be "busybox vi" ... because VERY few go about breaking the
60 > default tools built into busybox... but what would that leave the many
61 > who use nano by default, as... it IS the distro default, to do?
62 > Compared to nano, vi (let alone a bare minimal vi like is in busybox)
63 > is a pain to use for a person who's never seen it before.
64 >
65 > Also, randomly, I could be wrong here, not being a sudo user myself
66 > outside of my ubuntu laptop... but if you look into sudo ... it drops
67 > the environment, aside from those chosen specifically to be preserved
68 > by root, through its configuration, as a security measure. It's not an
69 > ebuild problem, it's not a 'defaults' problem. From what you seem to
70 > see as 'proper' behavior for sudo, it's an upstream security decision
71 > problem.
72 >
73 > --
74 > Poison [BLX]
75 > Joshua M. Murphy
76 > Yet another vim user.
77 >
78
79 Oh! and 2 more things.
80
81 1) In answer to the subject-posed question (in case it wasn't clear in
82 my post just above)... yes.
83
84 2) And... your problem shouldn't be with the default set in the
85 ebuild, but rather, the lack of a sed line in the ebuild to adjust
86 sudo's initial configuration to retain, at the least, the EDITOR
87 environment variable. That would, were the answer to your
88 subject-posed question anything other than an unequivocal yes, be the
89 most universal resolution to the problem that you seem to think exists
90 in the setup as it is now. No ebuild should depend on an environment
91 variable like EDITOR at build time if they can, even remotely, avoid
92 it. That would require a rebuild every time the environment variable
93 changed and... that would be rather jarring to say the least.
94
95 --
96 Poison [BLX]
97 Joshua M. Murphy