4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-23 17:19:33 +08:00
Corinna Vinschen 7e7d471644 Cygwin: introduce isabspath_strict macro
isabspath handles a path "X:", without trailing slash or backslash,
as absolute path.  This breaks some scenarios with relative paths
starting with "X:".  For instance, fstatat will mishandle a call
with valid dirfd and "c:" as path.

The reason is that gen_full_path_at() will check for isabspath("C:")
which returns true.  So the path will be used verbatim in fstatat,
rather than being converted to a path "<dirfd-path>/c:".

So, introduce isabspath_strict, which returns true for paths starting
with "X:" only if the next char is actually a slash or backslash.
Use it from gen_full_path_at().

This still fixes only half the problem.  The right thing would have been
to disallow using DOS paths in the first place.  Unfortunately it's much
too late for that.

Addresses: https://cygwin.com/pipermail/cygwin/2021-November/249837.html
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-11-11 10:48:22 +01:00
..
2021-10-28 22:29:42 +02:00
2020-05-30 19:41:18 +02:00
2021-11-10 20:16:15 -05:00
2021-08-02 13:57:03 +02:00
2021-04-27 16:49:56 +01:00
2016-06-25 00:43:01 +02:00
2021-02-01 09:55:08 -05:00
2018-02-20 17:59:53 +01:00
2021-02-01 09:55:08 -05:00
2021-10-26 18:47:22 +02:00
2020-10-18 14:55:13 +01:00
2021-07-30 15:48:26 +01:00
2021-06-26 15:24:27 +01:00
2021-10-26 18:47:22 +02:00
2021-10-26 18:47:22 +02:00
2017-03-27 22:03:58 +01:00
2015-08-17 11:05:43 +02:00
2021-07-30 15:48:26 +01:00
2020-08-28 11:10:48 +02:00
2021-07-29 17:13:47 +02:00
2018-04-16 22:46:11 -05:00
2021-08-23 19:36:10 +02:00
2021-08-23 19:36:10 +02:00
2019-06-25 15:44:43 -04:00
2019-06-25 15:44:43 -04:00