Challenge 4: Closedown
Closedown
Section titled “Closedown”The transfer depot files dockets into numbered slots and pins the current draft to the board. At the end of the day it copies its day-end line out, closes the books, and reads the line back to whoever is still standing at the counter.
Your goal is to get the depot to read back more than it meant to.
Get the files
Section titled “Get the files”Download closedown-v1.0.0.tar into ~/underdunn-course/downloads and
verify the release digest:
cd ~/underdunn-course/downloadssha256sum closedown-v1.0.0.tarca749f7f46fd03506283aec5d50f686df5f89d9979e65c588bffe6410a31a237 closedown-v1.0.0.tarDon’t continue if it differs. Download a fresh copy and verify it again.
mkdir -p ~/underdunn-course/labs/closedowntar -xf closedown-v1.0.0.tar -C ~/underdunn-course/labs/closedowncd ~/underdunn-course/labs/closedown/closedown-v1.0.0sha256sum -c CHECKSUMS.sha256sh build.shEvery listed file has to report OK. Build it with -Wall -Wextra as well, and notice what you get
back. Compare that result with the normal path.
The flag
Section titled “The flag”Paste exactly what the depot read back, with no surrounding whitespace:
Reset and cleanup
Section titled “Reset and cleanup”The depot keeps no state between runs, and a run that ends badly ends the process. For a full reset of the files:
cd ~/underdunn-course/labs/closedownrm -rf -- closedown-v1.0.0tar -xf ~/underdunn-course/downloads/closedown-v1.0.0.tar -C .cd closedown-v1.0.0sha256sum -c CHECKSUMS.sha256sh build.shKeep the verified archive and any solver or modified source you want to revisit. Before a reset, copy those files outside the directory being replaced.