From nobody Mon Jun  7 22:58:32 2021
X-Original-To: bugs@mlmmj.nyi.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1])
	by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 2607D532B4A
	for <bugs@mlmmj.nyi.freebsd.org>; Mon,  7 Jun 2021 22:58:32 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256
	 client-signature RSA-PSS (4096 bits) client-digest SHA256)
	(Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK))
	by mx1.freebsd.org (Postfix) with ESMTPS id 4FzTLc0N6cz4kHY
	for <bugs@FreeBSD.org>; Mon,  7 Jun 2021 22:58:32 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(Client did not present a certificate)
	by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E59971E17F
	for <bugs@FreeBSD.org>; Mon,  7 Jun 2021 22:58:31 +0000 (UTC)
	(envelope-from bugzilla-noreply@freebsd.org)
Received: from kenobi.freebsd.org ([127.0.1.5])
	by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 157MwVWJ048202
	for <bugs@FreeBSD.org>; Mon, 7 Jun 2021 22:58:31 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
Received: (from www@localhost)
	by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 157MwV7p048201
	for bugs@FreeBSD.org; Mon, 7 Jun 2021 22:58:31 GMT
	(envelope-from bugzilla-noreply@freebsd.org)
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
From: bugzilla-noreply@freebsd.org
To: bugs@FreeBSD.org
Subject: [Bug 256473] FreeBSD shells are case insensitive for character
 ranges
Date: Mon, 07 Jun 2021 22:58:32 +0000
X-Bugzilla-Reason: AssignedTo
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: Base System
X-Bugzilla-Component: bin
X-Bugzilla-Version: 12.2-STABLE
X-Bugzilla-Keywords: 
X-Bugzilla-Severity: Affects Some People
X-Bugzilla-Who: jwb@freebsd.org
X-Bugzilla-Status: New
X-Bugzilla-Resolution: 
X-Bugzilla-Priority: ---
X-Bugzilla-Assigned-To: bugs@FreeBSD.org
X-Bugzilla-Flags: 
X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform
 op_sys bug_status bug_severity priority component assigned_to reporter
Message-ID: <bug-256473-227@https.bugs.freebsd.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/
Auto-Submitted: auto-generated
List-Id: Bug reports <freebsd-bugs.freebsd.org>
List-Archive: https://lists.freebsd.org/archives/freebsd-bugs
List-Help: <mailto:freebsd-bugs+help@freebsd.org>
List-Post: <mailto:freebsd-bugs@freebsd.org>
List-Subscribe: <mailto:freebsd-bugs+subscribe@freebsd.org>
List-Unsubscribe: <mailto:freebsd-bugs+unsubscribe@freebsd.org>
Sender: owner-freebsd-bugs@freebsd.org
MIME-Version: 1.0
X-ThisMailContainsUnwantedMimeParts: N

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256473

            Bug ID: 256473
           Summary: FreeBSD shells are case insensitive for character
                    ranges
           Product: Base System
           Version: 12.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: jwb@freebsd.org

When running /bin/tcsh or /bin/sh, character ranges of either upper case or
lower case also expand to files with the other case:

FreeBSD moray.acadix  bacon ~ 1017: ls -d [A-Z]*
Biostar/             Grad-school-biosci/  Save/
Books/               igv/                 scripts/
Coral@               Moto/                VirtualBox VMs/
Data/                ncbi/                wpa_supplicant.conf
Desktop/             Ports/
Documents/           Prog/
FreeBSD moray.acadix  bacon ~ 1018: bash

Using bash from ports, I do not see this behavior:

[bacon@moray ~]$ ls -d [A-Z]*
Biostar            Data               Grad-school-biosci Prog
Books              Desktop            Moto               Save
Coral              Documents          Ports              VirtualBox VMs

Also checked tcsh on a CentOS system and did not see this behavior.

Lastly I do NOT see this behavior from glob(3), so it seems to be limited to
shells in the FreeBSD base.

#include <stdio.h>
#include <sysexits.h>
#include <glob.h>
#include <unistd.h>

int     main(int argc,char *argv[])

{
    glob_t g;

    g.gl_offs =3D 2;
    glob("[A-Z]*", GLOB_DOOFFS, NULL, &g);
    g.gl_pathv[0] =3D "ls";
    g.gl_pathv[1] =3D "-d";
    execvp("ls", g.gl_pathv);

    return EX_OK;
}

--=20
You are receiving this mail because:
You are the assignee for the bug.=