--- rancid.orig	2019-02-06 02:03:28.000000000 -0500
+++ rancid	2019-02-13 13:32:04.103689467 -0500
@@ -116,12 +116,14 @@
     print(STDERR "opening file $host\n") if ($debug || $log);
     open(INPUT,"<$host") || die "open failed for $host: $!\n";
 } else {
-    print(STDERR "executing $lscript -t $timeo -c\"$commandstr\" $host\n") if ($debug || $log);
+    my $cstr = $commandstr;
+    $cstr =~ s/\"/\\\"/g;
+    print(STDERR "executing $lscript -t $timeo -c\"$cstr\" $host\n") if ($debug || $log);
     if (defined($ENV{NOPIPE}) && $ENV{NOPIPE} =~ /^YES/i) {
-	system "$lscript -t $timeo -c \"$commandstr\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
+	system "$lscript -t $timeo -c \"$cstr\" $host </dev/null > $host.raw 2>&1" || die "clogin failed for $host: $!\n";
 	open(INPUT, "< $host.raw") || die "clogin failed for $host: $!\n";
     } else {
-	open(INPUT,"$lscript -t $timeo -c \"$commandstr\" $host </dev/null |") || die "clogin failed for $host: $!\n";
+	open(INPUT,"$lscript -t $timeo -c \"$cstr\" $host </dev/null |") || die "clogin failed for $host: $!\n";
     }
 }
 
