From patchwork Tue Sep 5 20:25:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 111738 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3322839qge; Tue, 5 Sep 2017 13:26:04 -0700 (PDT) X-Received: by 10.99.99.197 with SMTP id x188mr5119540pgb.298.1504643164409; Tue, 05 Sep 2017 13:26:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504643164; cv=none; d=google.com; s=arc-20160816; b=Sb/FIwMgG2Pl+vrBBGWS0h0v+EZJ5el0ENzxaOCoz92Lf0866hI5ct/UA2rqC9W25Y fqHThDtucxiKn0CaaVY3+4pEzFJ91E/pupqD8oF2YUNR5HFhrokP330z1Y8iofq5PuIx +E0eXuSl9zEV2ZqOeIR3L86IIRMp+poRnRPG/47d1TOYDgHIx30JZuM1N6ZT4WnBTsb1 sKTIPhOtoz1deTEWVqIuqexfzjN9Kn9fGnua7mdVeuMh9fw9AANgW31UgKTuHNfJoe/p dPbZVwfbftAliPfZE/RjaBQUNmrdOKthLBQrJ5kIahx+HtDShetViM/k8md/szXv4TmL yrHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :delivered-to:sender:list-help:list-post:list-archive:list-subscribe :list-unsubscribe:list-id:precedence:mailing-list:dkim-signature :domainkey-signature:arc-authentication-results; bh=z7npA0x/PK4YF+GT4MXLvKHyGIX/c5yWMkkCd1RHCrI=; b=pRfHwencPwuWU7L0EIVtVuf0Anz5a3/9KQ2Si/QIjI8ON7tKXfE2vjEWdzJS0hqoyp FKqvW50+6UP47bFhtpGe9UHIoBoyW5rXEeUeyfl01SeRZnEH0o9GaNvEvrZmS1vA6oBD 7HHaZqBaMXTXWBVmeB+7jvjjnAE5rL0jcICDbSgFSQkvERdeEOeR3OUb4ulzEycT3tYt 1kXRSBcCUtznaDPLw7Iu/Ly/2LIKuTVhbH7ECBO4Qenyn8hteIifwZcFIPog0aJp+iqA 1WDw2TOz+eM2dSSVGdht/rUrMKYmuM4J/J12SoDmFqMyxxXngdOZY/ACbsVhPPJqR4+a tFqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XnRYkMae; spf=pass (google.com: domain of libc-alpha-return-84208-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84208-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id m39si884093plg.303.2017.09.05.13.26.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 13:26:04 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-84208-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=XnRYkMae; spf=pass (google.com: domain of libc-alpha-return-84208-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84208-patch=linaro.org@sourceware.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=KmYARKYz3UkuhqyDhTtD35iDNUOUxja /5gWihmTLJYm+96d2rAoJPb/OxLPx+JP69zUFZbIcceFR1A07bw1YIJJAS9rzyN6 viE7F5TAiYpUwyU/3/Wq9lVUp/XX1W56H7vdO75Q2Z3Kazo0htE1qb0Xs+3BdSDI fy5M0X075cO4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id:in-reply-to :references; s=default; bh=JTSzOKEu+zXdlRRRoUDNzKwRp3c=; b=XnRYk MaeK3VKpDYx7WyeD+38okcUORAOUd27VohC4ubGyvyYclZ3+9IRGMhCUQWN/4+4i RWqH3Du+Dw+nJWKzVrMQ7AG4Wf4izmBSCWgxuWr+2G3gy/g7VAN3enoc3vMskAX6 yveoXh759gAeTrsNNOWvf7N0jzx7kz6yiCDUT4= Received: (qmail 48289 invoked by alias); 5 Sep 2017 20:25:42 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 48188 invoked by uid 89); 5 Sep 2017 20:25:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-qk0-f181.google.com 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=z7npA0x/PK4YF+GT4MXLvKHyGIX/c5yWMkkCd1RHCrI=; b=fRhg23ArCmd6MMy8Xn5bWWlRDRFwoCzZmrHjfGvbMi9Of6bM61tEUrpWEJWZ4xDaxo Kh0aWgDVi3g7lSTZ/nGNTp2tq5LSTZZqgf8JF5Y8q7EXpCSpKheywPw39AL8pReKKQ1s DXo78QH/L+ABeft8hiG6kn+pCP7oCv9WO6MGB3Q4CHFwUXfv0Rcn07Jj0bOXDA09bvBE q9Ito2/v5l/uI2riiGs2fc1rOdjYDCOohxZlh83GtXIB5oFrjx1GMYe7YuUHfERCO4cE OhtOSdyLmz0ripqtsR8vwG0HU1x4w+/AUtriJYNTGz2xfbWhqKGCQWCntfpKOrLHlybE jBDg== X-Gm-Message-State: AHPjjUidi5kcqygAcF+tB9W0jMR0uF3q9A2vo0JUz33j7MHID4QtMuYa sK4I3a2Ri4JJdjAbL6GD+Q== X-Google-Smtp-Source: AOwi7QCeqgtV0L+OwKpcFyevR/kt+rSM4KmUiqQo9ILC3fbGzcQ2cXq/NBLeFambSkjPwM/lvnJUNA== X-Received: by 10.233.244.5 with SMTP id y5mr430194qkl.162.1504643134537; Tue, 05 Sep 2017 13:25:34 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 2/9] posix: accept inode 0 is a valid inode number (BZ #19971) Date: Tue, 5 Sep 2017 17:25:15 -0300 Message-Id: <1504643122-14874-3-git-send-email-adhemerval.zanella@linaro.org> In-Reply-To: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> References: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> According to this kernel commit 2adc376c55194, d_ino 0 is a regular inode number on Linux (which also matches POSIX, as it does not treat the value as special). This patch makes glob accept is a valid inode number. This is also a sync with gnulib commit c8e57c1. Checked on x86_64-linux-gnu and on a build using build-many-glibcs.py for all major architectures. [BZ #1062] [BZ #19971] * posix/glob.c (struct readdir_result): Remove skip_entry member. (readdir_result_skip_entry, D_INO_TO_RESULT): Remove. All uses removed. --- ChangeLog | 6 ++++++ posix/glob.c | 21 --------------------- 2 files changed, 6 insertions(+), 21 deletions(-) -- 2.7.4 diff --git a/posix/glob.c b/posix/glob.c index e19aa6f..36d9e5f 100644 --- a/posix/glob.c +++ b/posix/glob.c @@ -114,9 +114,6 @@ struct readdir_result #if defined _DIRENT_HAVE_D_TYPE || defined HAVE_STRUCT_DIRENT_D_TYPE dirent_type type; #endif -#if defined _LIBC || defined D_INO_IN_DIRENT - bool skip_entry; -#endif }; /* Initialize and return type member of struct readdir_result. */ @@ -132,28 +129,12 @@ readdir_result_type (struct readdir_result d) #endif } -/* Initialize and return skip_entry member of struct readdir_result. */ -static bool -readdir_result_skip_entry (struct readdir_result d) -{ -/* Initializer for skip_entry. POSIX does not require that the d_ino - field be present, and some systems do not provide it. */ -#if defined _LIBC || defined D_INO_IN_DIRENT -# define D_INO_TO_RESULT(source) (source)->d_ino == 0, - return d.skip_entry; -#else -# define D_INO_TO_RESULT(source) - return false; -#endif -} - /* Construct an initializer for a struct readdir_result object from a struct dirent *. No copy of the name is made. */ #define READDIR_RESULT_INITIALIZER(source) \ { \ source->d_name, \ D_TYPE_TO_RESULT (source) \ - D_INO_TO_RESULT (source) \ } /* Call gl_readdir on STREAM. This macro can be overridden to reduce @@ -1543,8 +1524,6 @@ glob_in_dir (const char *pattern, const char *directory, int flags, } if (d.name == NULL) break; - if (readdir_result_skip_entry (d)) - continue; /* If we shall match only directories use the information provided by the dirent call if possible. */