overlay_path: Fix resolution of symbolic link under /sys/

Change-Id: I650e72fb335aa72256d3b129a65c09bbd7cf26d3
Refs: #1463
This commit is contained in:
Ken Sato
2021-03-10 09:57:05 +09:00
committed by Masamichi Takagi
parent 09173d353c
commit 051c0dcdd8
7 changed files with 167 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
diff --git executer/user/mcexec.c executer/user/mcexec.c
index acae1f8..d220dd9 100644
--- executer/user/mcexec.c
+++ executer/user/mcexec.c
@@ -3458,6 +3458,12 @@ overlay_path(int dirfd, const char *in, char *buf, int *resolvelinks)
goto checkexist_resolvelinks;
}
+ /* for #1463's test */
+ if (!strncmp(path, "/tmp", 4) &&
+ (path[4] == '/' || path[4] == '\0')) {
+ goto checkexist_resolvelinks;
+ }
+
return in;
checkexist_resolvelinks: