You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: web/docs/c.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ With mingw-w64, there are three ways wildcard expansion can be configured:
11
11
12
12
1. mingw-w64 can be configured at build time to either enable or disable wildcard expansion by default via the `--enable-wildcard` configure flags. This can to be overridden on a per .exe basis by the user.
13
13
14
-
Currently wildcard expansion is enabled by default in MSYS2.
14
+
Wildcard expansion is disabled by default in MSYS2.
15
15
16
16
2. You can set `_dowildcard` in your source code to either `0` or `-1` to disable or enable wildcard expansion.
17
17
@@ -30,3 +30,10 @@ With mingw-w64, there are three ways wildcard expansion can be configured:
30
30
# To force-disable wildcard expansion
31
31
cc main.c $(cc -print-file-name=CRT_noglob.o)
32
32
```
33
+
34
+
### Changelog
35
+
36
+
* Starting with 2024-11-03 we have changed mingw-w64 to to disable wildcard
37
+
handling by default. You can still enable it on a per application basis as
38
+
described above. For more info on the change see [the news
Copy file name to clipboardExpand all lines: web/news.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,42 @@ summary: Important events happening.
5
5
6
6
This page lists important changes or issues affecting MSYS2 users. We also post them to [Twitter](https://twitter.com/msys2org) and [Mastodon](https://fosstodon.org/@msys2org), including some not-so-important things :)
7
7
8
+
### 2024-11-03 - Disabling mingw-w64 wildcard support by default
9
+
10
+
For historical reasons MSYS2 enabled wildcard support in mingw-w64 at build
11
+
time. This means that every built executable had wildcard support enabled by
12
+
default, unless it explicitly opted out. Wildcard support in this case means
13
+
that program arguments containing `?`and `*` can be expanded to one or more file
14
+
paths if the pattern happens to match paths of files on disk. Note that this
15
+
happens directly in the target program, not in a shell beforehand.
16
+
17
+
This expansion has several problems:
18
+
19
+
* Behave differently than MSVC built executables
20
+
* It's confusing to users when wildcard handling is accidentally triggered. For
21
+
example, passing a regex as an argument to a CLI tool that starts matching
22
+
random files, breaking the pattern.
23
+
* It may have security implications if arguments to executables are forwarded
24
+
from user-controlled input, in which case an argument could expand to a
25
+
different string depending on the files present on the filesystem.
26
+
27
+
Given all this, we have decided to disable wildcard handling by default. This
28
+
means that any package and executable that is built after this change will get
29
+
the new default behavior.
30
+
31
+
```console
32
+
$ python -c 'import sys; print(sys.argv)''*a.txt'# before
33
+
['-c', 'a.txt', 'aaaa.txt', 'bla.txt']
34
+
$ python -c 'import sys; print(sys.argv)''*a.txt'# after
35
+
['-c', '*a.txt']
36
+
```
37
+
38
+
Our hope/assumption is that this will not affect many users, as most will rely
39
+
on globbing at a higher level, be it bash, or build systems. If you experience
40
+
any problems, please let us know. See also [the
41
+
documentation](./docs/c.md#expanding-wildcard-arguments) on how to force
42
+
wildcard handling for your applications even after this change.
43
+
8
44
### 2024-09-23 - Starting to drop the CLANG32 environment
9
45
10
46
9 months ago we started to reduce the number of packages for the 32-bit
0 commit comments