nautd: block adding a torrent that would overlap existing data

spawn_torrent parses each torrent's file list (at add and restore) and
refuses an add whose files would write where a registered torrent's data
lives (NAUT_ERR_EXIST). Magnets are checked once metadata is known is
out of scope; restore skips the check. webui surfaces it as HTTP 409.
Mark #10 done.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
ookami125 2026-06-22 01:01:50 -04:00
parent 187e8f2db2
commit 7bbc1ee22c
5 changed files with 149 additions and 8 deletions

View file

@ -13,6 +13,7 @@ const char *naut_strerror(naut_err e) {
case NAUT_ERR_FULL: return "full";
case NAUT_ERR_EMPTY: return "empty";
case NAUT_ERR_NOTFOUND: return "not found";
case NAUT_ERR_EXIST: return "already exists / data would overlap";
default: return "unknown error";
}
}