demo

command
v1.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Two-patch example

This example starts with a tiny C program. The first patch changes its arithmetic operation; the second changes the label it prints. The source and both patches are original to this project and use Apache-2.0. Each patch declares local:demonstration as its origin. Neither patch represents a security fix or makes a claim about a CVE.

Follow the build instructions first, then run these commands from the repository root on Linux:

work=$(mktemp -d)
go run ./examples/demo --output "$work/inputs"
./bin/patchstack audit \
  --manifest "$work/inputs/stack.yaml" \
  --input-root "$work/inputs" \
  --output "$work/result"

The generator writes source.tar.gz, a patches/ directory and stack.yaml with the exact SHA-256 hashes of those inputs. It uses the fixtures embedded in the generator, with a fixed archive entry order, permissions, ownership and timestamps. Running it again produces identical input bytes. These generated files are disposable; the checked-in fixtures remain the source for the example.

Both generated directories, inputs and result, must be absent before their respective commands run. Their parent must already exist; mktemp -d creates it here. On success, $work/result contains the patched source/main.c, report.json and report.md.

The audit does not compile or test the C program, so no C compiler is needed. Successful application demonstrates reproduction of this patch series; it does not establish a security repair.

Documentation

Overview

Command demo generates inputs for the original two-patch example.

Directories

Path Synopsis
Package fixtures generates repeatable inputs for the local two-patch example.
Package fixtures generates repeatable inputs for the local two-patch example.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL