From b1108f06e1e49107d589b5b9e505c04d177974fc Mon Sep 17 00:00:00 2001 From: Carsten Schlote Date: Mon, 26 Apr 2010 13:42:45 +0200 Subject: [sudo] added visudo and configuration options for default and ENV editor Signed-off-by: Carsten Schlote [mkl: split into seperate patches] Signed-off-by: Marc Kleine-Budde --- rules/sudo.in | 20 ++++++++++++++++++++ rules/sudo.make | 16 +++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/rules/sudo.in b/rules/sudo.in index 58a3c1a37..4540dfaf6 100644 --- a/rules/sudo.in +++ b/rules/sudo.in @@ -23,4 +23,24 @@ config SUDO_INSTALL_ETC_SUDOERS help Installs /etc/sudoers from a selectable source +config SUDO_INSTALL_VISUDO + bool "Install visudo to edit /etc/sudoers" + help + Installs visudo to edit /etc/sudoers. + +if SUDO_INSTALL_VISUDO + +config SUDO_DEFAULT_EDITOR + string "visudo default editor" + default "/bin/vi" + help + Default editor for visudo + +config SUDO_USE_ENV_EDITOR + bool "Use EDITOR env for visudo" + help + Uses editor from EDITOR env for visudo + +endif + endif diff --git a/rules/sudo.make b/rules/sudo.make index e238be3f3..9bd2a173d 100644 --- a/rules/sudo.make +++ b/rules/sudo.make @@ -67,6 +67,16 @@ else SUDO_AUTOCONF += --without-sendmail endif +ifneq ($(PTXCONF_SUDO_DEFAULT_EDITOR),"") +SUDO_AUTOCONF += --with-editor=$(PTXCONF_SUDO_DEFAULT_EDITOR) +endif + +ifdef PTXCONF_SUDO_USE_ENV_EDITOR +SUDO_AUTOCONF += --with-env-editor +else +SUDO_AUTOCONF += --without-env-editor +endif + # --disable-root-mailer Don't run the mailer as root, run as the user # --disable-setreuid Don't try to use the setreuid() function # --disable-setresuid Don't try to use the setresuid() function @@ -140,8 +150,12 @@ $(STATEDIR)/sudo.targetinstall: ifdef PTXCONF_SUDO_INSTALL_ETC_SUDOERS @$(call install_alternative, sudo, 0, 0, 0440, /etc/sudoers, n) endif - @$(call install_finish, sudo) +ifdef PTXCONF_SUDO_INSTALL_VISUDO + @$(call install_copy, sudo, 0, 0, 755, -, /usr/sbin/visudo) +endif + + @$(call install_finish, sudo) @$(call touch) # vim: syntax=make -- cgit v1.2.3