From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9550D1382AC for ; Mon, 20 Jun 2016 03:22:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 82529E0A70; Mon, 20 Jun 2016 03:22:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2BACAE0A70 for ; Mon, 20 Jun 2016 03:22:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D9DA340862 for ; Mon, 20 Jun 2016 03:22:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id E97352418 for ; Mon, 20 Jun 2016 03:22:11 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1466392780.a17419af271edc0edabe79cb6c9616fafcf15bfd.vapier@gentoo> Subject: [gentoo-commits] proj/pax-utils:master commit in: / X-VCS-Repository: proj/pax-utils X-VCS-Files: scanelf.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: a17419af271edc0edabe79cb6c9616fafcf15bfd X-VCS-Branch: master Date: Mon, 20 Jun 2016 03:22:11 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 1127482e-d441-4176-bc2c-304d931a16aa X-Archives-Hash: 1333f33d1bfc4237d7979b5dfac046f3 commit: a17419af271edc0edabe79cb6c9616fafcf15bfd Author: Mike Frysinger gentoo org> AuthorDate: Mon Jun 20 03:19:40 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Jun 20 03:19:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/pax-utils.git/commit/?id=a17419af scanelf: avoid leaking root_fd when multiple --root args are passed scanelf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scanelf.c b/scanelf.c index 42fe4c5..3f33d89 100644 --- a/scanelf.c +++ b/scanelf.c @@ -2350,6 +2350,8 @@ static int parseargs(int argc, char *argv[]) case 'I': show_osabi = 1; break; case 'Y': show_eabi = 1; break; case 128: + if (root_fd != AT_FDCWD) + close(root_fd); root_fd = open(optarg, O_RDONLY|O_CLOEXEC); if (root_fd == -1) err("Could not open root: %s", optarg);