Skip to content

Commit

Permalink
Debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Oct 26, 2023
1 parent 260fcd6 commit a6985e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Cavil/Util.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use Carp 'croak';
use Exporter 'import';
use Encode qw(from_to decode);
use Mojo::Util;
use Mojo::File qw(path);
use Mojo::File qw(path tempfile);
use POSIX 'ceil';
use Spooky::Patterns::XS;
use Text::Glob 'glob_to_regex';
Expand Down Expand Up @@ -160,11 +160,12 @@ sub read_lines ($path, $start_line, $end_line) {
}

sub ssh_sign ($key, $realm, $value) {
my $debug = qx/ssh-keygen -Y sign -f "$key" -q -n "$realm" < <(echo -n "$value")/;
my $tmp = tempfile->spew($value);
my $debug = qx/ssh-keygen -Y sign -f "$key" -q -n "$realm" < $tmp/;
warn "DEBUG: $debug\n";

# One-liner copied from https://www.suse.com/c/multi-factor-authentication-on-suses-build-service/
return qx/ssh-keygen -Y sign -f "$key" -q -n "$realm" < <(echo -n "$value") | tail -n +2 | head -n -1 | tr -d "\n"/;
return qx/ssh-keygen -Y sign -f "$key" -q -n "$realm" < $tmp | tail -n +2 | head -n -1 | tr -d "\n"/;
}

1;

0 comments on commit a6985e3

Please sign in to comment.