doos 1.1.0: limits, hardening, pasta, signatures, Debian image

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 21:59:26 +02:00
co-authored by Claude Sonnet 5.5
parent d446c29372
commit 530582e826
24 changed files with 1182 additions and 127 deletions
+9 -1
View File
@@ -2,6 +2,7 @@
#include <cerrno>
#include <cstdint>
#include <filesystem>
#include <functional>
#include <stdexcept>
#include <string>
#include <vector>
@@ -51,6 +52,8 @@ private:
std::uint64_t parseSize(const std::string& text);
std::string formatSize(std::uint64_t bytes);
std::string base64Decode(const std::string& in); // lenient on whitespace, throws on bad characters
struct ProcResult {
int code = -1;
std::string out; // stdout, only when captured
@@ -67,7 +70,12 @@ struct SeedStats {
// Creates every directory of `lower` in `upper` (owner rwx added) so a unmapped-owner lower stays writable.
SeedStats mirrorDirs(const std::filesystem::path& lower, const std::filesystem::path& upper);
// Copies dirs, regular files and symlinks readable by the caller. Capped by spec.hpp limits.
SeedStats copyTree(const std::filesystem::path& from, const std::filesystem::path& to);
// `skip` (optional) is asked for every entry and returns true to leave it out (counted as skipped).
using SkipFn = std::function<bool(const std::filesystem::path&)>;
SeedStats copyTree(const std::filesystem::path& from, const std::filesystem::path& to, const SkipFn& skip = nullptr);
// Copies only the named entries (relative paths, files, links or dirs) of `from` into `to`.
SeedStats copyEntries(const std::filesystem::path& from, const std::filesystem::path& to,
const std::vector<std::string>& entries, const SkipFn& skip);
// Copies only the regular files directly inside `from` (readable ones) into `to`; existing targets stay.
SeedStats copyFiles(const std::filesystem::path& from, const std::filesystem::path& to);
// Sum of allocated bytes (st_blocks) below p, lstat only. `skipped` counts unreadable dirs.