CCCPaste

3a325bff9fede

mkdir C:\sf-test\
cd C:\sf-test\
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

-----------------------------------------------------------------------------------------------------------------------------------
cd C:\sf-test\
powershell -ExecutionPolicy Bypass -c "irm 'https://files.starfishstorage.com/messages/OqFuvIhQ0YsnjAnUICip4H/attachments/fkoY7073iiTLvI3mlRKS2C/download/unpack_tar.py' -OutFile 'unpack_tar.py'"


powershell -ExecutionPolicy Bypass -c "irm 'https://files.starfishstorage.com/messages/JP9qIHQ22A2L47gK4raghh/attachments/9e3NnOYs79KKQLrnQf6lrE/download/upload-20260514_114047_8df9c5.tar.gz' -OutFile 'upload-20260514_114047_8df9c5.tar.gz'"

-----------------------------------------------------------------------------------------------------------------------------------

sf volume add win-temp '\\?\c:' --agent-address "https://evstarfishwin5.fsm.northwestern.edu:30002"
sf restore start fsmresfiles:ADS-RCS-TEST\archive-stress win-temp:restored-archive-stress --wait

-----------------------------------------------------------------------------------------------------------------------------------


$SCRIPT = "C:\sf-test\unpack_tar.py"
$TAR = "C:\sf-test\upload-20260514_114047_8df9c5.tar.gz" # input archive - one local copy, used by every run
$OUT_LOCAL = "C:\sf-test\out" # LOCAL destination root (the control)
$OUT_FSM = "Z:\sf-test\out" # FSM destination root - Z: = fsmresfiles mapped on evstarfishwin5

# 1. all on -> LOCAL (expect PASS - script reproduces normal behavior)
uv run $SCRIPT $TAR --dest-path "$OUT_LOCAL\01-allon-local"

# 2. all on -> FSM (expect FAIL - the reproduction; capture the exact error, expect WinError 4392)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\02-allon-fsm"

# 3. all off -> FSM (expect PASS - data-only; local preview of Wednesday's restore_none)
# (if this FAILS: the failing op is NOT behind any toggle)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\03-alloff" --no-restore-owner --no-restore-file-attributes --no-restore-dacls --no-times

# 4. no file-attributes -> FSM (PASS: file-attributes is the rejected write | FAIL: rule out)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\04-noattr" --no-restore-file-attributes

# 5. no owner -> FSM (PASS: owner SID is the culprit, then run #7 | FAIL: rule out)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\05-noowner" --no-restore-owner

# 6. no dacls -> FSM (expect FAIL: same as #2; dacl=[] so turning it off changes nothing -> DACLs ruled out)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\06-nodacl" --no-restore-dacls

Run 7  only if #5 passes:
# 7. owner ON + privilege, from the ELEVATED shell
# (PASS => it was just a missing SeRestorePrivilege, fixable | FAIL => fsm rejects the SID outright => FS-vendor / restore_none)
uv run $SCRIPT $TAR --dest-path "$OUT_FSM\07-owner-priv" --enable-restore-privilege