This is probably not backwards compatible. I tried to keep the existing usage scenario, but I probably failed.
Admins can access all other users data. This is generally for services which should put data into or get data from all jails. All SFTP admins share one Jail. This jail for SFTP admins is one directory above the normal users, but it is still a jail. In the admins jail, there is a home directory and each admin has it's personal home in it. Each (normal, not admin) SFTP jail is owned by a group. SFTP admins are member of all "jail groups" and can therefore access all jails.
This PR introduces the possibility to create a sub directories in user homes. Creating nested sub directories is possible.
By default no sub directories are created in any users home. Pass a list of sub directories to
$sftp_jail::sub_dirs. This list is used as a default list of sub directories for all users.
If you want to create an individual list of sub directories in one users home, pass a list of sub directories to the
sub_dirs parameter, when creating the user with
Optionally it is possible to enable merging. If enabled, the users sub directory list is merged with the default sub directory list. This is usefull, when multiple or all users do have some sub directories in common. Merging can be enabled globally by setting
$sftp_jail::merge_subdirs to true. Similar to the list of sub directories, it is possible to enable or disable merging on a per user basis.