diff options
| author | Peter Pettersson <boretrk@hotmail.com> | 2021-08-08 13:22:53 +0200 |
|---|---|---|
| committer | Peter Pettersson <boretrk@hotmail.com> | 2021-08-08 13:26:24 +0200 |
| commit | e96fc0283aea9afd02f64bdcb26613422e74dc3a (patch) | |
| tree | 6eb38e100ef9d7b098ed42ba27d34938cac0dc9d /src/posix.c | |
| parent | e65229ee972c113413eeca77853213352129bd47 (diff) | |
| download | libgit2-e96fc0283aea9afd02f64bdcb26613422e74dc3a.tar.gz | |
tests: optional test for p_open() with empty path segments
Diffstat (limited to 'src/posix.c')
| -rw-r--r-- | src/posix.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/posix.c b/src/posix.c index bf764ae6b..c40134824 100644 --- a/src/posix.c +++ b/src/posix.c @@ -109,6 +109,13 @@ int p_open(const char *path, volatile int flags, ...) { mode_t mode = 0; + #ifdef GIT_DEBUG_STRICT_OPEN + if (strstr(path, "//") != NULL) { + errno = EACCES; + return -1; + } + #endif + if (flags & O_CREAT) { va_list arg_list; |
