forked from Proxmox/ProxmoxVE
The EXIT/ERR/INT/TERM trap inside create_temp_dir() overwrites any global traps and fires when the shell exits, not when the calling function returns. Since the function is a utility that returns a path via stdout, the trap fires immediately on function return and cannot properly clean up the caller's temp dir. Callers already handle their own cleanup via explicit rm -rf.