From patchwork Sun Mar 25 08:06:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herbert Xu X-Patchwork-Id: 10306501 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7E00860385 for ; Sun, 25 Mar 2018 08:06:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63BD129108 for ; Sun, 25 Mar 2018 08:06:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 556D129380; Sun, 25 Mar 2018 08:06:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9857D29108 for ; Sun, 25 Mar 2018 08:06:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750838AbeCYIGS (ORCPT ); Sun, 25 Mar 2018 04:06:18 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:49622 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbeCYIGQ (ORCPT ); Sun, 25 Mar 2018 04:06:16 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtp (Exim 4.84_2 #2 (Debian)) id 1f00fL-0007ww-Tf; Sun, 25 Mar 2018 16:06:11 +0800 Received: from herbert by gondobar with local (Exim 4.84_2) (envelope-from ) id 1f00fJ-0001QH-Oo; Sun, 25 Mar 2018 16:06:09 +0800 Date: Sun, 25 Mar 2018 16:06:09 +0800 From: Herbert Xu To: DASH Mailing List Subject: expand: Fix glibc glob(3) support Message-ID: <20180325080609.GA5452@gondor.apana.org.au> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) Sender: dash-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dash@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's been a while since we disabled glob(3) support by default. It appears to be working now, however, we have to change our code to remove a workaround that now actually prevents it from working. In particular, we no longer use GLOB_NOMAGIC or test GLOB_MAGCHAR. Signed-off-by: Herbert Xu diff --git a/src/expand.c b/src/expand.c index 705fef7..6d2a94a 100644 --- a/src/expand.c +++ b/src/expand.c @@ -1183,19 +1183,16 @@ expandmeta(str, flag) goto nometa; INTOFF; p = preglob(str->text, RMESCAPE_ALLOC | RMESCAPE_HEAP); - i = glob(p, GLOB_NOMAGIC, 0, &pglob); + i = glob(p, 0, 0, &pglob); if (p != str->text) ckfree(p); switch (i) { case 0: - if (!(pglob.gl_flags & GLOB_MAGCHAR)) - goto nometa2; addglob(&pglob); globfree(&pglob); INTON; break; case GLOB_NOMATCH: -nometa2: globfree(&pglob); INTON; nometa: