about summary refs log tree commit homepage
path: root/bin/dtas-splitfx
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-splitfx
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-splitfx')
-rwxr-xr-xbin/dtas-splitfx6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/dtas-splitfx b/bin/dtas-splitfx
index 18ea0b4..05e71e5 100755
--- a/bin/dtas-splitfx
+++ b/bin/dtas-splitfx
@@ -1,5 +1,5 @@
 #!/usr/bin/env ruby
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
 # License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
 # frozen_string_literal: true
 require 'yaml'
@@ -48,7 +48,7 @@ ARGV.each do |arg|
   when %r{\A(\w+)=(.*)\z}
     key, val = $1, $2
     # only one that makes sense is infile=another_file
-    overrides[key] = YAML.load(val)
+    overrides[key] = DTAS.yaml_load(val)
   when %r{\A(\w+)\.(\w+)=(.*)\z}
     # comments.ARTIST='blah'
     top, key, val = $1, $2, $3
@@ -63,5 +63,5 @@ trap(:INT) { exit 130 }
 file = args.shift or abort usage
 target = args.shift || default_target
 splitfx = DTAS::SplitFX.new
-splitfx.import(YAML.load(File.read(file)), overrides)
+splitfx.import(DTAS.yaml_load(File.read(file)), overrides)
 splitfx.run(target, opts)