Skip to content

Commit 932637b

Browse files
author
josepselga
committed
B #6666: Restic passwords: remove quotes and sanitize
1 parent 8a6a990 commit 932637b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/datastore_mad/remotes/restic/restic.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def initialize(action, opts = {})
9797

9898
@restic_bin = RESTIC_BIN_PATHS[@options[:host_type]]
9999

100-
@passwd = @doc.elements["#{prefix}TEMPLATE/RESTIC_PASSWORD"].text.sub(/\A['"](.*)['"]\z/, '\1')
100+
passwd_s = @doc.elements["#{prefix}TEMPLATE/RESTIC_PASSWORD"]
101+
@passwd = passwd_s.text.sub(/\A['"](.*)['"]\z/, '\1')
101102

102103
@bwlimit = safe_get("#{prefix}TEMPLATE/RESTIC_BWLIMIT", -1)
103104
@maxproc = Integer(safe_get("#{prefix}TEMPLATE/RESTIC_MAXPROC", -1))

0 commit comments

Comments
 (0)