]> git.proxmox.com Git - pve-container.git/commit
improve mountpoint parsing
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 4 Feb 2016 12:40:15 +0000 (13:40 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Wed, 10 Feb 2016 11:02:55 +0000 (12:02 +0100)
commitda99029582e7ba59070ee32ce06588fa89154d34
treec5e497efa440454c6f17e160a301fd4f78505883
parent9b28b538b1e5f4aafc1009c3bbc02db15c2a258e
improve mountpoint parsing

changes from v1:
renamed function to verify_*
added check for ../ at the beginning
cleaned up regex (\.)? -> \.?

currently we sanitize mountpoints with sanitize_mountpoint, which
tries to remove dots, double-dots and multiple slashes, but it does it
not correctly (e.g. /test/././ gets truncated to /test./ )

instead of trying to truncate the path, we create a format for mp strings
which throws an error if /./ or /../ exist (also /. and /.. at the end or
../ at the beginning) since there should be no valid use for these in
mountpoint paths anyway

with the new behaviour, we don't need sanitize_mountpoint anymore:

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/LXC.pm