[pve-devel] [PATCH pve-storage v4; pve-manager 0/4] fix #623: show isos/vztmpl/snippets in subdirs

Noel Ullreich n.ullreich at proxmox.com
Fri Jul 21 14:23:10 CEST 2023


This patch fixes #623, allowing isos/vztmpl/snippets in subdirectories.
This feature is opt-in and can be set from the API, web interface or
with `pvesm`.

changes from v3:
* moved regex that is often used into variables
* enabled going through symlinked directories as well.
 NB: there is no logic in this patch that looks for cycles, (so a symlink
 to the directory it is in will recurse). This is not a security concern
 since it can only recurse as many times as the depth has been set to, it
 might however lead to isos/templates/etc appearing multiple times with
 cycles in their paths.
 Imo, while it is ugly, it is an edgecase of a niche feature that
 doesn't break anything, so it's ok.
* changed name of parameter from subdir-depth to scan-depth

Noel Ullreich (3):
  recursively go through subdirs to find files
  add `scan-depth` option to filesystems
  update test for recursive subdir search

 src/PVE/Storage.pm                 | 11 +++++
 src/PVE/Storage/CIFSPlugin.pm      |  1 +
 src/PVE/Storage/CephFSPlugin.pm    |  1 +
 src/PVE/Storage/DirPlugin.pm       |  1 +
 src/PVE/Storage/GlusterfsPlugin.pm |  1 +
 src/PVE/Storage/NFSPlugin.pm       |  1 +
 src/PVE/Storage/Plugin.pm          | 61 ++++++++++++++++++---------
 src/test/filesystem_path_test.pm   | 18 ++++++++
 src/test/list_volumes_test.pm      | 68 ++++++++++++++++++++++++++++++
 src/test/parse_volname_test.pm     | 40 ++++++++++++++++++
 10 files changed, 182 insertions(+), 21 deletions(-)

Noel Ullreich (1):
  ui: add field to set subdir-depth in web interface

 www/manager6/storage/Base.js | 11 +++++++++++
 1 file changed, 11 insertions(+)


-- 
2.39.2






More information about the pve-devel mailing list