New: Prevent Remote Path Mapping local folder being set to System folder or '/'

Closes #7686
rpm-system-folder
Mark McDowall 4 weeks ago
parent b103005aa2
commit dbd2b0c4b5
No known key found for this signature in database

@ -30,8 +30,11 @@ namespace Sonarr.Api.V3.RemotePathMappings
SharedValidator.RuleFor(c => c.LocalPath)
.Cascade(CascadeMode.Stop)
.IsValidPath()
.SetValidator(mappedNetworkDriveValidator)
.SetValidator(pathExistsValidator);
.SetValidator(mappedNetworkDriveValidator)
.SetValidator(pathExistsValidator)
.SetValidator(new SystemFolderValidator())
.NotEqual("/")
.WithMessage("Cannot be set to '/'");
}
protected override RemotePathMappingResource GetResourceById(int id)

Loading…
Cancel
Save