diff -Nru perl-qvd-vmahook-nacar-3.1.0/MYMETA.yml perl-qvd-vmahook-nacar-3.1.0/MYMETA.yml --- perl-qvd-vmahook-nacar-3.1.0/MYMETA.yml 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/MYMETA.yml 2012-10-02 15:20:33.000000000 +0000 @@ -27,4 +27,4 @@ File::Temp: 0 Socket: 0 Test::More: 0 -version: 3.116714 +version: 3.116728 diff -Nru perl-qvd-vmahook-nacar-3.1.0/Makefile perl-qvd-vmahook-nacar-3.1.0/Makefile --- perl-qvd-vmahook-nacar-3.1.0/Makefile 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/Makefile 2012-10-02 15:20:33.000000000 +0000 @@ -19,7 +19,7 @@ # NAME => q[QVD::VmaHook::NACAR] # PL_FILES => { } # PREREQ_PM => { Test::More=>q[0], File::Copy=>q[0], Authen::PAM=>q[0], File::HomeDir=>q[0], File::Spec=>q[0], File::Temp=>q[0], Socket=>q[0], File::Slurp=>q[0] } -# VERSION => q[3.116714] +# VERSION => q[3.116728] # clean => { FILES=>q[QVD-VmaHook-NACAR-*] } # dist => { COMPRESS=>q[gzip -9f], SUFFIX=>q[gz] } @@ -60,11 +60,11 @@ DFSEP = $(DIRFILESEP) NAME = QVD::VmaHook::NACAR NAME_SYM = QVD_VmaHook_NACAR -VERSION = 3.116714 +VERSION = 3.116728 VERSION_MACRO = VERSION -VERSION_SYM = 3_116714 +VERSION_SYM = 3_116728 DEFINE_VERSION = -D$(VERSION_MACRO)=\"$(VERSION)\" -XS_VERSION = 3.116714 +XS_VERSION = 3.116728 XS_VERSION_MACRO = XS_VERSION XS_DEFINE_VERSION = -D$(XS_VERSION_MACRO)=\"$(XS_VERSION)\" INST_ARCHLIB = blib/arch @@ -256,7 +256,7 @@ DIST_CP = best DIST_DEFAULT = tardist DISTNAME = QVD-VmaHook-NACAR -DISTVNAME = QVD-VmaHook-NACAR-3.116714 +DISTVNAME = QVD-VmaHook-NACAR-3.116728 # --- MakeMaker macro section: @@ -497,7 +497,7 @@ $(NOECHO) $(ECHO) Generating META.yml $(NOECHO) $(ECHO) '--- #YAML:1.0' > META_new.yml $(NOECHO) $(ECHO) 'name: QVD-VmaHook-NACAR' >> META_new.yml - $(NOECHO) $(ECHO) 'version: 3.116714' >> META_new.yml + $(NOECHO) $(ECHO) 'version: 3.116728' >> META_new.yml $(NOECHO) $(ECHO) 'abstract: Runs several hooks related with Nacar initialization' >> META_new.yml $(NOECHO) $(ECHO) 'author:' >> META_new.yml $(NOECHO) $(ECHO) ' - QVD Team ' >> META_new.yml @@ -814,7 +814,7 @@ # --- MakeMaker ppd section: # Creates a PPD (Perl Package Description) for a binary distribution. ppd : - $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd + $(NOECHO) $(ECHO) '' > $(DISTNAME).ppd $(NOECHO) $(ECHO) ' Runs several hooks related with Nacar initialization' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' QVD Team <qvd-devel@theqvd.com>' >> $(DISTNAME).ppd $(NOECHO) $(ECHO) ' ' >> $(DISTNAME).ppd diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Changes perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Changes --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Changes 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Changes 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -Revision history for QVD-VmaHook-NACAR - -0.04 9/12/2011 - fix x11 permissions - -0.02 15/10/2011 - PAM tests - -0.01 Date/time - First version, released 13/10/2011 - diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -bin/nacar_hook_qvd.pl -bin/qvd_nacar_hook.pl -Changes -lib/QVD/VmaHook/NACAR.pm -Makefile.PL -MANIFEST -MANIFEST.SKIP -README -t/00-load.t -t/10-pampermit.t -t/20-pamsessfail.t -t/30-pamacctfail.t -t/40-pamdeny.t -t/50-nxuserip.t -t/boilerplate.t -t/lib/perlcriticrc -t/lib/vma.conf -t/lib/qvdok -t/lib/qvdsessfail -t/lib/qvdacctfail -t/lib/qvdfail -t/manifest.t -t/perlcritic.t -t/pod-coverage.t -t/pod.t -META.yml Module meta-data (added by MakeMaker) diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST.SKIP perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST.SKIP --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST.SKIP 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/MANIFEST.SKIP 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -blib.* -Makefile -Makefile.old -Build -Build.bat -_build.* -pm_to_blib.* -.*\.tar\.gz -.lwpcookies -cover_db -pod2htm*.tmp -QVD-L7R-Authenticator-Plugin-Nacar-* -\.svn -.*~ -^debian/ \ No newline at end of file diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/META.yml perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/META.yml --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/META.yml 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/META.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,29 +0,0 @@ ---- #YAML:1.0 -name: QVD-VmaHook-NACAR -version: 3.116714 -abstract: Runs several hooks related with Nacar initialization -author: - - QVD Team -license: gpl -distribution_type: module -configure_requires: - ExtUtils::MakeMaker: 0 -build_requires: - ExtUtils::MakeMaker: 0 -requires: - Authen::PAM: 0 - File::Copy: 0 - File::HomeDir: 0 - File::Slurp: 0 - File::Spec: 0 - File::Temp: 0 - Socket: 0 - Test::More: 0 -no_index: - directory: - - t - - inc -generated_by: ExtUtils::MakeMaker version 6.57_05 -meta-spec: - url: http://module-build.sourceforge.net/META-spec-v1.4.html - version: 1.4 diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Makefile.PL perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Makefile.PL --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Makefile.PL 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/Makefile.PL 1970-01-01 00:00:00.000000000 +0000 @@ -1,28 +0,0 @@ -use strict; -use warnings; -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'QVD::VmaHook::NACAR', - AUTHOR => q{QVD Team }, - ABSTRACT_FROM => 'lib/QVD/VmaHook/NACAR.pm', - LICENSE => 'gpl', - PL_FILES => {}, - VERSION => '3.1'.$ENV{BUILD_NUMBER}, - PREREQ_PM => { - 'Test::More' => 0, - 'Authen::PAM' => 0, - 'File::HomeDir' => 0, - 'File::Spec' => 0, - 'File::Temp' => 0, - 'File::Slurp' => 0, - 'File::Copy' => 0, - 'Socket' => 0, - - }, - 'EXE_FILES' => [ - 'bin/qvd_nacar_hook.pl' - ], - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, - clean => { FILES => 'QVD-VmaHook-NACAR-*' }, -); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/README perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/README --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/README 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/README 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -QVD-VmaHook-NACAR - -Perl hook to perform the following tasks: - - * Get the info from QVD-L7R-Authenticator-Plugin-Nacar, and run the various bits - needed for NACAR - - -INSTALLATION - -To install this module, run the following commands: - - perl Makefile.PL - make - make test - make install - -SUPPORT AND DOCUMENTATION - -After installing, you can find documentation for this module with the -perldoc command. - - perldoc QVD::VmaHook::NACAR - -You can also look for information at L - -LICENSE AND COPYRIGHT - -Copyright (C) 2011 QVD Team - -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 -the Free Software Foundation; version 2 dated June, 1991 or at your option -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -A copy of the GNU General Public License is available in the source tree; -if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/nacar_hook_qvd.pl perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/nacar_hook_qvd.pl --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/nacar_hook_qvd.pl 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/nacar_hook_qvd.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,11 +0,0 @@ -#!/usr/bin/perl -# - -use strict; -use warnings; -use QVD::Log; -use QVD::VmaHook::NACAR qw(init_nacar_from_qvd); -use Data::Dumper; - -DEBUG "The arguments are:".Dumper(\@ARGV); -init_nacar_from_qvd(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/qvd_nacar_hook.pl perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/qvd_nacar_hook.pl --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/qvd_nacar_hook.pl 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/bin/qvd_nacar_hook.pl 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -#!/usr/bin/perl -# - -use strict; -use warnings; -use Data::Dumper; - -BEGIN { - $QVD::Config::USE_DB = 0; - @QVD::Config::FILES = ('/etc/qvd/vma.conf'); -} - -use QVD::Config; -use QVD::Log; -use QVD::VmaHook::NACAR qw(init_nacar_from_qvd); - -DEBUG "The arguments are:".Dumper(\@ARGV); -my $result = init_nacar_from_qvd(\@ARGV); -my $exit_value = ($result ? 0 : 1); -exit $exit_value; - -=head1 qvd_nacar_hook.pl - -=head1 DESCRIPTION - -See L - -=head1 AUTHOR - -QVD Team, C<< >> - -=head1 SUPPORT - -You can find documentation for this module with the perldoc command. - - perldoc QVD::VmaHook::NACAR - -Please contact L For support - -=head1 ACKNOWLEDGEMENTS - - -=head1 LICENSE AND COPYRIGHT - -Copyright 2011 QVD Team. - -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 -the Free Software Foundation; version 2 dated June, 1991 or at your option -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -A copy of the GNU General Public License is available in the source tree; -if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -=cut diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/lib/QVD/VmaHook/NACAR.pm perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/lib/QVD/VmaHook/NACAR.pm --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/lib/QVD/VmaHook/NACAR.pm 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/lib/QVD/VmaHook/NACAR.pm 1970-01-01 00:00:00.000000000 +0000 @@ -1,423 +0,0 @@ -package QVD::VmaHook::NACAR; - -use warnings; -use strict; - -# ensure we load the VMA configuration - -use QVD::Config; -use QVD::Log; -use Authen::PAM; -use Carp; -use File::Spec; -use File::Copy; -use File::Slurp; -use Exporter qw(import); -our @EXPORT_OK = qw(init_nacar_from_qvd start_pam setEnvVars); - -# Needed for the conv func -my ($global_login, $global_password); -my $user_envfile=cfg('qvd.vmahook.nacar.envfile', 0) // '.xsessionrc'; -my $clientipname=cfg('qvd.vmahook.nacar.clientip_var', 0) // 'CLIENTIP'; -my $clienthostname=cfg('qvd.vmahook.nacar.hostname_var', 0) // 'CLIENTHOSTNAME'; -my $clientsucursalname=cfg('qvd.vmahook.nacar.sucursal_var', 0) // 'CLIENTSUCURSAL'; -my $clientpuestoname=cfg('qvd.vmahook.nacar.puesto_var', 0) // 'PUESTO'; - -=head1 NAME - -QVD::VmaHook::NACAR - Runs several hooks related with Nacar initialization - -=head1 VERSION - -Version 0.06 - -=cut - -our $VERSION = '0.06'; - -=head1 DESCRIPTION - -This module invokes: - -=over 4 - -=item * Pam module specified by qvd.auth.nacar.pam_service, with the credentials specified by qvd.auth.nacar.login and qvd.auth.nacar.passwd - -=item * Sets the environment variable CLIENTIP to from qvd.auth.nacar.clientip - -=back - -This module receives the following parameters: - -=over 4 - -=item * The Client IP for the authentication. This is the ip that the L7R sees as the origin of the communication. The parameter passed is to the VMA hook is: qvd.auth.nacar.clientip - -=item * The client hostname corresponding to the client ip address. The parameter passed to the VMA hook is: qvd.auth.nacar.hostname - -=item * The Number of the branch (4 digits). The parameter passed to the VMA hook is: qvd.auth.nacar.sucursal - -=item * The "puesto" (2 digits). The parameter passed to the VMA hook is: qvd.auth.nacar.puesto - -=item * The pam service to authenticate in the hook. The parameter passed is to the VMA hook is: qvd.auth.nacar.pam_service. By default this is "qvd" - -=item * Credentials so that the pam_sentry module can be invoked. - -=over 4 - -=item * qvd.vm.user.name The username used for login - -=item * qvd.auth.nacar.passwd The password used for login - -=back - -=back - -=head1 INSTALLATION - -Please install the module in the target image and do not forget to set up the following entry in the /etc/qvd/vma.conf file in the image - -vma.on_action.connect=/usr/bin/qvd_nacar_hook.pl - -You need also define the /etc/pam.d/qvd service. An example file is t/lib/qvdok - - # Test pam file for service qvd -# -auth required pam_warn.so -auth required pam_permit.so -account required pam_warn.so -account required pam_permit.so -password required pam_warn.so -password required pam_permit.so -session required pam_warn.so -session required pam_permit.so - -=head1 OPTIONS - -you can set the following options in vma.conf - -=over 4 - -=item * qvd.vmahook.nacar.envfile. This is the file where the environment variable holding the client ip (received with the parameter qvd.auth.nacar.clientip) is going to be set. By default it is .xsessionrc - -=item * qvd.vmahook.nacar.clientip_var. This is the name of the environment variable that is set with the parameter received qvd.auth.nacar.clientip. By default the name of the variable is named CLIENTIP. - -=back - -=head1 SUBROUTINES/METHODS - -=head2 init_nacar_from_qvd - -Receives as argument a reference to the array @ARGV - -Calls setup_bbvacfgxml, add_server_to_etc_hosts, start_pam and setEnvVars - -Example @ARGV to use -my @_ = ( - 'qvd.auth.nacar.pam_service', 'qvd', - 'qvd.vm.user.name', 'testuser', - 'qvd.auth.nacar.passwd', 'testpass', - 'qvd.auth.nacar.clientip', '127.0.0.2' - ); - -=cut - -sub init_nacar_from_qvd { - my $argv = shift; - my %args = @$argv; - - umask 0022; - my ($result, $result2, $result3, $result4); - if (!exists($args{'qvd.vm.user.name'}) - || !exists($args{'qvd.auth.nacar.hostname'}) - || !exists($args{'qvd.auth.nacar.sucursal'}) - || !exists($args{'qvd.auth.nacar.clientip'}) - || !exists($args{'qvd.auth.nacar.puesto'}) - || !exists($args{'qvd.vm.user.home'}) - ) { - ERROR "parameters qvd.vm.user.name, qvd.vm.user.home, qvd.auth.nacar.hostname, qvd.auth.nacar.sucursal, qvd.auth.nacar.clientip, qvd.auth.nacar.puesto were not passed not setting $clientipname in $user_envfile:".join(" ", @$argv);; - return 0; - } - if (!exists($args{'qvd.auth.nacar.pam_service'}) || !exists($args{'qvd.vm.user.name'}) || !exists($args{'qvd.auth.nacar.passwd'})) { - ERROR "parameters qvd.auth.nacar.pam_service qvd.vm.user.name and qvd.auth.nacar.passwd were not passed not invoking pam service"; - return 0; - } - # pam must be first because it creates the home directory with pam_mkdir - my $login = $args{'qvd.vm.user.name'}; - $result2 = start_pam($args{'qvd.auth.nacar.pam_service'}, $login, $args{'qvd.auth.nacar.passwd'}); - - $result = setEnvVars($args{'qvd.vm.user.home'}, $login, $args{'qvd.auth.nacar.hostname'}, $args{'qvd.auth.nacar.sucursal'}, $args{'qvd.auth.nacar.clientip'}, $args{'qvd.auth.nacar.puesto'}); - - fix_tmp_x11_unix_perm(); - - DEBUG 'result='.($result//'undef').';result2='.($result2//'undef')."\n"; - - return ($result && $result2); -} - - - - -# =head2 add_server_to_etc_hosts - -# Does a dns lookup of s0${numsucursal}00 and adds that to /etc/hosts -# with an alias of server (used for automounter and other elements) - -# Returns 1 on success and 0 otherwise (failure in DNS resolution) - -# =cut -# sub add_server_to_etc_hosts { -# my $sucursal = shift; -# my $result = 0; -# my $hosts = '/etc/hosts'; -# my $domainname = qx{dnsdomainname}; -# chomp $domainname; -# my $server = 's0'.$sucursal.'00'; - -# $domainname = !defined($domainname) ? '' : $domainname; - -# # TODO -# my $output = read_file($hosts); -# if (!defined($output)) { -# ERROR "Error reading file $hosts"; -# return 0; -# } -# # Remove old server hostname qvd-1 -# $output =~ s/^[^#].*?\sserver\s.*$//xmg; -# $output =~ s/^[^#].*?\sserver$//xmg; -# $output =~ s/^[^#].*?\s$server\s.*$//xmg; -# $output =~ s/^[^#].*?\s$server$//xmg; -# # Add fake container hostname and ip -# $output .= "$hostip $server.$domainname $server server\n"; -# $result = write_file($hosts, $output); -# if (!$result) { -# ERROR "Error writing file $hosts"; -# return 0; -# } -# INFO "Written hostname entry with ip $hostip $server.$domainname and server to $hosts"; - -# return 1; -# } - -=head2 start_pam - -Args: service, login, password - -=cut -sub _my_conv_func { - my @res; - ERROR "Invoked _my_conv_func"; - while ( @_ ) { - my $code = shift; - my $msg = shift; - my $ans = ""; - - $ans = $global_login if ($code == PAM_PROMPT_ECHO_ON() ); - $ans = $global_password if ($code == PAM_PROMPT_ECHO_OFF() ); - - push @res, (PAM_SUCCESS(),$ans); - } - push @res, PAM_SUCCESS(); - return @res; -} - -sub start_pam { - my ($service, $login, $password) = @_; - DEBUG "Invoked pam with $service, $login, $password"; - $global_login = $login; - $global_password = $password; - my $pamh = Authen::PAM->new($service, $login, \&_my_conv_func); - if (!(ref $pamh)) { - ERROR "Error code $pamh during PAM init for service $service and login $login!"; - return (); - } - { - my $res_auth = $pamh->pam_authenticate(); - if ($res_auth != PAM_SUCCESS()) { - ERROR "PAM Authentication did not succeed although it should because of architecture service $service and login $login (ldap was ok but pam_sentry is not!!!):".$res_auth; - return (); - } - DEBUG "PAM Authentication succeeded with service $service and login $login"; - } - { - my $res_mgmt = $pamh->pam_acct_mgmt(); - if ($res_mgmt != PAM_SUCCESS()) { - ERROR "PAM Accounting did not succeed although it should because of architecture service $service and login $login (Check your PAM settings for /etc/pam.d/$service for account entries authentication worked but Account not? is not!!!):".$res_mgmt; - return (); - } - DEBUG "PAM Accounting succeeded with service $service and login $login"; - } - - { - my $res_ses = $pamh->pam_open_session(); - if ($res_ses != PAM_SUCCESS()) { - ERROR "PAM Open Session did not succeed although it should because of architecture service $service and login $login (check sessin entries in /etc/pam.d/$service authentication and account was ok but session is not!!!):".$res_ses; - return (); - } - DEBUG "PAM open_session succeeded with service $service and login $login"; - } - INFO "PAM succeeded for service $service and login $login"; - return 1; -} - - -=head2 setEnvVars - -Args: login, ip - -Sets the CLIENTIP env variable in the $HOME/.xsessionrc file - -this can be modified with: - - * qvd.vmahook.nacar.envfile By default .xsessionrc - * qvd.vmahook.nacar.clientip_var by default CLIENTIP - -=cut - - -sub setEnvVars { - my ($home, $login, $hostname, $sucursal, $clientip, $puesto) = @_; - - my $envfile = File::Spec->catfile($home, $user_envfile); - if (!-f $envfile) { - write_file($envfile, - "export $clientipname=$clientip\n". - "export $clienthostname=$hostname\n". - "export $clientsucursalname=$sucursal\n". - "export $clientpuestoname=$puesto\n" - ); - INFO "Created new file $envfile to set property $clientipname=$clientip"; - return 1; - } - - my $filecontent = read_file($envfile); - my @regex = ( - '^export\s+'.$clientipname.'=.*$', - '^export\s+'.$clienthostname.'=.*$', - '^export\s+'.$clientsucursalname.'=.*$', - '^export\s+'.$clientpuestoname.'=.*$', - ); - - DEBUG "before setting CLIENTIP var <$clientipname> <$clienthostname> <$clientsucursalname> <$clientpuestoname> in file <$envfile> for file content <$filecontent>"; - my $regex = '^export\s+'.$clientipname.'=.*$'; - foreach my $regex (@regex) { - $filecontent =~ s/$regex//mgx; - } - $filecontent .= "export $clientipname=$clientip\n". - "export $clienthostname=$hostname\n". - "export $clientsucursalname=$sucursal\n". - "export $clientpuestoname=$puesto\n"; - - DEBUG "after setting CLIENTIP var <$clientipname> <$clienthostname> <$clientsucursalname> <$clientpuestoname> in file <$envfile> for file content <$filecontent>"; - - write_file($envfile, $filecontent); - INFO "Updated file $envfile to set property $clientipname=$clientip"; - - return 1; -} - -=head2 fix_tmp_x11_unix_perm - -sets up and the /tmp/.X11-unix/ dir to mode 1777 - -=cut - -sub fix_tmp_x11_unix_perm { - my $dir = '/tmp'; - if (!-d $dir) { - mkdir $dir; - INFO "Creating manually directory $dir in SUSE"; - } - chmod 01777, $dir; - INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; - $dir = '/tmp/.X11-unix'; - if (!-d $dir) { - mkdir $dir; - INFO "Creating manually directory $dir in SUSE"; - } - chmod 01777, $dir; - INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; - $dir = '/var/tmp'; - if (!-d $dir) { - mkdir $dir; - INFO "Creating manually directory $dir in SUSE"; - } - chmod 01777, $dir; - INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; - return 1; -} - - -sub _end_pam { - # Should invoke pam_close_session - # probably on vma.on_action.stop vma.on_action.poweroff -} - -1; -__END__ - - -=head1 AUTHOR - -QVD Team, C<< >> - -=head1 TODO - -=over 4 - -=item * Update /etc/hosts with server entry (based on sucursal number), for auto.master and auto.files - -=item * See what should be done if the parameters are not passed - -=back - -=head1 BUGS - -=over 4 - -=item * qvd.vm.user.name nito qvd.auth.nacar.passwd IxneobpdeG qvd.client.link local qvd.auth.nacar.clientip 80.33.123.33 qvd.vm.user.home /home/nito qvd.vm.user.groups qvd.client.os linux qvd.client.geometry 800x600 qvd.client.fullscreen qvd.client.keyboard pc105/us qvd.client.printing.enabled qvd.auth.nacar.pam_service qvd qvd.auth.nacar.login nito qvd.vm.session.state starting qvd.hook.on_action connect - - -my @testargs = ( - 'qvd.auth.nacar.pam_service', $testservice, - 'qvd.vm.user.name', 'testuser', - 'qvd.auth.nacar.passwd', 'testpass', - 'qvd.auth.nacar.clientip', '127.0.0.2' - ); - - -=back - -=head1 SUPPORT - -You can find documentation for this module with the perldoc command. - - perldoc QVD::VmaHook::NACAR - -Please contact L For support - -=head1 ACKNOWLEDGEMENTS - - -=head1 LICENSE AND COPYRIGHT - -Copyright 2011 QVD Team. - -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 -the Free Software Foundation; version 2 dated June, 1991 or at your option -any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -A copy of the GNU General Public License is available in the source tree; -if not, write to the Free Software Foundation, Inc., -59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - -=cut - -1; # End of QVD::VmaHook::NACAR diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/00-load.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/00-load.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/00-load.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/00-load.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,15 +0,0 @@ -#!perl -T - -use Test::More; - -BEGIN { - if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); - } - use_ok( 'QVD::VmaHook::NACAR' ) || print "Bail out! -"; -} - -diag( "Testing QVD::VmaHook::NACAR $QVD::VmaHook::NACAR::VERSION, Perl $], $^X" ); -done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/10-pampermit.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/10-pampermit.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/10-pampermit.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/10-pampermit.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,25 +0,0 @@ -#!perl -T -use strict; -use warnings; - -use Test::More; -BEGIN { - use File::Spec; - my ($volume,$directories,$file) = File::Spec->splitpath($0); - push @INC, $directories; - $QVD::Config::USE_DB = 0; - @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); -} -use QVD::Config; -my $testservice='qvdok'; -my $testpamfile="/etc/pam.d/$testservice"; - -if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); -} -use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); -ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); -ok(start_pam($testservice, 'testuser', 'testpass', "Should pass")); - -done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/20-pamsessfail.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/20-pamsessfail.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/20-pamsessfail.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/20-pamsessfail.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,26 +0,0 @@ -#!perl -T -use strict; -use warnings; - -use Test::More; -BEGIN { - use File::Spec; - my ($volume,$directories,$file) = File::Spec->splitpath($0); - push @INC, $directories; - $QVD::Config::USE_DB = 0; - @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); -} -use QVD::Config; -my $testservice='qvdsessfail'; -my $testpamfile="/etc/pam.d/$testservice"; - -if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); -} -use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); - -ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); -ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); - -done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/30-pamacctfail.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/30-pamacctfail.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/30-pamacctfail.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/30-pamacctfail.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!perl -T -use strict; -use warnings; - -use Test::More; -BEGIN { - use File::Spec; - my ($volume,$directories,$file) = File::Spec->splitpath($0); - push @INC, $directories; - $QVD::Config::USE_DB = 0; - @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); -} -use QVD::Config; -my $testservice='qvdacctfail'; -my $testpamfile="/etc/pam.d/$testservice"; - -if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); -} -use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); - - -ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); -ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); - -done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/40-pamdeny.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/40-pamdeny.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/40-pamdeny.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/40-pamdeny.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -#!perl -T -use strict; -use warnings; - -use Test::More; -BEGIN { - use File::Spec; - my ($volume,$directories,$file) = File::Spec->splitpath($0); - push @INC, $directories; - $QVD::Config::USE_DB = 0; - @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); -} -use QVD::Config; -my $testservice='qvdfail'; -my $testpamfile="/etc/pam.d/$testservice"; - -if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); -} -use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); - - -ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); -ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); - -done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/boilerplate.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/boilerplate.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/boilerplate.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/boilerplate.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,55 +0,0 @@ -#!perl -T - -use strict; -use warnings; -use Test::More tests => 3; - -sub not_in_file_ok { - my ($filename, %regex) = @_; - open( my $fh, '<', $filename ) - or die "couldn't open $filename for reading: $!"; - - my %violated; - - while (my $line = <$fh>) { - while (my ($desc, $regex) = each %regex) { - if ($line =~ $regex) { - push @{$violated{$desc}||=[]}, $.; - } - } - } - - if (%violated) { - fail("$filename contains boilerplate text"); - diag "$_ appears on lines @{$violated{$_}}" for keys %violated; - } else { - pass("$filename contains no boilerplate text"); - } -} - -sub module_boilerplate_ok { - my ($module) = @_; - not_in_file_ok($module => - 'the great new $MODULENAME' => qr/ - The great new /, - 'boilerplate description' => qr/Quick summary of what the module/, - 'stub function definition' => qr/function[12]/, - ); -} - -TODO: { - local $TODO = "Need to replace the boilerplate text"; - - not_in_file_ok(README => - "The README is used..." => qr/The README is used/, - "'version information here'" => qr/to provide version information/, - ); - - not_in_file_ok(Changes => - "placeholder date/time" => qr(Date/time) - ); - - module_boilerplate_ok('lib/QVD/VmaHook/NACAR.pm'); - - -} - diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/perlcriticrc perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/perlcriticrc --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/perlcriticrc 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/perlcriticrc 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -severity=3 - -[TestingAndDebugging::ProhibitNoWarnings] -allow = exec - -[Subroutines::RequireArgUnpacking] -short_subroutine_statements = 6 - -[Subroutines::ProhibitExcessComplexity] -max_mccabe = 30 diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdacctfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdacctfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdacctfail 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdacctfail 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# Test pam file for service qvdok -# -auth required pam_warn.so -auth required pam_permit.so -account required pam_warn.so -account required pam_deny.so -password required pam_warn.so -password required pam_deny.so -session required pam_warn.so -session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdfail 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdfail 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# Test pam file for service qvdok -# -auth required pam_warn.so -auth required pam_deny.so -account required pam_warn.so -account required pam_deny.so -password required pam_warn.so -password required pam_deny.so -session required pam_warn.so -session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdok perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdok --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdok 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdok 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# Test pam file for service qvdok -# -auth required pam_warn.so -auth required pam_permit.so -account required pam_warn.so -account required pam_permit.so -password required pam_warn.so -password required pam_permit.so -session required pam_warn.so -session required pam_permit.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdsessfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdsessfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdsessfail 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/qvdsessfail 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# Test pam file for service qvdok -# -auth required pam_warn.so -auth required pam_permit.so -account required pam_warn.so -account required pam_permit.so -password required pam_warn.so -password required pam_permit.so -session required pam_warn.so -session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/vma.conf perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/vma.conf --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/vma.conf 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/lib/vma.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -# Example vma.conf for testing -log.level=DEBUG -qvd.vmahook.nacar.envfile=.test.xsessionrc \ No newline at end of file diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/manifest.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/manifest.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/manifest.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/manifest.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,13 +0,0 @@ -#!perl -T - -use strict; -use warnings; -use Test::More; - -unless ( $ENV{RELEASE_TESTING} ) { - plan( skip_all => "Author tests not required for installation" ); -} - -eval "use Test::CheckManifest 0.9"; -plan skip_all => "Test::CheckManifest 0.9 required" if $@; -ok_manifest(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/perlcritic.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/perlcritic.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/perlcritic.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/perlcritic.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -#!perl -T -use strict; -use warnings; -use File::Spec; -use Test::More; -use English qw(-no_match_vars); - -if ( not $ENV{TEST_AUTHOR} ) { - my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; - plan( skip_all => $msg ); -} - -eval { require Test::Perl::Critic; }; - -if ( $EVAL_ERROR ) { - my $msg = 'Test::Perl::Critic required to criticise code'; - plan( skip_all => $msg ); -} - -my $rcfile = File::Spec->catfile( 't', 'lib', 'perlcriticrc' ); -Test::Perl::Critic->import( -profile => $rcfile ); -all_critic_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod-coverage.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod-coverage.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod-coverage.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod-coverage.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -use strict; -use warnings; -use Test::More; - -# Ensure a recent version of Test::Pod::Coverage -my $min_tpc = 1.08; -eval "use Test::Pod::Coverage $min_tpc"; -plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" - if $@; - -# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, -# but older versions don't recognize some common documentation styles -my $min_pc = 0.18; -eval "use Pod::Coverage $min_pc"; -plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" - if $@; - -all_pod_coverage_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod.t 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116714/t/pod.t 1970-01-01 00:00:00.000000000 +0000 @@ -1,12 +0,0 @@ -#!perl -T - -use strict; -use warnings; -use Test::More; - -# Ensure a recent version of Test::Pod -my $min_tp = 1.22; -eval "use Test::Pod $min_tp"; -plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; - -all_pod_files_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Changes perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Changes --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Changes 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Changes 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,11 @@ +Revision history for QVD-VmaHook-NACAR + +0.04 9/12/2011 + fix x11 permissions + +0.02 15/10/2011 + PAM tests + +0.01 Date/time + First version, released 13/10/2011 + diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,26 @@ +bin/nacar_hook_qvd.pl +bin/qvd_nacar_hook.pl +Changes +lib/QVD/VmaHook/NACAR.pm +Makefile.PL +MANIFEST +MANIFEST.SKIP +README +t/00-load.t +t/10-pampermit.t +t/20-pamsessfail.t +t/30-pamacctfail.t +t/40-pamdeny.t +t/50-nxuserip.t +t/boilerplate.t +t/lib/perlcriticrc +t/lib/vma.conf +t/lib/qvdok +t/lib/qvdsessfail +t/lib/qvdacctfail +t/lib/qvdfail +t/manifest.t +t/perlcritic.t +t/pod-coverage.t +t/pod.t +META.yml Module meta-data (added by MakeMaker) diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST.SKIP perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST.SKIP --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST.SKIP 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/MANIFEST.SKIP 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,15 @@ +blib.* +Makefile +Makefile.old +Build +Build.bat +_build.* +pm_to_blib.* +.*\.tar\.gz +.lwpcookies +cover_db +pod2htm*.tmp +QVD-L7R-Authenticator-Plugin-Nacar-* +\.svn +.*~ +^debian/ \ No newline at end of file diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/META.yml perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/META.yml --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/META.yml 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/META.yml 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,29 @@ +--- #YAML:1.0 +name: QVD-VmaHook-NACAR +version: 3.116728 +abstract: Runs several hooks related with Nacar initialization +author: + - QVD Team +license: gpl +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: + Authen::PAM: 0 + File::Copy: 0 + File::HomeDir: 0 + File::Slurp: 0 + File::Spec: 0 + File::Temp: 0 + Socket: 0 + Test::More: 0 +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.57_05 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Makefile.PL perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Makefile.PL --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Makefile.PL 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/Makefile.PL 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,28 @@ +use strict; +use warnings; +use ExtUtils::MakeMaker; + +WriteMakefile( + NAME => 'QVD::VmaHook::NACAR', + AUTHOR => q{QVD Team }, + ABSTRACT_FROM => 'lib/QVD/VmaHook/NACAR.pm', + LICENSE => 'gpl', + PL_FILES => {}, + VERSION => '3.1'.$ENV{BUILD_NUMBER}, + PREREQ_PM => { + 'Test::More' => 0, + 'Authen::PAM' => 0, + 'File::HomeDir' => 0, + 'File::Spec' => 0, + 'File::Temp' => 0, + 'File::Slurp' => 0, + 'File::Copy' => 0, + 'Socket' => 0, + + }, + 'EXE_FILES' => [ + 'bin/qvd_nacar_hook.pl' + ], + dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', }, + clean => { FILES => 'QVD-VmaHook-NACAR-*' }, +); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/README perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/README --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/README 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/README 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,44 @@ +QVD-VmaHook-NACAR + +Perl hook to perform the following tasks: + + * Get the info from QVD-L7R-Authenticator-Plugin-Nacar, and run the various bits + needed for NACAR + + +INSTALLATION + +To install this module, run the following commands: + + perl Makefile.PL + make + make test + make install + +SUPPORT AND DOCUMENTATION + +After installing, you can find documentation for this module with the +perldoc command. + + perldoc QVD::VmaHook::NACAR + +You can also look for information at L + +LICENSE AND COPYRIGHT + +Copyright (C) 2011 QVD Team + +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 +the Free Software Foundation; version 2 dated June, 1991 or at your option +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +A copy of the GNU General Public License is available in the source tree; +if not, write to the Free Software Foundation, Inc., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/nacar_hook_qvd.pl perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/nacar_hook_qvd.pl --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/nacar_hook_qvd.pl 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/nacar_hook_qvd.pl 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,11 @@ +#!/usr/bin/perl +# + +use strict; +use warnings; +use QVD::Log; +use QVD::VmaHook::NACAR qw(init_nacar_from_qvd); +use Data::Dumper; + +DEBUG "The arguments are:".Dumper(\@ARGV); +init_nacar_from_qvd(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/qvd_nacar_hook.pl perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/qvd_nacar_hook.pl --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/qvd_nacar_hook.pl 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/bin/qvd_nacar_hook.pl 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,62 @@ +#!/usr/bin/perl +# + +use strict; +use warnings; +use Data::Dumper; + +BEGIN { + $QVD::Config::USE_DB = 0; + @QVD::Config::FILES = ('/etc/qvd/vma.conf'); +} + +use QVD::Config; +use QVD::Log; +use QVD::VmaHook::NACAR qw(init_nacar_from_qvd); + +DEBUG "The arguments are:".Dumper(\@ARGV); +my $result = init_nacar_from_qvd(\@ARGV); +my $exit_value = ($result ? 0 : 1); +exit $exit_value; + +=head1 qvd_nacar_hook.pl + +=head1 DESCRIPTION + +See L + +=head1 AUTHOR + +QVD Team, C<< >> + +=head1 SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc QVD::VmaHook::NACAR + +Please contact L For support + +=head1 ACKNOWLEDGEMENTS + + +=head1 LICENSE AND COPYRIGHT + +Copyright 2011 QVD Team. + +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 +the Free Software Foundation; version 2 dated June, 1991 or at your option +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +A copy of the GNU General Public License is available in the source tree; +if not, write to the Free Software Foundation, Inc., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +=cut diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/lib/QVD/VmaHook/NACAR.pm perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/lib/QVD/VmaHook/NACAR.pm --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/lib/QVD/VmaHook/NACAR.pm 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/lib/QVD/VmaHook/NACAR.pm 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,423 @@ +package QVD::VmaHook::NACAR; + +use warnings; +use strict; + +# ensure we load the VMA configuration + +use QVD::Config; +use QVD::Log; +use Authen::PAM; +use Carp; +use File::Spec; +use File::Copy; +use File::Slurp; +use Exporter qw(import); +our @EXPORT_OK = qw(init_nacar_from_qvd start_pam setEnvVars); + +# Needed for the conv func +my ($global_login, $global_password); +my $user_envfile=cfg('qvd.vmahook.nacar.envfile', 0) // '.xsessionrc'; +my $clientipname=cfg('qvd.vmahook.nacar.clientip_var', 0) // 'CLIENTIP'; +my $clienthostname=cfg('qvd.vmahook.nacar.hostname_var', 0) // 'CLIENTHOSTNAME'; +my $clientsucursalname=cfg('qvd.vmahook.nacar.sucursal_var', 0) // 'CLIENTSUCURSAL'; +my $clientpuestoname=cfg('qvd.vmahook.nacar.puesto_var', 0) // 'PUESTO'; + +=head1 NAME + +QVD::VmaHook::NACAR - Runs several hooks related with Nacar initialization + +=head1 VERSION + +Version 0.06 + +=cut + +our $VERSION = '0.06'; + +=head1 DESCRIPTION + +This module invokes: + +=over 4 + +=item * Pam module specified by qvd.auth.nacar.pam_service, with the credentials specified by qvd.auth.nacar.login and qvd.auth.nacar.passwd + +=item * Sets the environment variable CLIENTIP to from qvd.auth.nacar.clientip + +=back + +This module receives the following parameters: + +=over 4 + +=item * The Client IP for the authentication. This is the ip that the L7R sees as the origin of the communication. The parameter passed is to the VMA hook is: qvd.auth.nacar.clientip + +=item * The client hostname corresponding to the client ip address. The parameter passed to the VMA hook is: qvd.auth.nacar.hostname + +=item * The Number of the branch (4 digits). The parameter passed to the VMA hook is: qvd.auth.nacar.sucursal + +=item * The "puesto" (2 digits). The parameter passed to the VMA hook is: qvd.auth.nacar.puesto + +=item * The pam service to authenticate in the hook. The parameter passed is to the VMA hook is: qvd.auth.nacar.pam_service. By default this is "qvd" + +=item * Credentials so that the pam_sentry module can be invoked. + +=over 4 + +=item * qvd.vm.user.name The username used for login + +=item * qvd.auth.nacar.passwd The password used for login + +=back + +=back + +=head1 INSTALLATION + +Please install the module in the target image and do not forget to set up the following entry in the /etc/qvd/vma.conf file in the image + +vma.on_action.connect=/usr/bin/qvd_nacar_hook.pl + +You need also define the /etc/pam.d/qvd service. An example file is t/lib/qvdok + + # Test pam file for service qvd +# +auth required pam_warn.so +auth required pam_permit.so +account required pam_warn.so +account required pam_permit.so +password required pam_warn.so +password required pam_permit.so +session required pam_warn.so +session required pam_permit.so + +=head1 OPTIONS + +you can set the following options in vma.conf + +=over 4 + +=item * qvd.vmahook.nacar.envfile. This is the file where the environment variable holding the client ip (received with the parameter qvd.auth.nacar.clientip) is going to be set. By default it is .xsessionrc + +=item * qvd.vmahook.nacar.clientip_var. This is the name of the environment variable that is set with the parameter received qvd.auth.nacar.clientip. By default the name of the variable is named CLIENTIP. + +=back + +=head1 SUBROUTINES/METHODS + +=head2 init_nacar_from_qvd + +Receives as argument a reference to the array @ARGV + +Calls setup_bbvacfgxml, add_server_to_etc_hosts, start_pam and setEnvVars + +Example @ARGV to use +my @_ = ( + 'qvd.auth.nacar.pam_service', 'qvd', + 'qvd.vm.user.name', 'testuser', + 'qvd.auth.nacar.passwd', 'testpass', + 'qvd.auth.nacar.clientip', '127.0.0.2' + ); + +=cut + +sub init_nacar_from_qvd { + my $argv = shift; + my %args = @$argv; + + umask 0022; + my ($result, $result2, $result3, $result4); + if (!exists($args{'qvd.vm.user.name'}) + || !exists($args{'qvd.auth.nacar.hostname'}) + || !exists($args{'qvd.auth.nacar.sucursal'}) + || !exists($args{'qvd.auth.nacar.clientip'}) + || !exists($args{'qvd.auth.nacar.puesto'}) + || !exists($args{'qvd.vm.user.home'}) + ) { + ERROR "parameters qvd.vm.user.name, qvd.vm.user.home, qvd.auth.nacar.hostname, qvd.auth.nacar.sucursal, qvd.auth.nacar.clientip, qvd.auth.nacar.puesto were not passed not setting $clientipname in $user_envfile:".join(" ", @$argv);; + return 0; + } + if (!exists($args{'qvd.auth.nacar.pam_service'}) || !exists($args{'qvd.vm.user.name'}) || !exists($args{'qvd.auth.nacar.passwd'})) { + ERROR "parameters qvd.auth.nacar.pam_service qvd.vm.user.name and qvd.auth.nacar.passwd were not passed not invoking pam service"; + return 0; + } + # pam must be first because it creates the home directory with pam_mkdir + my $login = $args{'qvd.vm.user.name'}; + $result2 = start_pam($args{'qvd.auth.nacar.pam_service'}, $login, $args{'qvd.auth.nacar.passwd'}); + + $result = setEnvVars($args{'qvd.vm.user.home'}, $login, $args{'qvd.auth.nacar.hostname'}, $args{'qvd.auth.nacar.sucursal'}, $args{'qvd.auth.nacar.clientip'}, $args{'qvd.auth.nacar.puesto'}); + + fix_tmp_x11_unix_perm(); + + DEBUG 'result='.($result//'undef').';result2='.($result2//'undef')."\n"; + + return ($result && $result2); +} + + + + +# =head2 add_server_to_etc_hosts + +# Does a dns lookup of s0${numsucursal}00 and adds that to /etc/hosts +# with an alias of server (used for automounter and other elements) + +# Returns 1 on success and 0 otherwise (failure in DNS resolution) + +# =cut +# sub add_server_to_etc_hosts { +# my $sucursal = shift; +# my $result = 0; +# my $hosts = '/etc/hosts'; +# my $domainname = qx{dnsdomainname}; +# chomp $domainname; +# my $server = 's0'.$sucursal.'00'; + +# $domainname = !defined($domainname) ? '' : $domainname; + +# # TODO +# my $output = read_file($hosts); +# if (!defined($output)) { +# ERROR "Error reading file $hosts"; +# return 0; +# } +# # Remove old server hostname qvd-1 +# $output =~ s/^[^#].*?\sserver\s.*$//xmg; +# $output =~ s/^[^#].*?\sserver$//xmg; +# $output =~ s/^[^#].*?\s$server\s.*$//xmg; +# $output =~ s/^[^#].*?\s$server$//xmg; +# # Add fake container hostname and ip +# $output .= "$hostip $server.$domainname $server server\n"; +# $result = write_file($hosts, $output); +# if (!$result) { +# ERROR "Error writing file $hosts"; +# return 0; +# } +# INFO "Written hostname entry with ip $hostip $server.$domainname and server to $hosts"; + +# return 1; +# } + +=head2 start_pam + +Args: service, login, password + +=cut +sub _my_conv_func { + my @res; + ERROR "Invoked _my_conv_func"; + while ( @_ ) { + my $code = shift; + my $msg = shift; + my $ans = ""; + + $ans = $global_login if ($code == PAM_PROMPT_ECHO_ON() ); + $ans = $global_password if ($code == PAM_PROMPT_ECHO_OFF() ); + + push @res, (PAM_SUCCESS(),$ans); + } + push @res, PAM_SUCCESS(); + return @res; +} + +sub start_pam { + my ($service, $login, $password) = @_; + DEBUG "Invoked pam with $service, $login, $password"; + $global_login = $login; + $global_password = $password; + my $pamh = Authen::PAM->new($service, $login, \&_my_conv_func); + if (!(ref $pamh)) { + ERROR "Error code $pamh during PAM init for service $service and login $login!"; + return (); + } + { + my $res_auth = $pamh->pam_authenticate(); + if ($res_auth != PAM_SUCCESS()) { + ERROR "PAM Authentication did not succeed although it should because of architecture service $service and login $login (ldap was ok but pam_sentry is not!!!):".$res_auth; + return (); + } + DEBUG "PAM Authentication succeeded with service $service and login $login"; + } + { + my $res_mgmt = $pamh->pam_acct_mgmt(); + if ($res_mgmt != PAM_SUCCESS()) { + ERROR "PAM Accounting did not succeed although it should because of architecture service $service and login $login (Check your PAM settings for /etc/pam.d/$service for account entries authentication worked but Account not? is not!!!):".$res_mgmt; + return (); + } + DEBUG "PAM Accounting succeeded with service $service and login $login"; + } + + { + my $res_ses = $pamh->pam_open_session(); + if ($res_ses != PAM_SUCCESS()) { + ERROR "PAM Open Session did not succeed although it should because of architecture service $service and login $login (check sessin entries in /etc/pam.d/$service authentication and account was ok but session is not!!!):".$res_ses; + return (); + } + DEBUG "PAM open_session succeeded with service $service and login $login"; + } + INFO "PAM succeeded for service $service and login $login"; + return 1; +} + + +=head2 setEnvVars + +Args: login, ip + +Sets the CLIENTIP env variable in the $HOME/.xsessionrc file + +this can be modified with: + + * qvd.vmahook.nacar.envfile By default .xsessionrc + * qvd.vmahook.nacar.clientip_var by default CLIENTIP + +=cut + + +sub setEnvVars { + my ($home, $login, $hostname, $sucursal, $clientip, $puesto) = @_; + + my $envfile = File::Spec->catfile($home, $user_envfile); + if (!-f $envfile) { + write_file($envfile, + "export $clientipname=$clientip\n". + "export $clienthostname=$hostname\n". + "export $clientsucursalname=$sucursal\n". + "export $clientpuestoname=$puesto\n" + ); + INFO "Created new file $envfile to set property $clientipname=$clientip"; + return 1; + } + + my $filecontent = read_file($envfile); + my @regex = ( + '^export\s+'.$clientipname.'=.*$', + '^export\s+'.$clienthostname.'=.*$', + '^export\s+'.$clientsucursalname.'=.*$', + '^export\s+'.$clientpuestoname.'=.*$', + ); + + DEBUG "before setting CLIENTIP var <$clientipname> <$clienthostname> <$clientsucursalname> <$clientpuestoname> in file <$envfile> for file content <$filecontent>"; + my $regex = '^export\s+'.$clientipname.'=.*$'; + foreach my $regex (@regex) { + $filecontent =~ s/$regex//mgx; + } + $filecontent .= "export $clientipname=$clientip\n". + "export $clienthostname=$hostname\n". + "export $clientsucursalname=$sucursal\n". + "export $clientpuestoname=$puesto\n"; + + DEBUG "after setting CLIENTIP var <$clientipname> <$clienthostname> <$clientsucursalname> <$clientpuestoname> in file <$envfile> for file content <$filecontent>"; + + write_file($envfile, $filecontent); + INFO "Updated file $envfile to set property $clientipname=$clientip"; + + return 1; +} + +=head2 fix_tmp_x11_unix_perm + +sets up and the /tmp/.X11-unix/ dir to mode 1777 + +=cut + +sub fix_tmp_x11_unix_perm { + my $dir = '/tmp'; + if (!-d $dir) { + mkdir $dir; + INFO "Creating manually directory $dir in SUSE"; + } + chmod 01777, $dir; + INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; + $dir = '/tmp/.X11-unix'; + if (!-d $dir) { + mkdir $dir; + INFO "Creating manually directory $dir in SUSE"; + } + chmod 01777, $dir; + INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; + $dir = '/var/tmp'; + if (!-d $dir) { + mkdir $dir; + INFO "Creating manually directory $dir in SUSE"; + } + chmod 01777, $dir; + INFO "Forcing permissions of directory $dir to be 1777 in SUSE"; + return 1; +} + + +sub _end_pam { + # Should invoke pam_close_session + # probably on vma.on_action.stop vma.on_action.poweroff +} + +1; +__END__ + + +=head1 AUTHOR + +QVD Team, C<< >> + +=head1 TODO + +=over 4 + +=item * Update /etc/hosts with server entry (based on sucursal number), for auto.master and auto.files + +=item * See what should be done if the parameters are not passed + +=back + +=head1 BUGS + +=over 4 + +=item * qvd.vm.user.name nito qvd.auth.nacar.passwd IxneobpdeG qvd.client.link local qvd.auth.nacar.clientip 80.33.123.33 qvd.vm.user.home /home/nito qvd.vm.user.groups qvd.client.os linux qvd.client.geometry 800x600 qvd.client.fullscreen qvd.client.keyboard pc105/us qvd.client.printing.enabled qvd.auth.nacar.pam_service qvd qvd.auth.nacar.login nito qvd.vm.session.state starting qvd.hook.on_action connect + + +my @testargs = ( + 'qvd.auth.nacar.pam_service', $testservice, + 'qvd.vm.user.name', 'testuser', + 'qvd.auth.nacar.passwd', 'testpass', + 'qvd.auth.nacar.clientip', '127.0.0.2' + ); + + +=back + +=head1 SUPPORT + +You can find documentation for this module with the perldoc command. + + perldoc QVD::VmaHook::NACAR + +Please contact L For support + +=head1 ACKNOWLEDGEMENTS + + +=head1 LICENSE AND COPYRIGHT + +Copyright 2011 QVD Team. + +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 +the Free Software Foundation; version 2 dated June, 1991 or at your option +any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +A copy of the GNU General Public License is available in the source tree; +if not, write to the Free Software Foundation, Inc., +59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + + +=cut + +1; # End of QVD::VmaHook::NACAR diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/00-load.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/00-load.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/00-load.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/00-load.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,15 @@ +#!perl -T + +use Test::More; + +BEGIN { + if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); + } + use_ok( 'QVD::VmaHook::NACAR' ) || print "Bail out! +"; +} + +diag( "Testing QVD::VmaHook::NACAR $QVD::VmaHook::NACAR::VERSION, Perl $], $^X" ); +done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/10-pampermit.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/10-pampermit.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/10-pampermit.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/10-pampermit.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,25 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; +BEGIN { + use File::Spec; + my ($volume,$directories,$file) = File::Spec->splitpath($0); + push @INC, $directories; + $QVD::Config::USE_DB = 0; + @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); +} +use QVD::Config; +my $testservice='qvdok'; +my $testpamfile="/etc/pam.d/$testservice"; + +if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); +} +use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); +ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); +ok(start_pam($testservice, 'testuser', 'testpass', "Should pass")); + +done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/20-pamsessfail.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/20-pamsessfail.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/20-pamsessfail.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/20-pamsessfail.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,26 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; +BEGIN { + use File::Spec; + my ($volume,$directories,$file) = File::Spec->splitpath($0); + push @INC, $directories; + $QVD::Config::USE_DB = 0; + @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); +} +use QVD::Config; +my $testservice='qvdsessfail'; +my $testpamfile="/etc/pam.d/$testservice"; + +if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); +} +use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); + +ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); +ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); + +done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/30-pamacctfail.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/30-pamacctfail.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/30-pamacctfail.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/30-pamacctfail.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,27 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; +BEGIN { + use File::Spec; + my ($volume,$directories,$file) = File::Spec->splitpath($0); + push @INC, $directories; + $QVD::Config::USE_DB = 0; + @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); +} +use QVD::Config; +my $testservice='qvdacctfail'; +my $testpamfile="/etc/pam.d/$testservice"; + +if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); +} +use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); + + +ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); +ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); + +done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/40-pamdeny.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/40-pamdeny.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/40-pamdeny.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/40-pamdeny.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,27 @@ +#!perl -T +use strict; +use warnings; + +use Test::More; +BEGIN { + use File::Spec; + my ($volume,$directories,$file) = File::Spec->splitpath($0); + push @INC, $directories; + $QVD::Config::USE_DB = 0; + @QVD::Config::FILES = (File::Spec->catfile($directories, 'lib/vma.conf')); +} +use QVD::Config; +my $testservice='qvdfail'; +my $testpamfile="/etc/pam.d/$testservice"; + +if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); +} +use_ok( 'QVD::VmaHook::NACAR', qw(start_pam)); + + +ok(-f $testpamfile, "Check for the existence of pam file $testpamfile, if failed copy it from t/lib/$testservice"); +ok(!(start_pam($testservice, 'testuser', 'testpass')), "Should fail"); + +done_testing(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/boilerplate.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/boilerplate.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/boilerplate.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/boilerplate.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,55 @@ +#!perl -T + +use strict; +use warnings; +use Test::More tests => 3; + +sub not_in_file_ok { + my ($filename, %regex) = @_; + open( my $fh, '<', $filename ) + or die "couldn't open $filename for reading: $!"; + + my %violated; + + while (my $line = <$fh>) { + while (my ($desc, $regex) = each %regex) { + if ($line =~ $regex) { + push @{$violated{$desc}||=[]}, $.; + } + } + } + + if (%violated) { + fail("$filename contains boilerplate text"); + diag "$_ appears on lines @{$violated{$_}}" for keys %violated; + } else { + pass("$filename contains no boilerplate text"); + } +} + +sub module_boilerplate_ok { + my ($module) = @_; + not_in_file_ok($module => + 'the great new $MODULENAME' => qr/ - The great new /, + 'boilerplate description' => qr/Quick summary of what the module/, + 'stub function definition' => qr/function[12]/, + ); +} + +TODO: { + local $TODO = "Need to replace the boilerplate text"; + + not_in_file_ok(README => + "The README is used..." => qr/The README is used/, + "'version information here'" => qr/to provide version information/, + ); + + not_in_file_ok(Changes => + "placeholder date/time" => qr(Date/time) + ); + + module_boilerplate_ok('lib/QVD/VmaHook/NACAR.pm'); + + +} + diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/perlcriticrc perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/perlcriticrc --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/perlcriticrc 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/perlcriticrc 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,10 @@ +severity=3 + +[TestingAndDebugging::ProhibitNoWarnings] +allow = exec + +[Subroutines::RequireArgUnpacking] +short_subroutine_statements = 6 + +[Subroutines::ProhibitExcessComplexity] +max_mccabe = 30 diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdacctfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdacctfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdacctfail 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdacctfail 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,10 @@ +# Test pam file for service qvdok +# +auth required pam_warn.so +auth required pam_permit.so +account required pam_warn.so +account required pam_deny.so +password required pam_warn.so +password required pam_deny.so +session required pam_warn.so +session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdfail 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdfail 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,10 @@ +# Test pam file for service qvdok +# +auth required pam_warn.so +auth required pam_deny.so +account required pam_warn.so +account required pam_deny.so +password required pam_warn.so +password required pam_deny.so +session required pam_warn.so +session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdok perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdok --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdok 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdok 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,10 @@ +# Test pam file for service qvdok +# +auth required pam_warn.so +auth required pam_permit.so +account required pam_warn.so +account required pam_permit.so +password required pam_warn.so +password required pam_permit.so +session required pam_warn.so +session required pam_permit.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdsessfail perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdsessfail --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdsessfail 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/qvdsessfail 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,10 @@ +# Test pam file for service qvdok +# +auth required pam_warn.so +auth required pam_permit.so +account required pam_warn.so +account required pam_permit.so +password required pam_warn.so +password required pam_permit.so +session required pam_warn.so +session required pam_deny.so diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/vma.conf perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/vma.conf --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/vma.conf 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/lib/vma.conf 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,3 @@ +# Example vma.conf for testing +log.level=DEBUG +qvd.vmahook.nacar.envfile=.test.xsessionrc \ No newline at end of file diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/manifest.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/manifest.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/manifest.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/manifest.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,13 @@ +#!perl -T + +use strict; +use warnings; +use Test::More; + +unless ( $ENV{RELEASE_TESTING} ) { + plan( skip_all => "Author tests not required for installation" ); +} + +eval "use Test::CheckManifest 0.9"; +plan skip_all => "Test::CheckManifest 0.9 required" if $@; +ok_manifest(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/perlcritic.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/perlcritic.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/perlcritic.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/perlcritic.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,22 @@ +#!perl -T +use strict; +use warnings; +use File::Spec; +use Test::More; +use English qw(-no_match_vars); + +if ( not $ENV{TEST_AUTHOR} ) { + my $msg = 'Author test. Set $ENV{TEST_AUTHOR} to a true value to run.'; + plan( skip_all => $msg ); +} + +eval { require Test::Perl::Critic; }; + +if ( $EVAL_ERROR ) { + my $msg = 'Test::Perl::Critic required to criticise code'; + plan( skip_all => $msg ); +} + +my $rcfile = File::Spec->catfile( 't', 'lib', 'perlcriticrc' ); +Test::Perl::Critic->import( -profile => $rcfile ); +all_critic_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod-coverage.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod-coverage.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod-coverage.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod-coverage.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,18 @@ +use strict; +use warnings; +use Test::More; + +# Ensure a recent version of Test::Pod::Coverage +my $min_tpc = 1.08; +eval "use Test::Pod::Coverage $min_tpc"; +plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage" + if $@; + +# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version, +# but older versions don't recognize some common documentation styles +my $min_pc = 0.18; +eval "use Pod::Coverage $min_pc"; +plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage" + if $@; + +all_pod_coverage_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod.t perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod.t --- perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod.t 1970-01-01 00:00:00.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/QVD-VmaHook-NACAR-3.116728/t/pod.t 2012-10-02 15:20:33.000000000 +0000 @@ -0,0 +1,12 @@ +#!perl -T + +use strict; +use warnings; +use Test::More; + +# Ensure a recent version of Test::Pod +my $min_tp = 1.22; +eval "use Test::Pod $min_tp"; +plan skip_all => "Test::Pod $min_tp required for testing POD" if $@; + +all_pod_files_ok(); diff -Nru perl-qvd-vmahook-nacar-3.1.0/debian/changelog perl-qvd-vmahook-nacar-3.1.0/debian/changelog --- perl-qvd-vmahook-nacar-3.1.0/debian/changelog 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/debian/changelog 2012-10-02 15:20:33.000000000 +0000 @@ -1,6 +1,6 @@ -perl-qvd-vmahook-nacar (3.1.0-16714) precise; urgency=low +perl-qvd-vmahook-nacar (3.1.0-16728) precise; urgency=low * Initial release. - -- Quality Virtual Desktop (Clave de QVD) Tue, 02 Oct 2012 10:39:15 +0200 + -- Quality Virtual Desktop (Clave de QVD) Tue, 02 Oct 2012 17:20:33 +0200 diff -Nru perl-qvd-vmahook-nacar-3.1.0/debian/rules perl-qvd-vmahook-nacar-3.1.0/debian/rules --- perl-qvd-vmahook-nacar-3.1.0/debian/rules 2012-10-02 08:39:15.000000000 +0000 +++ perl-qvd-vmahook-nacar-3.1.0/debian/rules 2012-10-02 15:20:33.000000000 +0000 @@ -14,11 +14,11 @@ build-stamp: if [ -f Build.PL ] ; then \ - BUILD_NUMBER=16714 /usr/lib/qvd/bin/perl Build.PL --destdir $(build) ; \ + BUILD_NUMBER=16728 /usr/lib/qvd/bin/perl Build.PL --destdir $(build) ; \ ./Build ; \ ./Build install ; \ else \ - BUILD_NUMBER=16714 /usr/lib/qvd/bin/perl Makefile.PL DESTDIR=$(build) ; \ + BUILD_NUMBER=16728 /usr/lib/qvd/bin/perl Makefile.PL DESTDIR=$(build) ; \ make -j4 ; \ make install ; \ fi