Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug (https://github.com/perseo22/pacmanager/issues/74) #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@

* VERSIONS:

- 4.5.5.9 ( by bitchecker ):

. Fixed a bug for using RSA keys authentication with MOSH protocol

- 4.5.5.8:

. Fixed a bug that prevented PAC from starting with "clusters" view selected

- 4.5.5.8:

. Fixed a bug that prevented PAC from starting with "clusters" view selected
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This is a FORK of PAC project
( https://github.com/perseo22/pacmanager )

## the only reason for this fork is to solve the RSA key authentication using MOSH protocol


* HOW TO USE IT:

- This forked version, at the moment, needs the installation of `pacmanager` from distro repositories for manage dipendencies correctly, and, after that, run the `pac` perl script.
- At the moment, the keepass module is disabled.

### for all other informations, please read the forked README file.
38 changes: 8 additions & 30 deletions lib/PACUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package PACUtils;
##################################################################
# This file is part of PAC( Perl Auto Connector)
#
# Copyright (C) 2010-2016 David Torrejon Vaquerizas
# Copyright (C) 2010-2015 David Torrejon Vaquerizas
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -105,7 +105,7 @@ require Exporter;
# Define GLOBAL CLASS variables

our $APPNAME = 'PAC';
our $APPVERSION = '4.5.5.8';
our $APPVERSION = '4.5.5.9';
our $DEBUG_LEVEL = 1;
our $ARCH = '';
my $ARCH_TMP = `/bin/uname -m 2>&1`;
Expand All @@ -114,7 +114,7 @@ elsif ( $ARCH_TMP =~ /ppc64/gio ) { $ARCH = 'PPC64'; }
elsif ( $ARCH_TMP =~ /armv7l/gio ) { $ARCH = 'ARMV7L'; }
elsif ( $ARCH_TMP =~ /arm/gio ) { $ARCH = 'ARM'; }
else { $ARCH = 32; }
my $RES_DIR = $RealBin . '/res';
my $RES_DIR = '/usr/share/pacmanager/res';
my $SPLASH_IMG = $RES_DIR . '/pac256x256.jpg';
my $CFG_DIR = $ENV{'HOME'} . '/.config/pac';
my $CFG_FILE = $CFG_DIR . '/pac.yml';
Expand All @@ -126,28 +126,6 @@ my %WINDOWPROGRESS;
my $WIDGET_POPUP;

our @DONATORS_LIST = (
'Angelo Maria Lambiasi',
'TWEB Inc',
'Jeff Bakst',
'Sebastian Treu',
"Brian's Consultant Services",
'Cheah CH',
'Joseph Whipple',
'Felix Brack',
'Kalmykov Alexander',
'Paul Verreth',
'Iftimie Catalin Panaite',
'Andre Geißler',
'Arend de Boer',
'Taylor Finklea',
'Egbert Gerber',
'Гусаров Андрей',
'Carlos Bragatto',
'Nicklas Börjesson',
'Peter Taylor',
'Javier Martin Garcia-Asenjo',
'Helmut Kleinhans',
'Richard Kozel',
'Timo Büttner',
'Max Maskevich',
'1one - 18mind',
Expand Down Expand Up @@ -207,7 +185,7 @@ our @PACDESKTOP = (

# Gnome2 - VTE (here be dragons...)
eval q {
unshift( @INC, $RealBin . '/lib/ex/vte' . $PACUtils::ARCH );
unshift( @INC, '/usr/share/pacmanager/lib/ex/vte' . $PACUtils::ARCH );

package Gnome2::Vte;

Expand Down Expand Up @@ -799,7 +777,7 @@ sub _getMethods {
_( $self, 'entryUser' ) -> set_sensitive( 1 );
_( $self, 'alignUserPass' ) -> set_sensitive( 1 );
_( $self, 'rbCfgAuthUserPass' ) -> set_active( $$cfg{'auth type'} eq 'userpass' );
_( $self, 'framePublicKey' ) -> set_sensitive( 0 );
_( $self, 'framePublicKey' ) -> set_sensitive( 1 );
_( $self, 'entryPassphrase' ) -> set_text( $$cfg{passphrase} // '' );
_( $self, 'fileCfgPublicKey' ) -> set_filename( $$cfg{'public key'} // '' );
_( $self, 'rbCfgAuthPublicKey' ) -> set_active( $$cfg{'auth type'} eq 'publickey' );
Expand Down Expand Up @@ -1854,7 +1832,7 @@ sub _cfgSanityCheck {
$$cfg{'defaults'}{'screenshots external viewer'} //= '/usr/bin/xdg-open';
$$cfg{'defaults'}{'screenshots use external viewer'}//= 0;
$$cfg{'defaults'}{'sort groups first'} //= 1;
$$cfg{'defaults'}{'word characters'} //= '\.:_\/a-zA-Z0-9-';
$$cfg{'defaults'}{'word characters'} //= '\.:_\/-A-Za-z0-9';
$$cfg{'defaults'}{'terminal emulation'} //= 'xterm';
$$cfg{'defaults'}{'show tray icon'} //= 1;
$$cfg{'defaults'}{'unsplit disconnected terminals'} //= 0;
Expand Down Expand Up @@ -3045,7 +3023,7 @@ sub _getXWindowsList {
$list{'by_pid'}{$data_pid}{'xid'} = $xid;
$list{'by_pid'}{$data_pid}{'command'} = $data_command;
}
}
}

#my $tw = Gtk2::Window -> new;
#my $vb = Gtk2::VBox -> new( 0, 0 );
Expand All @@ -3059,7 +3037,7 @@ sub _getXWindowsList {
#my $sock = Gtk2::Socket -> new;
#$vb -> add( $sock );
#$tw -> show_all;
#$sock -> add_id( $list{'by_name'}{'Calculator'}{'xid'} );
#$sock -> add_id( $$list{'by_name'}{'Calculator'}{'xid'} );

return \%list;
}
Expand Down
40 changes: 20 additions & 20 deletions lib/pac_conn
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##################################################################
# This file is part of PAC( Perl Auto Connector)
#
# Copyright (C) 2010-2016 David Torrejon Vaquerizas
# Copyright (C) 2010-2015 David Torrejon Vaquerizas
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -28,7 +28,7 @@ use strict;
use warnings;

use FindBin qw ( $RealBin $Bin $Script );
use lib $RealBin, $RealBin . '/ex', $RealBin . '/edit';
use lib $RealBin, '/usr/share/pacmanager/ex', '/usr/share/pacmanager/edit';
use Storable qw ( dclone thaw retrieve fd_retrieve nstore_fd );
use Expect;
use Gnome2::GConf;
Expand All @@ -46,7 +46,7 @@ use Gtk2 '-init';
########################################################
# START : Variables declaration/initialization
my $APPNAME = 'PAC';
my $APPICON = $RealBin . '/../res/pac64x64.png';
my $APPICON = '/usr/share/pacmanager/res/pac64x64.png';
my $CFG_DIR = $ENV{'HOME'} . '/.config/pac';
my $SCRIPTS_DIR = $CFG_DIR . '/scripts';

Expand Down Expand Up @@ -665,6 +665,13 @@ sub _execScript {
$EXP -> clear_accum;
send_slow( $EXP, $txt );
};
$TERMINAL{get_prompt} = sub {
my $del_esq = shift // 1;
ctrl( "SCRIPT_SUB_GET_PROMPT[NAME:$name][PID:$$][PARAMS:]" );
my $prompt = _getPrompt();
$del_esq and $prompt = _removeEscapeSeqs( $prompt );
return "\Q$prompt\E";
};
$TERMINAL{send_get} = sub {
my $txt = shift // '';
my $intro = shift // 1;
Expand All @@ -676,13 +683,6 @@ sub _execScript {
$out =~ s/^.+?\R//go;
return _removeEscapeSeqs( $out );
};
$TERMINAL{get_prompt} = sub {
my $del_esq = shift // 1;
ctrl( "SCRIPT_SUB_GET_PROMPT[NAME:$name][PID:$$][PARAMS:]" );
my $prompt = _getPrompt();
$del_esq and $prompt = _removeEscapeSeqs( $prompt );
return "\Q$prompt\E";
};
$TERMINAL{expect} = sub {
my $pattern = shift // '';
my $tmout = shift // 1;
Expand Down Expand Up @@ -876,7 +876,16 @@ if ( defined $METHOD ) {
} elsif ( ( $METHOD =~ /^.*mosh.*$/ ) || ( $METHOD eq 'MOSH' ) ) {
$METHOD = 'mosh';
$PORT != 22 and $CONNECT_OPTS .= " --ssh=\"ssh -p $PORT\"";
$connection_cmd = "$METHOD $CONNECT_OPTS $USER\@$IP";
my $key = '';
if ( $AUTH eq 'publickey' ) {
$key = "-i \"$PUBKEY\"" . ( $AUTHFALLBACK ? '' : ' -o "PreferredAuthentications=publickey"' );
$USER = $PASSPHRASE_USER;
$PASS = $PASSPHRASE;
$CONNECT_OPTS = " --ssh=\"ssh -p $PORT $key\"";
} elsif ( ! $AUTHFALLBACK ) {
$key = '-o "PreferredAuthentications=password,keyboard-interactive"';
}
$connection_cmd = "$METHOD $CONNECT_OPTS " . "$USER" . "@" . "$IP";
$connection_txt = $connection_cmd;
print "*$connection_cmd*\n";
} elsif ( ( $METHOD =~ /^.*sftp.*$/ ) || ( $METHOD eq 'SFTP' ) ) {
Expand Down Expand Up @@ -934,9 +943,6 @@ if ( defined $METHOD ) {
} elsif ( $METHOD eq 'rdesktop' ) {
$connection_cmd = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " -u $USER -p -" ) . " -T \"$TITLE\" $IP:$PORT";
$connection_txt = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " -u $USER -p -" ) . " -T \"$TITLE\" $IP:$PORT";
} elsif ( $METHOD =~ /^.*freerdp$/ ) {
$connection_cmd = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " /u:$USER" ) . " /t:\"$TITLE\" /v:$IP:$PORT";
$connection_txt = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " /u:$USER" ) . " /t:\"$TITLE\" /v:$IP:$PORT";
} else {
$connection_cmd = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " -u $USER" ) . " $IP:$PORT -T \"$TITLE\"";
$connection_txt = "$METHOD $CONNECT_OPTS" . ( $MANUAL ? '' : " -u $USER" ) . " $IP:$PORT -T \"$TITLE\"";
Expand Down Expand Up @@ -1124,12 +1130,6 @@ elsif ( ( $METHOD =~ /^.*vncviewer$/ ) || ( $METHOD eq 'VNC' ) ) {
ctrl( "CONNECTED" );
}],

# No auth is needed
[ '^.*No authentication needed*$', sub {
$CONNECTED = 1;
ctrl( "CONNECTED" );
}],

# Found login string
[ '^.*Conn:\s+connected to host\s+.+\s+port\s+\d+.*$', sub {
$CONNECTED = 1;
Expand Down