road to reentrant real_path
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest5 patches 5 repliesIn review
- v45 patches 9 repliesSuperseded
- v34 patches 10 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 7 replies | Superseded |
Changes in v5 from the cover letter
* set errno to ELOOP when MAXSYMLINKS is exceded.
* revert to use MAXSYMLINKS instead of MAXDEPTH.
* If the OS hasn't defined MAXSYMLINKS, use a fallback value of 32.
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | real_path: resolve symlinks by handabspath.c | +133 | 0 replies | |
| 2/5 | real_path: convert real_path_internal to strbuf_realpathabspath.c cache.h | +27 | 0 replies | |
| 3/5 | real_path: create real_pathdupabspath.c cache.h | +14 | 0 replies | |
| 4/5 | real_path: have callers use real_pathdup and strbuf_realpathbuiltin/ environment.c setup.c +4 more | +16 | 0 replies | |
| 5/5 | real_path: canonicalize directory separators in root partsabspath.c | +17 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH v5 0/5] road to reentrant real_path
changes in v5:
* set errno to ELOOP when MAXSYMLINKS is exceded.
* revert to use MAXSYMLINKS instead of MAXDEPTH.
* If the OS hasn't defined MAXSYMLINKS, use a fallback value of 32.
Brandon Williams (4):
real_path: resolve symlinks by hand
real_path: convert real_path_internal to strbuf_realpath
real_path: create real_pathdup
real_path: have callers use real_pathdup and strbuf_realpath
Johannes Sixt (1):
real_path: canonicalize directory separators in root parts
abspath.c | 231 +++++++++++++++++++++++++++++++++++++----------------- builtin/init-db.c | 6 +- cache.h | 3 + environment.c | 2 +- setup.c | 13 +-- sha1_file.c | 2 +- submodule.c | 2 +- transport.c | 2 +- worktree.c | 2 +- 9 files changed, 178 insertions(+), 85 deletions(-)
--- interdiff with v4
abspath.c +7 -3
@@ -62,7 +62,9 @@ static void get_root_part(struct strbuf *resolved, struct strbuf *remaining) }/* We allow "recursive" symbolic links. Only within reason, though. */ -#define MAXDEPTH 5 +#ifndef MAXSYMLINKS +#define MAXSYMLINKS 32 +#endif /* * Return the real path (i.e., absolute path, with symlinks resolved
@@ -138,10 +140,12 @@ char *strbuf_realpath(struct strbuf *resolved, const char *path,ssize_t len;strbuf_reset (&symlink); -if (num_symlinks++ >MAXDEPTH ) { +if (num_symlinks++ >MAXSYMLINKS ) { + errno =ELOOP ; +if (die_on_error)die ("More than %d nested symlinks " -"on path '%s'" ,MAXDEPTH , path); +"on path '%s'" ,MAXSYMLINKS , path);else goto error_out; }
Signature · 1 line
2.11.0.390.gc69c2f50cf-goog