Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: spdawson at gmail.com <spdawson@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] sudo: fix install
Date: Tue, 19 Jun 2012 11:35:53 +0100	[thread overview]
Message-ID: <1340102153-22387-1-git-send-email-spdawson@gmail.com> (raw)

From: Simon Dawson <spdawson@gmail.com>

Running sudo on the target fails with the following errors.

  sudo: /usr/libexec/sudoers.so: No such file or directory
  sudo: fatal error, unable to load plugins

The problem is that the installation of the sudo package is broken. This patch
replaces the hand-crafted install rule with the default AUTOTARGETS install.

Unfortunately, the default install fails because it includes a step that invokes
the cross-compiled visudo binary. A patch is provided here to disable this
visudo invocation, which is for sanity checking only.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 package/sudo/sudo-fix-sudoers-plugin-install.patch |   19 +++++++++++++++++++
 package/sudo/sudo.mk                               |    8 --------
 2 files changed, 19 insertions(+), 8 deletions(-)
 create mode 100644 package/sudo/sudo-fix-sudoers-plugin-install.patch

diff --git a/package/sudo/sudo-fix-sudoers-plugin-install.patch b/package/sudo/sudo-fix-sudoers-plugin-install.patch
new file mode 100644
index 0000000..e85e5d8
--- /dev/null
+++ b/package/sudo/sudo-fix-sudoers-plugin-install.patch
@@ -0,0 +1,19 @@
+The installation of the sudoers plugin fails when cross compiling, because it
+tries to run the cross-compiled visudo, rather than that of the host.
+
+The visudo invocation is only required in order to sanity check any existing
+sudoers file in the target directory; this can safely be dispensed with.
+
+Signed-off-by: Simon Dawson <spdawson@gmail.com>
+diff -Nurp a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in
+--- a/plugins/sudoers/Makefile.in	2012-05-15 17:22:02.000000000 +0100
++++ b/plugins/sudoers/Makefile.in	2012-06-19 11:24:00.322449438 +0100
+@@ -239,7 +239,7 @@ sudoers: $(srcdir)/sudoers.in
+ pre-install:
+ 	@if test -r $(DESTDIR)$(sudoersdir)/sudoers; then \
+ 	    echo "Checking existing sudoers file for syntax errors."; \
+-	    ./visudo -c -f $(DESTDIR)$(sudoersdir)/sudoers; \
++	    (echo "SKIPPED" || ./visudo -c -f $(DESTDIR)$(sudoersdir)/sudoers); \
+ 	fi
+ 
+ install: install-plugin install-binaries install-sudoers install-doc
diff --git a/package/sudo/sudo.mk b/package/sudo/sudo.mk
index 3629ad1..f1efc54 100644
--- a/package/sudo/sudo.mk
+++ b/package/sudo/sudo.mk
@@ -14,12 +14,4 @@ SUDO_CONF_OPT = \
 		--without-interfaces \
 		--without-pam
 
-define SUDO_INSTALL_TARGET_CMDS
-	install -m 4555 -D $(@D)/src/sudo $(TARGET_DIR)/usr/bin/sudo
-	install -m 0555 -D $(@D)/plugins/sudoers/visudo  \
-		$(TARGET_DIR)/usr/sbin/visudo
-	install -m 0440 -D $(@D)/plugins/sudoers/sudoers \
-		$(TARGET_DIR)/etc/sudoers
-endef
-
 $(eval $(call AUTOTARGETS))
-- 
1.7.9.5

             reply	other threads:[~2012-06-19 10:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-19 10:35 spdawson at gmail.com [this message]
2012-06-19 10:51 ` [Buildroot] [PATCH] sudo: fix install Thomas Petazzoni
2012-06-19 11:19   ` Simon Dawson
2012-06-21  8:44     ` Simon Dawson
  -- strict thread matches above, loose matches on Subject: below --
2012-06-21  8:45 spdawson at gmail.com
2012-06-21 20:11 ` Arnout Vandecappelle
2012-06-21 21:53   ` Thomas Petazzoni
2012-06-22  6:48     ` Simon Dawson
2012-06-23  7:36 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1340102153-22387-1-git-send-email-spdawson@gmail.com \
    --to=spdawson@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox