public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix a bad case of absolute path handling
@ 2021-11-10 20:32 corinna-cygwin
  2021-11-10 20:32 ` [PATCH 1/2] Cygwin: drop unused isabspath_u and iswabspath macros corinna-cygwin
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: corinna-cygwin @ 2021-11-10 20:32 UTC (permalink / raw)
  To: cygwin-patches

From: Corinna Vinschen <corinna@vinschen.de>

As I told Takashi in PM, I will try to more often send patches to the
cygwin-patches ML before pushing them, so there's a chance to chime in.

This patch series is supposed to address the `rm -rf' problem reported
in https://cygwin.com/pipermail/cygwin/2021-November/249837.html

It was always frustrating, having to allow DOS drive letter paths for
backward compatibility.  This here is another case of ambiguity,
triggered by the `isabspath' macro handling "X:" as absolute path, even
without the trailing slash or backslash.

Check out the 2nd patch for a more detailed description.

While at it, I wonder if we might have a chance to fix these ambiguities
in a better way.  For instance, consider this:

  $ mkdir -p test/c:
  $ cd test

As non-admin:

  $ touch c:/foo
  touch: cannot touch 'c:/foo': Permission denied

As admin, even worse:

  $ touch c:/foo
  $ ls /cygdrive/c/foo
  foo

As long as we support DOS paths as input, I have a hard time to see how
to fix this, but maybe we can at least minimize the ambiguity somehow.


Corinna


Corinna Vinschen (2):
  Cygwin: drop unused isabspath_u and iswabspath macros
  Cygwin: introduce isabspath_strict macro

 winsup/cygwin/syscalls.cc |  2 +-
 winsup/cygwin/winsup.h    | 20 ++++++++------------
 2 files changed, 9 insertions(+), 13 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-11-12 16:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 20:32 [PATCH 0/2] Fix a bad case of absolute path handling corinna-cygwin
2021-11-10 20:32 ` [PATCH 1/2] Cygwin: drop unused isabspath_u and iswabspath macros corinna-cygwin
2021-11-10 20:32 ` [PATCH 2/2] Cygwin: introduce isabspath_strict macro corinna-cygwin
2021-11-10 22:22 ` [PATCH 0/2] Fix a bad case of absolute path handling Ken Brown
2021-11-11  9:47   ` Corinna Vinschen
2021-11-11 14:10     ` Ken Brown
2021-11-12 16:30   ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).