From patchwork Tue Nov 14 12:14:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 837828 X-Patchwork-Delegate: blogic@openwrt.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (helo) smtp.helo=arrakis.dune.hu (client-ip=78.24.191.176; helo=arrakis.dune.hu; envelope-from=openwrt-devel-bounces@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="EkEo0YU8"; dkim-atps=neutral Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ybmfW3Xw9z9rxm for ; Tue, 14 Nov 2017 23:14:57 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 366FAB800C0; Tue, 14 Nov 2017 13:14:46 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, LONGWORDS, T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.1 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP; Tue, 14 Nov 2017 13:14:46 +0100 (CET) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 40FB1B80029 for ; Tue, 14 Nov 2017 13:14:44 +0100 (CET) X-policyd-weight: using cached result; rate:hard: -7 Received: from mail-lf0-f66.google.com (mail-lf0-f66.google.com [209.85.215.66]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Tue, 14 Nov 2017 13:14:44 +0100 (CET) Received: by mail-lf0-f66.google.com with SMTP id 73so7705756lfu.10 for ; Tue, 14 Nov 2017 04:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tc7G8StjQDjl6ME/vT3LBd5/4/J3XeXvYuL4S0zmfM0=; b=EkEo0YU8kK35wwr3LKxXKOK2dzGqnmw8OsNgsybdI7N8rNSALyfW/mWupVMav8hGs3 qsIdCTR3jYY5fYBsPFVKedUIrfbF2to/QqQnYV5j6p/4TJb/12HqfRC1vUlqndPWgl1u bDvANb+wOMjbyLwG5qpyITEt/UQ4mMWVzw5TVqkzmDCahDccPxWltwodoguEhzFKVmib CoPS+Glg3Yco02LQMgL9Wvv+5HIiGd7XIt28+1ZkBWoDGBiVaNn+UzIjL+WswFPuyBEM T//F4vjr1BFrHtTYFAmoe6ghLZ0Wp8AhWGITdXGTpNYqIRAdwb0LUXsKXQBYhz4h6ZdX pe0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=tc7G8StjQDjl6ME/vT3LBd5/4/J3XeXvYuL4S0zmfM0=; b=BwDwxhr2IZStot+PDg4b72OJX57s0wydQfUBFFNNENHy9cT2n5kRoHl4medGgSvM3N tXoFUUriNo8swBz8RKMT+bG2Dcw502UwTfYA+qI9/DUaLftHRgTwAklqffNmRIQ5sXfW fh3J6/Wzls9yQcqymrYzVyAhRx/VNLp3W4Go0cvnWaoSOjf/d6UQz6jSQqX/BeJXCAy/ tCLPpD1lvlneL9P9sAE9YhYZ5oAE9aupG2gheE0hhTGPxKMJRhj++QdK3nxAfWnvLcqh mac16JT8LBPSW98g40s795Qq7awrpGXi5RvtpwD4qSz4MjceLfTAZUfjtkLZtQndP+4+ 1qQQ== X-Gm-Message-State: AJaThX5VDnwVwM8lLMCDxbETRZrxsMMfjAOWXOHsSxy13iWsJBRWdBud +InLIE7FRKuRVMyzNn9Q5m1GPQ== X-Google-Smtp-Source: AGs4zMbBeVR2UeMX6TeNpYsFVw1c7gSsEBpPnsGWVUiIKkL9FG+BNBJR9LXkGNjGPq0WEDbNsHTDww== X-Received: by 10.46.23.85 with SMTP id l82mr4558141lje.178.1510661682092; Tue, 14 Nov 2017 04:14:42 -0800 (PST) Received: from linux-samsung.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id k68sm3721278lje.8.2017.11.14.04.14.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 14 Nov 2017 04:14:41 -0800 (PST) From: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= To: openwrt-devel@lists.openwrt.org, lede-dev@lists.infradead.org Date: Tue, 14 Nov 2017 13:14:24 +0100 Message-Id: <20171114121425.22676-1-zajec5@gmail.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [OpenWrt-Devel] [PATCH packages 1/2] shadow: use proper fix for checking subordinate IDs support X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Luka Perkov , =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= , Steven Barth Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" From: Rafał Miłecki During 4.2.1 version update support for subordinate IDs has been disabled. It was handled by: 1) Adding --disable-subordinate-ids to avoid: configure: error: cannot run test program while cross compiling 2) Adding patch 003-fix-disabling-subids.patch to avoid: usermod.c: In function 'process_flags': usermod.c:1364:10: error: 'vflg' undeclared (first use in this function) if ( (vflg || Vflg) ^ This commit adds a patch with a proper configure.in fix. We don't need to disable subordinate IDs anymore. Signed-off-by: Rafał Miłecki --- utils/shadow/Makefile | 5 ++-- ...-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch | 35 ++++++++++++++++++++++ .../shadow/patches/003-fix-disabling-subids.patch | 32 -------------------- .../patches/004-fix-su-controoling-term.patch | 2 +- 4 files changed, 38 insertions(+), 36 deletions(-) create mode 100644 utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch delete mode 100644 utils/shadow/patches/003-fix-disabling-subids.patch diff --git a/utils/shadow/Makefile b/utils/shadow/Makefile index db9f7fb6..2cefe8b0 100644 --- a/utils/shadow/Makefile +++ b/utils/shadow/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=shadow PKG_VERSION:=4.2.1 -PKG_RELEASE:=6 +PKG_RELEASE:=7 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=http://pkg-shadow.alioth.debian.org/releases @@ -37,8 +37,7 @@ CONFIGURE_ARGS += \ --without-acl \ --without-attr \ --without-tcb \ - --without-nscd \ - --disable-subordinate-ids \ + --without-nscd define Package/shadow/Default SECTION:=utils diff --git a/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch b/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch new file mode 100644 index 00000000..046523df --- /dev/null +++ b/utils/shadow/patches/003-Check-size-of-uid_t-and-gid_t-using-AC_CHECK_SIZEOF.patch @@ -0,0 +1,35 @@ +From 2cb54158b80cdbd97ca3b36df83f9255e923ae3f Mon Sep 17 00:00:00 2001 +From: James Le Cuirot +Date: Sat, 23 Aug 2014 09:46:39 +0100 +Subject: [PATCH] Check size of uid_t and gid_t using AC_CHECK_SIZEOF + +This built-in check is simpler than the previous method and, most +importantly, works when cross-compiling. + +Signed-off-by: Serge Hallyn +--- + configure.in | 14 ++++---------- + 1 file changed, 4 insertions(+), 10 deletions(-) + +--- a/configure.in ++++ b/configure.in +@@ -334,16 +334,10 @@ if test "$enable_subids" != "no"; then + dnl + dnl FIXME: check if 32 bit UIDs/GIDs are supported by libc + dnl +- AC_RUN_IFELSE([AC_LANG_SOURCE([ +-#include +-int main(void) { +- uid_t u; +- gid_t g; +- return (sizeof u < 4) || (sizeof g < 4); +-} +- ])], [id32bit="yes"], [id32bit="no"]) ++ AC_CHECK_SIZEOF([uid_t],, [#include "sys/types.h"]) ++ AC_CHECK_SIZEOF([gid_t],, [#include "sys/types.h"]) + +- if test "x$id32bit" = "xyes"; then ++ if test "$ac_cv_sizeof_uid_t" -ge 4 && test "$ac_cv_sizeof_gid_t" -ge 4; then + AC_DEFINE(ENABLE_SUBIDS, 1, [Define to support the subordinate IDs.]) + enable_subids="yes" + else diff --git a/utils/shadow/patches/003-fix-disabling-subids.patch b/utils/shadow/patches/003-fix-disabling-subids.patch deleted file mode 100644 index bbc65c7d..00000000 --- a/utils/shadow/patches/003-fix-disabling-subids.patch +++ /dev/null @@ -1,32 +0,0 @@ ---- a/src/usermod.c -+++ b/src/usermod.c -@@ -1361,6 +1361,7 @@ static void process_flags (int argc, cha - exit (E_UID_IN_USE); - } - -+#ifdef ENABLE_SUBIDS - if ( (vflg || Vflg) - && !is_sub_uid) { - fprintf (stderr, -@@ -1376,6 +1377,7 @@ static void process_flags (int argc, cha - Prog, sub_gid_dbname (), "-w", "-W"); - exit (E_USAGE); - } -+#endif - } - - /* ---- a/src/Makefile.am -+++ b/src/Makefile.am -@@ -52,7 +52,10 @@ usbin_PROGRAMS = \ - noinst_PROGRAMS = id sulogin - - suidbins = su --suidubins = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap -+suidubins = chage chfn chsh expiry gpasswd newgrp passwd -+if ENABLE_SUBIDS -+ suidubins += newuidmap newgidmap -+endif - if ACCT_TOOLS_SETUID - suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod - endif diff --git a/utils/shadow/patches/004-fix-su-controoling-term.patch b/utils/shadow/patches/004-fix-su-controoling-term.patch index 4c130c73..2f7a670b 100644 --- a/utils/shadow/patches/004-fix-su-controoling-term.patch +++ b/utils/shadow/patches/004-fix-su-controoling-term.patch @@ -1,6 +1,6 @@ --- a/src/su.c +++ b/src/su.c -@@ -1090,8 +1090,12 @@ +@@ -1090,8 +1090,12 @@ int main (int argc, char **argv) if (fd >= 0) { err = ioctl (fd, TIOCNOTTY, (char *) 0);