aboutsummaryrefslogtreecommitdiffstats
path: root/testsp.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-07-30 00:14:45 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-07-30 00:14:45 -0700
commit2f865fd3e2cd871387de67394013b1137142357c (patch)
tree99e0c3db635608336e0864d02dae6c10ceec6b48 /testsp.c
parent768aeab3232cd3077ffff579ff2d59441c6968ef (diff)
downloadsafepath-2f865fd3e2cd871387de67394013b1137142357c.tar.gz
safepath-2f865fd3e2cd871387de67394013b1137142357c.tar.bz2
safepath-2f865fd3e2cd871387de67394013b1137142357c.zip
Handle consecutive slashes better.
* safepath.c (safepath_check): At the start of an absolute path and at every component separation, go to the last slash if there are multiple slashes; do not report multiple slashes as an invalid path. Also, if a symbolic link target ends with a slash, then do not add a slash between it and the rest of the path. We thereby conform to the POSIX requirement that if a link target consists of nothing but slashes, then those slashes replace the leading slashes of the rest of the path.
Diffstat (limited to 'testsp.c')
0 files changed, 0 insertions, 0 deletions