Skip to content

Commit

Permalink
fix error when using sudo command
Browse files Browse the repository at this point in the history
  • Loading branch information
shibayu36 committed May 1, 2012
1 parent 05ee055 commit 5be9d45
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/Cinnamon/Remote.pm
Expand Up @@ -19,7 +19,7 @@ sub host { $_[0]->{host} }

sub execute {
my ($self, @cmd) = @_;
my $opt = shift @cmd if ref $cmd[0] eq 'HASH';
my $opt = shift @cmd;
my ($stdout, $stderr);
if (defined $opt && $opt->{sudo}) {
($stdout, $stderr) = $self->execute_by_sudo($opt->{password}, @cmd);
Expand All @@ -40,8 +40,7 @@ sub execute_by_sudo {
my ($self, $password, @cmd) = @_;
return $self->connection->capture2(
{ stdin_data => "$password\n" },
'sudo', '-Sk',
@cmd,
join(' ', 'sudo', '-Sk', @cmd),
);
}

Expand Down

0 comments on commit 5be9d45

Please sign in to comment.