From patchwork Mon Aug 24 12:41:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Thiery X-Patchwork-Id: 1350357 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=doczVDgJ; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BZsFy592hz9sT6 for ; Mon, 24 Aug 2020 22:42:14 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D4C528615E; Mon, 24 Aug 2020 12:42:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cml6qz0xj-Pw; Mon, 24 Aug 2020 12:42:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2129485FBA; Mon, 24 Aug 2020 12:42:08 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id ED2391BF3AB for ; Mon, 24 Aug 2020 12:42:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E420688007 for ; Mon, 24 Aug 2020 12:42:06 +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 uOIYrODvAg14 for ; Mon, 24 Aug 2020 12:42:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by hemlock.osuosl.org (Postfix) with ESMTPS id 9358287E9B for ; Mon, 24 Aug 2020 12:42:05 +0000 (UTC) Received: by mail-wr1-f52.google.com with SMTP id a15so8522285wrh.10 for ; Mon, 24 Aug 2020 05:42:05 -0700 (PDT) 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=xr6gaRu4O27ipTK18SAkjkVTWtpoCJZily6kP928g28=; b=doczVDgJDhnXi5S0SqzWrEinwjj6nFKNw/jSSUpwB3V2zLNKFAofGxTNulDzQzf+Bx IQNpvArOhSu4vNI+miPFo3lVSuzEZvMo0dJdpomClMzCYJnKyh2zIr5Zr8HDFwDTceVt PhyENrHuJALli4CzB/sgO1LgpPexgdfOwIzMjCGzq9Io6ucMLqQ21vvGgp3hmztJWs9z msr1nY1dPNmQJJE5fCtstnyG/3p3YoVP9cuDp5vNz15Uavc8q60DpndjEj0X1MFYH87N owqGeWniK69GypUDaIHkd9p4r1E6crK6ksan+EBNQZmjt0Hk4SOIgLheGrr5utyVUYy7 SW3A== 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=xr6gaRu4O27ipTK18SAkjkVTWtpoCJZily6kP928g28=; b=r7oz5mqyPFtePhWvOGOSa+gbj6mfTBUNBO7Z7kKbHHPmqTj74qiaPWaYqCCqGxjCqU fJP4576yZqA9wlzlZ2QmjcBiPRFWSfSPj6yNguKFiRx7SUUl8J7cUkcFOWvwEOgXx2gb a/X8VGBbOxP/C5BkMByq4v5yWgTGT1Qo4AEtfp/KDRbI4m7OLYZipuuajPK4MQa3k/Uw rjnUyEwCenMU5W7jLw9yqpZLOFgdjiWzNC6mnDME6bYR0whsbixf35hOTnsEb4oF2vR1 bVjVSPnTWbHFXJwQTJAGMXpgwbsz0dcBAjvk8i6T2np1mhYGp2HTtHRYgBBHofNuJJJn pqiQ== X-Gm-Message-State: AOAM5315uWtn+C44GApef8ketLNaGEaE5eSAd+Hq8WG1U+tEfv7v/+Yi WIxTsnHkaTyTS7Tb80rEUZwWiMDuZb4= X-Google-Smtp-Source: ABdhPJwyTDH0ygUwDAd75SckqSrfLpvmHH9WHvjQLLSBnnD3vDqIu+LIG1f96QT5hJmLoRlAbffMMg== X-Received: by 2002:adf:91e1:: with SMTP id 88mr5629927wri.364.1598272923537; Mon, 24 Aug 2020 05:42:03 -0700 (PDT) Received: from hthiery01.sab.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id b8sm2100441wrx.76.2020.08.24.05.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2020 05:42:03 -0700 (PDT) From: Heiko Thiery To: buildroot@buildroot.org Date: Mon, 24 Aug 2020 14:41:47 +0200 Message-Id: <20200824124147.23051-1-heiko.thiery@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/netopeer2: add patch to solve issue with empty group name X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthew Weber , Heiko Thiery , Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" When building on a host that has no name specified for the used group in /etc/group the script in install step will fail due to missing group name. CMake Error at CMakeLists.txt:80 (message): Learning server module group failed: id: cannot find name for group ID 8000 The patch was taken from upstream and modified manually because of merge conflicts. Fixes: http://autobuild.buildroot.net/results/f197ca1def9dc1292e1e784757f2da9d95484431/ Signed-off-by: Heiko Thiery Cc: Fabrice Fontaine Cc: Matthew Weber Reviewed-by: Matthew Weber --- ...support-using-current-user-for-SR-mo.patch | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 package/netopeer2/0003-scripts-FEATURE-support-using-current-user-for-SR-mo.patch diff --git a/package/netopeer2/0003-scripts-FEATURE-support-using-current-user-for-SR-mo.patch b/package/netopeer2/0003-scripts-FEATURE-support-using-current-user-for-SR-mo.patch new file mode 100644 index 0000000000..45257b2ff4 --- /dev/null +++ b/package/netopeer2/0003-scripts-FEATURE-support-using-current-user-for-SR-mo.patch @@ -0,0 +1,98 @@ +From 36ee1f33bceb0c2a7899e28d75c0d05408b561f1 Mon Sep 17 00:00:00 2001 +From: Michal Vasko +Date: Mon, 24 Aug 2020 13:47:40 +0200 +Subject: [PATCH] scripts FEATURE support using current user for SR modules + +Mostly for special cases user/group configuration +when the user/group cannot be retrieved normally. + +Fixes #701 + +Signed-off-by: Heiko Thiery +[patch taken from upstream: +https://github.com/CESNET/netopeer2/commit/12a82701e10651fbdedb1524b27edf3bb2377488] +Signed-off-by: Heiko Thiery +--- + CMakeLists.txt | 10 +++++----- + scripts/setup.sh | 23 +++++++++++++++++++---- + 2 files changed, 24 insertions(+), 9 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2d4175e..95e7e61 100755 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -68,19 +68,19 @@ if(NOT MODULES_OWNER) + OUTPUT_VARIABLE MODULES_OWNER OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE ERROR_STR OUTPUT_STRIP_TRAILING_WHITESPACE) + if(RET) +- message(FATAL_ERROR "Learning server module user failed: ${ERROR_STR}") ++ message(WARNING "Learning server module user failed (${ERROR_STR}), the current user will be used.") + endif() + endif() +-set(MODULES_OWNER "${MODULES_OWNER}" CACHE STRING "System user that will become the owner of server modules") +-if(NOT MODULES_GROUP) ++set(MODULES_OWNER "${MODULES_OWNER}" CACHE STRING "System user that will become the owner of server modules, empty means the current user") ++if(NOT MODULES_GROUP AND MODULES_OWNER) + execute_process(COMMAND id -gn ${MODULES_OWNER} RESULT_VARIABLE RET + OUTPUT_VARIABLE MODULES_GROUP OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_VARIABLE ERROR_STR OUTPUT_STRIP_TRAILING_WHITESPACE) + if(RET) +- message(FATAL_ERROR "Learning server module group failed: ${ERROR_STR}") ++ message(WARNING "Learning server module group failed (${ERROR_STR}), the current user group will be used.") + endif() + endif() +-set(MODULES_GROUP "${MODULES_GROUP}" CACHE STRING "System group that the server modules will belong to") ++set(MODULES_GROUP "${MODULES_GROUP}" CACHE STRING "System group that the server modules will belong to, empty means the current user group") + + # set prefix for the PID file + if(NOT PIDFILE_PREFIX) +diff --git a/scripts/setup.sh b/scripts/setup.sh +index 7175bc4..b5d1406 100755 +--- a/scripts/setup.sh ++++ b/scripts/setup.sh +@@ -1,7 +1,8 @@ + #!/bin/bash + +-# env variables NP2_MODULE_DIR, NP2_MODULE_PERMS, NP2_MODULE_OWNER, NP2_MODULE_GROUP must be defined when executing this script! +-if [ -z "$NP2_MODULE_DIR" -o -z "$NP2_MODULE_PERMS" -o -z "$NP2_MODULE_OWNER" -o -z "$NP2_MODULE_GROUP" ]; then ++# env variables NP2_MODULE_DIR, NP2_MODULE_PERMS must be defined and NP2_MODULE_OWNER, NP2_MODULE_GROUP will be used if ++# defined when executing this script! ++if [ -z "$NP2_MODULE_DIR" -o -z "$NP2_MODULE_PERMS" ]; then + echo "Required environment variables not defined!" + exit 1 + fi +@@ -33,7 +34,14 @@ MODULES=( + + # functions + INSTALL_MODULE() { +- $SYSREPOCTL -a -i $MODDIR/$1 -s $MODDIR -p $PERMS -o $OWNER -g $GROUP -v2 ++ CMD="'$SYSREPOCTL' -a -i $MODDIR/$1 -s '$MODDIR' -p '$PERMS' -v2" ++ if [ ! -z ${OWNER} ]; then ++ CMD="$CMD -o '$OWNER'" ++ fi ++ if [ ! -z ${GROUP} ]; then ++ CMD="$CMD -g '$GROUP'" ++ fi ++ eval $CMD + local rc=$? + if [ $rc -ne 0 ]; then + exit $rc +@@ -41,7 +49,14 @@ INSTALL_MODULE() { + } + + UPDATE_MODULE() { +- $SYSREPOCTL -a -U $MODDIR/$1 -s $MODDIR -p $PERMS -o $OWNER -g $GROUP -v2 ++ CMD="'$SYSREPOCTL' -a -U $MODDIR/$1 -s '$MODDIR' -p '$PERMS' -v2" ++ if [ ! -z ${OWNER} ]; then ++ CMD="$CMD -o '$OWNER'" ++ fi ++ if [ ! -z ${GROUP} ]; then ++ CMD="$CMD -g '$GROUP'" ++ fi ++ eval $CMD + local rc=$? + if [ $rc -ne 0 ]; then + exit $rc +-- +2.20.1 +