summaryrefslogtreecommitdiff
path: root/src/posix.c
diff options
context:
space:
mode:
authorPeter Pettersson <boretrk@hotmail.com>2021-08-08 13:22:53 +0200
committerPeter Pettersson <boretrk@hotmail.com>2021-08-08 13:26:24 +0200
commite96fc0283aea9afd02f64bdcb26613422e74dc3a (patch)
tree6eb38e100ef9d7b098ed42ba27d34938cac0dc9d /src/posix.c
parente65229ee972c113413eeca77853213352129bd47 (diff)
downloadlibgit2-e96fc0283aea9afd02f64bdcb26613422e74dc3a.tar.gz
tests: optional test for p_open() with empty path segments
Diffstat (limited to 'src/posix.c')
-rw-r--r--src/posix.c7
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;