From patchwork Tue Jun 19 10:35:53 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Dawson X-Patchwork-Id: 165701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 25CF1B7000 for ; Tue, 19 Jun 2012 20:37:09 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 52B40A03DF; Tue, 19 Jun 2012 10:37:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0msn7FMADV0u; Tue, 19 Jun 2012 10:37:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id D0724A03CA; Tue, 19 Jun 2012 10:37:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 57FD88F753 for ; Tue, 19 Jun 2012 10:37:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id D83908D1B9 for ; Tue, 19 Jun 2012 10:37:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6ZKlnLyeQeh1 for ; Tue, 19 Jun 2012 10:37:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ee0-f43.google.com (mail-ee0-f43.google.com [74.125.83.43]) by whitealder.osuosl.org (Postfix) with ESMTPS id 499578CFEC for ; Tue, 19 Jun 2012 10:37:03 +0000 (UTC) Received: by eeke50 with SMTP id e50so3209835eek.16 for ; Tue, 19 Jun 2012 03:37:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=WCP0lciU42s1bLB2X0IVMqYv6XiMD/5cO1kkMQsV9Vk=; b=nzIbjlRRy4fXE7Vk0ihf60nfZDuV/Hm53lz/MlDe/JhpSzghlajT/973pDMI4l8Foo zVMFPVpL8CCApXwoDDuhdjWIp1RJn09EAf4RgaDdXpQY5+DR9x+lE03Dgh0k2fKge9m1 1v0WPoK2eU5rgq/ledBGNCmwvwGLHiHYuuBpSFEkQWCBuiQ3q9GSeW6pOM58Qfw9T1DI OacPo5sjJ6ppKmIHe2AwQhydTiu3sX7qZ5mDOETqW0nf4XcP05w/SyYazPxkxbLdwNdb z68HQ46b6AtSnW7BbSzptFdYYFChQtBMStkqIto1mLzWMen5agtDo220ni+V6SjssQNo itOQ== Received: by 10.14.22.6 with SMTP id s6mr4379353ees.154.1340102220573; Tue, 19 Jun 2012 03:37:00 -0700 (PDT) Received: from localhost.localdomain (host-2-100-182-54.as13285.net. [2.100.182.54]) by mx.google.com with ESMTPS id c51sm74059826eei.12.2012.06.19.03.36.58 (version=SSLv3 cipher=OTHER); Tue, 19 Jun 2012 03:36:59 -0700 (PDT) From: spdawson@gmail.com To: buildroot@busybox.net Date: Tue, 19 Jun 2012 11:35:53 +0100 Message-Id: <1340102153-22387-1-git-send-email-spdawson@gmail.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Buildroot] [PATCH] sudo: fix install X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net From: Simon Dawson 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 --- 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 +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))