From patchwork Sat Jul 15 19:44:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 788963 X-Patchwork-Delegate: f.fainelli@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3x90QQ4LdHz9s5L for ; Sun, 16 Jul 2017 05:45:18 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="bCbWd3uR"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gP1SwWBQ"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Subject:References: In-Reply-To:Message-Id:Date:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jG/nJJc2Q4lDXkY+7HBBXGHcKW2pn/x8knax1S63CHo=; b=bCbWd3uRgYJ948 iLC1+sAgFNb9zZV1bwdmuZ+49sjKJMCZaDoBHSRj6Tb1uhEhBZ89h3StO3LfsQYqmALciCAtEI5yS VSZtjsWX0kC8hUKaGV0/jNAPozsAbkhXkktNZzdtRX2QhkJOa+QrqLF30X3NJ6yjGNtoSn6KBuXMZ 93OSBBK92B1z0Lc/qsmf+ZFtBZTAr4M+gvptB5qbxTtFa5w4byMkM6eF0YwxNrw2SJTFoZm8VhbRJ nRUz4+l8u6aef0NDOi4b/b8gZY8I002LAcxhi5jLXHd/N33VvaDhX4ta3g+8535ZU8cJg/I4eViSr Mzce9yQfMecIf0MD8pVA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dWT00-0004Vz-Ej; Sat, 15 Jul 2017 19:45:08 +0000 Received: from mail-oi0-x244.google.com ([2607:f8b0:4003:c06::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dWSzn-00045F-0v for lede-dev@lists.infradead.org; Sat, 15 Jul 2017 19:44:56 +0000 Received: by mail-oi0-x244.google.com with SMTP id f134so13853000oig.0 for ; Sat, 15 Jul 2017 12:44:33 -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:in-reply-to:references; bh=fJogf1zMA4XSupwCYkLgU+CWb2hI440VgNlGVVOhDDw=; b=gP1SwWBQZe/kSBc6eTAAi7xsqHatOL3EpaFYweoYs2hDCIIEyfMfaqi25/RGu2PTk2 gJLJvO5RoF5Bp+Bi3geFBYj9c9OMpiOHacX+sxHsOjVj/rByff5TgBFLskDsumKPbCNT g9DxzDJSWMNyucmup3TqyCPZnf9D9nfGpow2FYVMixOVBSP9H5mleftykJfQn4cvD+hZ DahTlo0ajXMz2ZGrxgkDD3R8heb8DzXbaxTi6zbxBhYNWCEyuRhDVTu09cjaKzlOsecq to4F25GsoXwkQucWRc3i/+c9QtcPEsWzjOUYymmVMAve9iA242+LgtuODThEYSiPasby AzLQ== 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:in-reply-to :references; bh=fJogf1zMA4XSupwCYkLgU+CWb2hI440VgNlGVVOhDDw=; b=EDaSpOf0v2SqPn612m0Sz1AHX5ysAff21BtGG3mpxWwBqva0t6DxJS3+xJzfX8VrfO yyhta19qpDtWvfSCarZV2V5d3tUl1/wY/jRwIiq9XAHplJ+eB6lmHH0tJQfc97hqmlhS jYhunFHP16XPs/VfR4tsgUWO9VyBaU1bynLqKXmlEgsjo3t8T5MQz/MnHsqWH3WX760V B2c7Vo6729r9RcQ0hXg98u4qoTgCIZ82nS1jqYkMlsxrAaG4Hb2PtofozvFnh09/HuNm 9lYw10TNPgGMCdQcUtr/Ry2Q0IWQrpxU+1K7lznodvFb96v5yHNbptGp04ghVe7a+d+l nRDw== X-Gm-Message-State: AIVw1135jQ+E8IDvByrUujbfcpJk6srsnZ1SmTuTLMxVs5ytg8el0nZJ MIV/vFUOnyXZUx+ybdo= X-Received: by 10.202.95.5 with SMTP id t5mr8076579oib.161.1500147873132; Sat, 15 Jul 2017 12:44:33 -0700 (PDT) Received: from cox.net ([2001:470:d:73f:8869:d13:bc8a:d969]) by smtp.gmail.com with ESMTPSA id g3sm15244785oif.21.2017.07.15.12.44.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Jul 2017 12:44:32 -0700 (PDT) From: Florian Fainelli To: lede-dev@lists.infradead.org Date: Sat, 15 Jul 2017 12:44:24 -0700 Message-Id: <20170715194424.6494-2-f.fainelli@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170715194424.6494-1-f.fainelli@gmail.com> References: <20170715194424.6494-1-f.fainelli@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170715_124455_113448_F8A1ECBC X-CRM114-Status: UNSURE ( 8.55 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:4003:c06:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (f.fainelli[at]gmail.com) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain Subject: [LEDE-DEV] [PATCH procd 2/2] upgraded: Check chroot() return value X-BeenThere: lede-dev@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Florian Fainelli , mschiffer@universe-factory.net, john@phrozen.org MIME-Version: 1.0 Sender: "Lede-dev" Errors-To: lede-dev-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Check the chroot() return value, fixes unused return value warnings/errors: procd-2017-06-22-e5e99c46/upgraded/upgraded.c:78:8: error: ignoring return value of 'chroot', declared with attribute warn_unused_result [-Werror=unused-result] chroot("."); Fixes: 056d8ddda8d5 ("upgraded: link dynamically, chroot during exec") Signed-off-by: Florian Fainelli Reviewed-by: Matthias Schiffer --- upgraded/upgraded.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/upgraded/upgraded.c b/upgraded/upgraded.c index 09c623cf804b..220da7903f92 100644 --- a/upgraded/upgraded.c +++ b/upgraded/upgraded.c @@ -78,7 +78,10 @@ int main(int argc, char **argv) return 1; } - chroot("."); + if (chroot(".") < 0) { + fprintf(stderr, "failed to chroot: %s\n", strerror(errno)); + return 1; + } if (fchdir(fd) == -1) { fprintf(stderr, "failed to chdir to prefix directory: %s\n", strerror(errno));