From patchwork Wed Nov 25 17:54:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Champetier X-Patchwork-Id: 548678 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 C187614017E for ; Thu, 26 Nov 2015 04:55:56 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Saets7Mr; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F29EF28BDBF; Wed, 25 Nov 2015 18:55:19 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id D632528A6D7 for ; Wed, 25 Nov 2015 18:55:00 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 25 Nov 2015 18:55:00 +0100 (CET) Received: by wmvv187 with SMTP id v187so268687437wmv.1 for ; Wed, 25 Nov 2015 09:55:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hF7rxiA0gUu5lo0rCXukXJoU+TlzRyRov7/gE1hU8yQ=; b=Saets7MrT+LLVpu4Te4wNmmaVw8eTKyJwqktOow8y6NfWhnmGQeEUXGFXegFyaBIBB JOQ6pDajjOXzSOttVtnI/QFJ0pcEkTHuvDJGVvVLk4K9jfBC0vV7xR/MWXDGsfCgtPzH QvlYMcbrxc+6ycw3VZfIBM9hCiy1yVygJZJH5Yy0dDynip51uo9CoT7AK6hUdXbnUqLV 3piR0b8A0OxrTDemdFQ+VszbPXY9JQwT3VJJzyLAYuT9OqA0WvgBVYqBTGCHmKEFFYUE 6ERQpdEJbCV/Q0205kRIdioxiqic+OPw9EUkrkcpD8MNQLCcbZahSmPqAZOJbZLaZpQ3 OiRA== X-Received: by 10.28.218.75 with SMTP id r72mr5671700wmg.59.1448474100141; Wed, 25 Nov 2015 09:55:00 -0800 (PST) Received: from ubuntu1404.lxcnattst (ns623510.ovh.net. [5.135.134.9]) by smtp.gmail.com with ESMTPSA id cv3sm24180221wjc.20.2015.11.25.09.54.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 09:54:59 -0800 (PST) From: Etienne CHAMPETIER To: OpenWrt Development List Date: Wed, 25 Nov 2015 17:54:34 +0000 Message-Id: <1448474090-30280-2-git-send-email-champetier.etienne@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448474090-30280-1-git-send-email-champetier.etienne@gmail.com> References: <1448474090-30280-1-git-send-email-champetier.etienne@gmail.com> Subject: [OpenWrt-Devel] [PATCH procd v2 01/17] ujail: don't add non existant library_path X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Signed-off-by: Etienne CHAMPETIER --- jail/elf.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jail/elf.c b/jail/elf.c index cbb3051..34a5aca 100644 --- a/jail/elf.c +++ b/jail/elf.c @@ -33,6 +33,10 @@ static LIST_HEAD(library_paths); void alloc_library_path(const char *path) { + struct stat s; + if (stat(path, &s)) + return; + struct library_path *p; char *_path; @@ -343,10 +347,6 @@ void load_ldso_conf(const char *conf) load_ldso_conf(gl.gl_pathv[i]); globfree(&gl); } else { - struct stat s; - - if (stat(line, &s)) - continue; alloc_library_path(line); } }