about summary refs log tree commit homepage
path: root/bin/dtas-sourceedit
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-01-20 18:34:19 +0000
committerEric Wong <e@80x24.org>2022-01-21 19:54:43 +0000
commit88a8d4793473259b392241f1e2d20d39bd96b214 (patch)
tree28e3fb5d17017038045de143bd2e6a7d95655d0d /bin/dtas-sourceedit
parent748c3633ce794685af343de0bcd24eca7440281b (diff)
downloaddtas-88a8d4793473259b392241f1e2d20d39bd96b214.tar.gz
Psych 4.x defaults to "nanny mode" to handle untrusted data.
This causes breakage with since YAML references (aliases)
emitted by dtas-player can't be handled by Psych clients under
Ruby 3.1.  Since dtas is single user and is a shell designed to
run arbitrary code, favor the new YAML.unsafe_load API which
behaves like the old YAML.load in Ruby <= 3.0.
Diffstat (limited to 'bin/dtas-sourceedit')
-rwxr-xr-xbin/dtas-sourceedit4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/dtas-sourceedit b/bin/dtas-sourceedit
index e6603bf..1b3f4ee 100755
--- a/bin/dtas-sourceedit
+++ b/bin/dtas-sourceedit
@@ -36,10 +36,10 @@ st_in = $stdin.stat
 
 buf = c.req(%W(source cat #{name}))
 abort(buf) if buf =~ /\AERR/
-orig = YAML.load(buf)
+orig = DTAS.yaml_load(buf)
 
 commit_update = lambda do |buf|
-  source = YAML.load(buf)
+  source = DTAS.yaml_load(buf)
   cmd = %W(source ed #{name})
   update_cmd_env(cmd, orig, source)