Path: csiph.com!goblin1!goblin.stu.neva.ru!usenet.stanford.edu!not-for-mail From: Mickael KENIKSSI Newsgroups: gnu.bash.bug Subject: Filename Expansion bug Date: Wed, 8 Jan 2020 08:34:02 +0100 Lines: 28 Approved: bug-bash@gnu.org Message-ID: References: NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: usenet.stanford.edu 1578475727 5035 209.51.188.17 (8 Jan 2020 09:28:47 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=9li80TBt4EsTC+6nIUokqo4YufDlRQ67/OAzwxUf1FI=; b=ObMFdvr7Zc11/KthIKPpFJH9RvkSCTfRofLKsbcmgNZ3KaxdGBEVdNrZfgFgPdK5C7 Tr1OVQ1cJjYje8kJ0epFNgzTtqjxPCJeZ5FEttM23Ij4uy05hIy/m1tOuS/izMbKUseu tDImWdhAUzqWh4qnHMHIMqnnDEHGvpdlkSB4rxQ0rdX5uqdGcwFzB3RDI6IUUFKAyCz3 6LQhBcPDSek1fTWEeEOYQtkOMco4zKO8v42E16nx/YRY/SgB19BZ/MlG9GFdWcCfASME sKhhFj08fgRy6L85jNdbcZ8S7A01JA/6LT1CWvqlycBvaNRBj0AU2jAJnWXQfq9RH7Lr 7zjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=9li80TBt4EsTC+6nIUokqo4YufDlRQ67/OAzwxUf1FI=; b=ibtBoUmqaUHAxG1H1/EbCVny9jvCFmzBHCHDyw/4KkFAnwHxxERpM7xReKJGXpNGwL XDtPFm4V0pG/nKxtsIZwHPPy903KaaDZZUePe+cZFDOhY1S7C+hnFOqOHdQrz2Ue8WTP OPHSQ+JJQSgWC9+pBHMLZjba8HB+4zvsJYzE10L6vPxwgKIe6FFfAxnuM5YPcFS5XYNB T9sFzZnHcUPuvdfHX9YJPISwMUCVwf4xEzVaXyAei85+KNdV3+aOM0pjJ8cUvdMyzmU+ 5Mq2Al7V6DKUfpYF8YrtcqmiJuP48z13ZqJBkLfSDaSMEYaexv5IBLhj4Q9JVQkiXJdu aGuw== X-Gm-Message-State: APjAAAX+Fnbsav1l0bmPWGhlMQZme4gtabWbVZsqEKXGEJKPYm/bLxJn 0wSVkrnbNb130KllSmi6QBrbOXEk58uBKPY6lxWwa3nV X-Google-Smtp-Source: APXvYqz4vSlpVC9jmV9Khn8gMFcmukQsMzEcVFxdNAo0fNc5GUoOPTfdaw7GFi1IDti4uFcedI7CYeS0MaTb/68byTo= X-Received: by 2002:a2e:9999:: with SMTP id w25mr2132803lji.142.1578468879590; Tue, 07 Jan 2020 23:34:39 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::22d X-Mailman-Approved-At: Wed, 08 Jan 2020 04:28:45 -0500 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: Xref: csiph.com gnu.bash.bug:15791 Hello, I found a bug regarding how pathnames are processed during filename expansion. The result for non-normalized path-patterns may get mangled in a such a way that it becomes inconsistent and unpredictable, making it useless for string comparison or any kind of string manipulation where having it in the exact same form as the pattern is required. How to reproduce : $ mkdir -p a/b/c d/e/f g/h/e; printf '%s\n' .////*//*///////* > .////a/b/c > .////d/e/f > .////g/h/e > This is correct from a filesystem perspective but not from a string perspective, where you'd need each of the computed path as-is: .////a//b///////c > .////d//e///////f > .////g//h///////i > This occurs on all versions >=3D Bash 3.2. Best regards, Micka=C3=ABl