From patchwork Wed Nov 25 17:54:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Etienne Champetier X-Patchwork-Id: 548692 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 115741402BB for ; Thu, 26 Nov 2015 05:05:06 +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=ApqDL/Zj; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 38EB728C170; Wed, 25 Nov 2015 18:57:22 +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=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id F392728BDA0 for ; Wed, 25 Nov 2015 18:55:33 +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:11 +0100 (CET) Received: by wmww144 with SMTP id w144so79589320wmw.0 for ; Wed, 25 Nov 2015 09:55:11 -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=H3vVCCQZ8QUGRzsSK0kGUtBCiHEAbSG8ovoom1mYqak=; b=ApqDL/ZjZ9zv6TnI/qQQl5nJe4ndVQuiUSpR35taIiuqhnnWO/qoeGE/BpDGmcCAWN 1H+FJEj8boMdhzzJmaU15uU70t9640oW2C9ISmgyfdVl4vMIgcJahImLkmoy8bFhzUcY zk++cuJZiIzWZDsXbf/2EKo6wpfl+fGrmhUfoG+Exb31OrtTzoCElG+t4F4JMQ1pg5HZ wJM/Iahg/hDVpvLd5KQ6V0dnLvhxVrOtUTL4Q44Tr/wg7YgkEtu4IdJN3KbrUJUvD1Cj C/PI+IhEeLrdVh9cslmLWjB2/+q5JAuEc5SNc2cP/jPuEWYccIGnUiHFwFBvfr3md1Qp R6hg== X-Received: by 10.194.92.229 with SMTP id cp5mr44582422wjb.163.1448474110975; Wed, 25 Nov 2015 09:55:10 -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.55.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Nov 2015 09:55:10 -0800 (PST) From: Etienne CHAMPETIER To: OpenWrt Development List Date: Wed, 25 Nov 2015 17:54:46 +0000 Message-Id: <1448474090-30280-14-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 13/17] ujail: remove some debug/dev hack 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" this code is present since first ujail commit (dfcfcca7) Signed-off-by: Etienne CHAMPETIER --- jail/elf.c | 7 +------ jail/jail.c | 8 ++------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/jail/elf.c b/jail/elf.c index c3a392c..7c52880 100644 --- a/jail/elf.c +++ b/jail/elf.c @@ -100,17 +100,12 @@ const char* find_lib(const char *file) { struct library *l; static char path[PATH_MAX]; - const char *p; l = avl_find_element(&libraries, file, l, avl); if (!l) return NULL; - p = l->path; - if (strstr(p, "local")) - p = "/lib"; - - snprintf(path, sizeof(path), "%s/%s", p, file); + snprintf(path, sizeof(path), "%s/%s", l->path, file); return path; } diff --git a/jail/jail.c b/jail/jail.c index b7e6946..f62d121 100644 --- a/jail/jail.c +++ b/jail/jail.c @@ -92,21 +92,17 @@ static int mkdir_p(char *dir, mode_t mask) static int mount_bind(const char *root, const char *path, const char *name, int readonly, int error) { - const char *p = path; struct stat s; char old[PATH_MAX]; char new[PATH_MAX]; int fd; - if (strstr(p, "local")) - p = "/lib"; - snprintf(old, sizeof(old), "%s/%s", path, name); - snprintf(new, sizeof(new), "%s%s", root, p); + snprintf(new, sizeof(new), "%s%s", root, path); mkdir_p(new, 0755); - snprintf(new, sizeof(new), "%s%s/%s", root, p, name); + snprintf(new, sizeof(new), "%s%s/%s", root, path, name); if (stat(old, &s)) { ERROR("%s does not exist\n", old);