aboutsummaryrefslogtreecommitdiff
path: root/lib/strncpy_from_user.c
diff options
context:
space:
mode:
authorJoe Perches <[email protected]>2020-06-04 16:50:04 -0700
committerLinus Torvalds <[email protected]>2020-06-04 19:06:24 -0700
commite33c9fe8b80ca86392a35ffff81fbfb6a54d2d22 (patch)
treea131defbd47b1a507d1295e72ae4d41c64085371 /lib/strncpy_from_user.c
parent0c78c013762142bfe8fce34e7e968f83f0a4b891 (diff)
get_maintainer: fix unexpected behavior for path/to//file (double slashes)
get_maintainer behaves differently if there is a double sequential forward slash in a filename because the total number of slashes in a filename is used to match MAINTAINERS file patterns. For example: (with double slash) $ ./scripts/get_maintainer.pl -f drivers/gpu/drm//lima David Airlie <[email protected]> (maintainer:DRM DRIVERS) Daniel Vetter <[email protected]> (maintainer:DRM DRIVERS,commit_signer:3/42=7%) Qiang Yu <[email protected]> (commit_signer:36/42=86%,authored:24/42=57%) Vasily Khoruzhick <[email protected]> (commit_signer:26/42=62%) Krzysztof Kozlowski <[email protected]> (commit_signer:5/42=12%,authored:5/42=12%) Emil Velikov <[email protected]> (commit_signer:4/42=10%) [email protected] (open list:DRM DRIVERS) [email protected] (open list) (without double slash) $ ./scripts/get_maintainer.pl -f drivers/gpu/drm/lima Qiang Yu <[email protected]> (maintainer:DRM DRIVERS FOR LIMA) David Airlie <[email protected]> (maintainer:DRM DRIVERS) Daniel Vetter <[email protected]> (maintainer:DRM DRIVERS) [email protected] (open list:DRM DRIVERS FOR LIMA) [email protected] (moderated list:DRM DRIVERS FOR LIMA) [email protected] (open list) So reduce consecutive double slashes to a single slash by using File::Spec->canonpath(). from: https://perldoc.perl.org/File/Spec/Unix.html canonpath() No physical check on the filesystem, but a logical cleanup of a path. On UNIX eliminates successive slashes and successive "/.". Reported-by: Emil Velikov <[email protected]> Signed-off-by: Joe Perches <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/strncpy_from_user.c')
0 files changed, 0 insertions, 0 deletions