It is quite catastrophic if we attempt to delete the entire file storage root, because for NTN recovery is simply impossible. As such, we treat this like a 'bug check' and forbid the operation.
(ctx context.Context, path string)
| 177 | // It is quite catastrophic if we attempt to delete the entire file storage root, because for NTN |
| 178 | // recovery is simply impossible. As such, we treat this like a 'bug check' and forbid the operation. |
| 179 | func deletionForbidden(ctx context.Context, path string) bool { |
| 180 | |
| 181 | // If the path ends in our default storage extension, this must be a file storage object |
| 182 | if !strings.HasSuffix(path, defaultFileStorageName+defaultFileStorageExt) { |
| 183 | return false |
| 184 | } |
| 185 | |
| 186 | // This should be so incredibly rare that if it does happen we want to see exactly why we are here |
| 187 | logError(ctx, "[dbwarn] attempt to delete file storage root via:\n%s", debug.Stack()) |
| 188 | return true |
| 189 | } |
no test coverage detected