From patchwork Tue Sep 5 20:25:13 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: 111737 Delivered-To: patch@linaro.org Received: by 10.140.94.166 with SMTP id g35csp3322683qge; Tue, 5 Sep 2017 13:25:52 -0700 (PDT) X-Received: by 10.99.109.65 with SMTP id i62mr5130701pgc.83.1504643152301; Tue, 05 Sep 2017 13:25:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504643152; cv=none; d=google.com; s=arc-20160816; b=MlCCeh9lKPz5Khdl8HEQC2JW6RANQUWndGrFRvceZnie8BS7SPyHf0LgfbTm7ibait D+AMuCbby6L9ZfGYlnEUwqHGzS/cj99eDc4mQB4A5Zz4Lf+dK8CzhpPW2f6zjH8r/WnV ZFvfMl/iz6Wt9pOErTrDQ9m6jPqUj3uarBpkeeZcz/K2J91Ug6auAB38CgZc3UEiH1BF GXWqWQdC0QyMM2cvtWpXqxGtu22F+TMSNLM9S8BA1ysyWthxMgpzyNok8TFbzXfZRhsy /fnDuLsC53a8QHopwPnXGpatO/uRux3fCIb5+M8shfW6uGTqYtKf3leLtyK4KFDi6+i2 Fe9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version: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=gHoVVRBzbJ4zClDWzJwTWa8BDFti/wjQURDl4mHUgUs=; b=lsYmX5wlHGZ81V30WUgCHQvkLWY/z1w+KLCfa+nfqRcCW4oAiJ6km9BgPvLR81+X9k E7FGOvDcea2bvNnIPxN2SuNB0IbeAC9FOx3gAZGopx4QHcNSSz6dJG+bWuitDEcscF5F 6i+1N5mpM6KZuf4pzHyDyZ4gBkSCcdj+GoCMajt1Tmv8781DVZzhOHo2SYmW2MZgQU6E JWxCeggxrUGST6G9+OVYxILXqa27VcJ8SDiDG5H5nlNPKNKzeITywJp0K9nsdHexCWYt kkZcKp05RYbcnU6P3uLSvx7hLYmFEPqBOirTzQ8duff4FRdW3xyDag/pPkCJefhu9qOV rVSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=QBqa4QNE; spf=pass (google.com: domain of libc-alpha-return-84207-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84207-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 n7si853901plk.305.2017.09.05.13.25.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 13:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-84207-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=QBqa4QNE; spf=pass (google.com: domain of libc-alpha-return-84207-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=libc-alpha-return-84207-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 :mime-version:content-type:content-transfer-encoding; q=dns; s= default; b=VtRlDsYEu75nqe9eWEzvbXW6rNuiAAvyPkEKKq6XSypW4N4vbD5tL JzDRgOlyD4kOqfKNNsEcKYwLixOeQYHPYdvgcojNlSxtqV1ygS47MnFgNpiwtvCX 1J5XZxgT64Qw4IjzTgU8VkDetWduKt04ruF/HTZ4VHpfEpdR2qbVRI= 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 :mime-version:content-type:content-transfer-encoding; s=default; bh=u9RJD+8k35HM0aOXhldgM+xRMUM=; b=QBqa4QNE8SvYmc6ME8xwssGmrkV1 N7t2Rb4rfLShBw8F4ZJj6YgcNdqWQ5JhOLG+Qvy/sOu/kzDROeQQ305PVJGjsrSX IBIGVjPzYc7NLRVMG8Fd+GZQC1TuLtX+ZWkyxfB7ZFHpAO4RMSiZDSUx+5R7Q054 OjEvNPixYGd9wnw= Received: (qmail 47873 invoked by alias); 5 Sep 2017 20:25:37 -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 47862 invoked by uid 89); 5 Sep 2017 20:25:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.4 required=5.0 tests=BAYES_00, 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-f174.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:mime-version :content-transfer-encoding; bh=gHoVVRBzbJ4zClDWzJwTWa8BDFti/wjQURDl4mHUgUs=; b=YBgmCIfOyAL+k1hFtPb5BQNEajmGEvODitktf0sr+5IXVj6zs/iFhj5KiECqfDkkSd X0y7N4vmlx52en8h2bUrgBppLym9cryVtbz6gbbY7lFRrweLMNnlIaqgwpikT8VDhqbo d3oN77ej4Or8MagUdeqELr+IMV3qpMkNJsiWxm5dSz5fMFgh7Es9KMyiXeXSR3WXyR9J X2TP8MLto/aiKOlRBzPXY832aIa0rOAKmHgPltVftPkVc+b/ff8CqKCTM1W3QNeuVsus WtTwqEZVDYScsJN6pQ7bcBA5DiKhjzxXSqf/vOj7VqxleY9eiGtEkuisRmtpsyP0l1/K x3gg== X-Gm-Message-State: AHPjjUhnVys+2GwJ0+ax1ZNfAiSBHfNfoeRgCcSIw73aZjUwMG/DYzgV c8zj0H90WZHUedXnzeLa7Q== X-Google-Smtp-Source: ADKCNb6LLTPUGfUwpP9B6X6/nTntVCehANBAjznA1Turkpaltbst2SJywWBlAB19dE1Cibt1aCDAdw== X-Received: by 10.55.176.1 with SMTP id z1mr482546qke.44.1504643129956; Tue, 05 Sep 2017 13:25:29 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Paul Eggert Subject: [PATCH 0/9] posix: glob fixes and refactor Date: Tue, 5 Sep 2017 17:25:13 -0300 Message-Id: <1504643122-14874-1-git-send-email-adhemerval.zanella@linaro.org> MIME-Version: 1.0 This patchset sync GLIBC glob with latest gnulib code (064df0b). Instead of dump a large patchset, I decided to split it since different commits fixes different GLIBC bugs: * Patch 1/9 sync with gnulib code b5ec983 and fixes a GLIBC specific code regarding DT_UNKNOWN, DT_DIR, and DT_LNK definition. Paul I think we should sync it back to gnulib. * Patch 2/9 sync with gnulib 2adc376c55194 and fixes BZ #19971. * Patch 3/9 sync with gnulib fd1daf4 and also fixes BZ #866. * Patch 4/9 sync with gnulib 3866ef6. It is related to scratch_buffer code. * Patch 5/9 sync with gnulib 5db9301. * Patch 6/9 sync with gnulib 064df0b and thus it fixes BZ #1062. * Patch 7/9 is a glob consolidation to avoid the multiple architecture implementations. * Patch 8/9 just refactor internal code to use an enumeration instead of numeric constants. * Patch 9/9 fixes BZ #10246. I think patches from 1 to 8 should be safe to push. Adhemerval Zanella (9): posix: Sync glob with gnulib [BZ #1062] posix: accept inode 0 is a valid inode number (BZ #19971) posix: Allow glob to match dangling symlinks [BZ #866] Sync scratch_buffer with gnulib posix: Fix getpwnam_r usage (BZ #1062) posix: fix glob bugs with long login names posix: Consolidate glob implementation posix: Use enum for __glob_pattern_type result posix: Fix glob with GLOB_NOCHECK returning modified patterns (BZ#10246) ChangeLog | 137 +++ include/scratch_buffer.h | 3 +- malloc/scratch_buffer_grow.c | 6 +- malloc/scratch_buffer_grow_preserve.c | 6 +- malloc/scratch_buffer_set_array_size.c | 6 +- posix/Makefile | 6 +- posix/bug-glob1.c | 88 -- posix/flexmember.h | 45 + posix/glob.c | 994 ++++++++------------- posix/glob64.c | 6 - posix/glob_internal.h | 65 ++ posix/glob_pattern_p.c | 33 + posix/globfree.c | 41 + posix/globfree64.c | 31 + posix/globtest.sh | 37 + posix/tst-glob_symlinks.c | 132 +++ sysdeps/gnu/glob64.c | 3 - sysdeps/unix/sysv/linux/Makefile | 2 +- sysdeps/unix/sysv/linux/alpha/glob.c | 4 - sysdeps/unix/sysv/linux/alpha/globfree.c | 37 + sysdeps/unix/sysv/linux/arm/glob64.c | 1 - sysdeps/unix/sysv/linux/glob.c | 28 + sysdeps/unix/sysv/linux/glob64.c | 51 ++ sysdeps/unix/sysv/linux/globfree.c | 30 + sysdeps/unix/sysv/linux/globfree64.c | 36 + sysdeps/unix/sysv/linux/i386/alphasort64.c | 2 +- sysdeps/unix/sysv/linux/i386/getdents64.c | 2 +- sysdeps/unix/sysv/linux/i386/glob64.c | 79 -- sysdeps/unix/sysv/linux/i386/readdir64.c | 2 +- sysdeps/unix/sysv/linux/i386/readdir64_r.c | 2 +- sysdeps/unix/sysv/linux/i386/versionsort64.c | 2 +- sysdeps/unix/sysv/linux/m68k/glob64.c | 1 - sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c | 1 - sysdeps/unix/sysv/linux/{i386 => }/olddirent.h | 0 sysdeps/unix/sysv/linux/oldglob.c | 43 + sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c | 1 - sysdeps/unix/sysv/linux/s390/s390-32/glob64.c | 2 + sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c | 1 - sysdeps/unix/sysv/linux/wordsize-64/glob64.c | 2 - sysdeps/unix/sysv/linux/x86_64/x32/glob.c | 1 - sysdeps/wordsize-64/glob64.c | 1 - sysdeps/wordsize-64/{glob.c => globfree.c} | 5 +- 42 files changed, 1139 insertions(+), 836 deletions(-) delete mode 100644 posix/bug-glob1.c create mode 100644 posix/flexmember.h create mode 100644 posix/glob_internal.h create mode 100644 posix/glob_pattern_p.c create mode 100644 posix/globfree.c create mode 100644 posix/globfree64.c create mode 100644 posix/tst-glob_symlinks.c create mode 100644 sysdeps/unix/sysv/linux/alpha/globfree.c delete mode 100644 sysdeps/unix/sysv/linux/arm/glob64.c create mode 100644 sysdeps/unix/sysv/linux/glob.c create mode 100644 sysdeps/unix/sysv/linux/glob64.c create mode 100644 sysdeps/unix/sysv/linux/globfree.c create mode 100644 sysdeps/unix/sysv/linux/globfree64.c delete mode 100644 sysdeps/unix/sysv/linux/i386/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/m68k/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/mips/mips64/n64/glob64.c rename sysdeps/unix/sysv/linux/{i386 => }/olddirent.h (100%) create mode 100644 sysdeps/unix/sysv/linux/oldglob.c delete mode 100644 sysdeps/unix/sysv/linux/powerpc/powerpc32/glob64.c create mode 100644 sysdeps/unix/sysv/linux/s390/s390-32/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/sparc/sparc32/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/wordsize-64/glob64.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/glob.c delete mode 100644 sysdeps/wordsize-64/glob64.c rename sysdeps/wordsize-64/{glob.c => globfree.c} (57%) -- 2.7.4