--- orig/shell-tools
+++ mod/shell-tools
@@ -52,6 +52,19 @@
     trap "${action}" "${condition}"
 }
 
+# Restore saved trap actions
+restore_traps ()
+{
+    local saved_traps="$1"
+
+    if [ -n "${saved_traps}" ]; then
+    eval "${saved_traps}"
+else
+	# remove all traps by replacing them with a no-op trap
+	trap ':' EXIT
+fi
+}
+
 _quiet_dd_cleanup ()
 {
     local dd_output="$1"
@@ -70,7 +83,7 @@
     add_trap "_quiet_dd_cleanup \"${dd_output}\"" EXIT
     dd "$@" status=noxfer > "${dd_output}" 2>&1
     _quiet_dd_cleanup "${dd_output}"
-    eval "${saved_traps}"
+    restore_traps "${saved_traps}"
 }
 
 # Terminate with an error message if not running with root privileges
