Skip Menu |

This queue is for tickets about the Module-Starter-Plugin-CGIApp CPAN distribution.

Report information
The Basics
Id: 41275
Status: resolved
Priority: 0/
Queue: Module-Starter-Plugin-CGIApp

People
Owner: Nobody in particular
Requestors: leapingfrog [...] yahoo.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.05
Fixed in: 0.08



Subject: Testing on Windows Platform
Could not run tests in Windows to completion ... debugged the test via command line and fixed what I could. Of course then my security would not run properly because I changed distribution files. However, it would be nice if you didn't require diff, and GnuPG, or give some documentation on where to find them -- on the other hand, a signature is great. I'm surprised this is Titanium and alpha so I tried to make sure it was testable on Windows. We need Titanium badly to be consistent across platforms. Issues: file tainting on Windows differs ... added untaint list -- may not be the list you want ... or the regular expression you want but it does pass the test. Could not get the Environment variable to run properly, must be a windows shell thing. So I deleted it and it seemed to run fine. Maybe it would be better to find a windows shell fix. Also perl requires a -Iblib/lib and -Iblib/arch for the tests to find the modules installed for testing. The perl test harness does it correctly but when perl is put back on the command line it leaves this off. I'm surprised unix would not need the same. Added two files for module-install.t t/pod.t and t/pod-coverage.t I would suggest a Windows OS check to place the untaint properly in the windows environment. If you would like a sample of that let me know, thanks for some excellent work here ... David Scott
Subject: extutils-makemaker.t
#!perl -T # # $Id$ # use warnings; use strict; use Cwd qw(cwd); use English qw( -no_match_vars ); use File::Find qw(); use File::Path qw( rmtree ); use Test::More; $ENV{PATH} = undef; my $dir = untaint_path( cwd . '/t', '$dir' ); my $perl = untaint_path( $EXECUTABLE_NAME, '$perl' ); qx{ MODULE_STARTER_DIR=$dir $perl ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --eumm }; my $text = qx{ $perl -Iblib/lib -Iblib/arch ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --eumm }; my @expected_files = ( 'Foo/lib/Foo.pm', 'Foo/lib/Foo/templates/runmode1.html', 'Foo/t/pod-coverage.t', 'Foo/t/pod.t', 'Foo/t/test-app.t', 'Foo/t/01-load.t', 'Foo/t/perl-critic.t', 'Foo/t/boilerplate.t', 'Foo/t/00-signature.t', 'Foo/t/perlcriticrc', 'Foo/Makefile.PL', 'Foo/Changes', 'Foo/README', 'Foo/MANIFEST.SKIP', 'Foo/MANIFEST', 'Foo/server.pl', ); my %got_files; foreach my $file (@expected_files) { $got_files{$file} = -1; } File::Find::find( { untaint => 1, untaint_pattern => qr|^([-\\:+@\w./]+)$|, wanted => sub { if ( -f $File::Find::name ) { my $name = $File::Find::name; $name =~ s{^$dir/}{}msx; $got_files{$name} = grep { $_ eq $name } @expected_files; } return; } }, "$dir/Foo" ); plan tests => ( scalar keys %got_files ) * 2; foreach my $file ( keys %got_files ) { ok( $got_files{$file} > -1, "Missing file $file" ); } foreach my $file ( keys %got_files ) { ok( $got_files{$file}, "Extra file $file" ); } sub untaint_path { my ( $path, $description ) = @_; if ( !( $path =~ m{ (\A[-\\:+@\w./]+\z) }msx ) ) { die "$description is tainted.\n"; } return $1; } END { if ( -d "$dir/Foo" ) { rmtree "$dir/Foo" || die "$OS_ERROR\n"; } }
Subject: module-install.t
#!perl -T # # $Id$ # use warnings; use strict; use Cwd qw(cwd); use English qw( -no_match_vars ); use File::Find qw(); use File::Path qw( rmtree ); use Test::More; $ENV{PATH} = undef; my $dir = untaint_path( cwd . '/t', '$dir' ); my $perl = untaint_path( $EXECUTABLE_NAME, '$perl' ); my $text = qx{ $perl -Iblib/lib -Iblib/arch ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --mi }; # qx{ MODULE_STARTER_DIR=$dir $perl -Iblib/lib -Iblib/arch ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --mi }; my $root_foo = untaint_path( "$dir/Foo", '$root_foo'); my @expected_files = ( 'Foo/lib/Foo.pm', 'Foo/lib/Foo/templates/runmode1.html', 'Foo/t/test-app.t', 'Foo/t/01-load.t', 'Foo/t/perl-critic.t', 'Foo/t/boilerplate.t', 'Foo/t/00-signature.t', 'Foo/t/perlcriticrc', 'Foo/t/pod.t', 'Foo/t/pod-coverage.t', 'Foo/Makefile.PL', 'Foo/Changes', 'Foo/README', 'Foo/MANIFEST.SKIP', 'Foo/MANIFEST', 'Foo/server.pl', ); my %got_files; foreach my $file (@expected_files) { $got_files{$file} = -1; } File::Find::find( { untaint => 1, untaint_pattern => qr|^([-\\:+@\w./]+)$|, wanted => sub { if ( -f $File::Find::name ) { my $name = $File::Find::name; $name =~ s{^$dir/}{}msx; $got_files{$name} = grep { $_ eq $name } @expected_files; } return; } }, "$root_foo" ); plan tests => ( scalar keys %got_files ) * 2; foreach my $file ( keys %got_files ) { ok( $got_files{$file} > -1, "Missing file $file" ); } foreach my $file ( keys %got_files ) { ok( $got_files{$file}, "Extra file $file" ); } sub untaint_path { my ( $path, $description ) = @_; if ( !( $path =~ m{ (\A[-\\:+@\w./]+\z) }msx ) ) { die "$description is tainted.\n"; } return $1; } END { if ( -d "$dir/Foo" ) { rmtree "$dir/Foo" || die "$OS_ERROR\n"; } }
Subject: module-build.t
#!perl -T # # $Id$ # use warnings; use strict; use Cwd qw(cwd); use English qw( -no_match_vars ); use File::Find qw(); use File::Path qw( rmtree ); use Test::More; $ENV{PATH} = undef; my $dir = untaint_path( cwd . '/t', '$dir' ); my $perl = untaint_path( $EXECUTABLE_NAME, '$perl' ); # qx{ MODULE_STARTER_DIR=$dir $perl ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --mb }; my $text = qx{ $perl -Iblib/lib -Iblib/arch ./script/cgiapp-starter --module=Foo --author="Jaldhar H. Vyas" --email=jaldhar\@braincells.com --dir="$dir/Foo" --mb }; my @expected_files = ( 'Foo/lib/Foo.pm', 'Foo/lib/Foo/templates/runmode1.html', 'Foo/t/pod-coverage.t', 'Foo/t/pod.t', 'Foo/t/test-app.t', 'Foo/t/01-load.t', 'Foo/t/perl-critic.t', 'Foo/t/boilerplate.t', 'Foo/t/00-signature.t', 'Foo/t/perlcriticrc', 'Foo/Build.PL', 'Foo/Changes', 'Foo/README', 'Foo/MANIFEST.SKIP', 'Foo/MANIFEST', 'Foo/server.pl', ); my %got_files; foreach my $file (@expected_files) { $got_files{$file} = -1; } File::Find::find( { untaint => 1, untaint_pattern => qr|^([-\\:+@\w./]+)$|, wanted => sub { if ( -f $File::Find::name ) { my $name = $File::Find::name; $name =~ s{^$dir/}{}msx; $got_files{$name} = grep { $_ eq $name } @expected_files; } return; } }, "$dir/Foo" ); plan tests => ( scalar keys %got_files ) * 2; foreach my $file ( keys %got_files ) { ok( $got_files{$file} > -1, "Missing file $file" ); } foreach my $file ( keys %got_files ) { ok( $got_files{$file}, "Extra file $file" ); } sub untaint_path { my ( $path, $description ) = @_; if ( !( $path =~ m{ (\A[-\\:+@\w./]+\z) }msx ) ) { die "$description is tainted.\n"; } return $1; } END { if ( -d "$dir/Foo" ) { rmtree "$dir/Foo" || die "$OS_ERROR\n"; } }
Subject: Testing on Windows Platform (ping)
Jaldhar, I hope you've been well. Any comment on the possible inclusion of these changes? Mark
Subject: Re: [rt.cpan.org #41275] Testing on Windows Platform (ping)
Date: Wed, 31 Dec 2008 14:03:14 -0500 (EST)
To: MARKSTOS via RT <bug-Module-Starter-Plugin-CGIApp [...] rt.cpan.org>
From: "Jaldhar H. Vyas" <jaldhar [...] braincells.com>
On Wed, 31 Dec 2008, MARKSTOS via RT wrote: Show quoted text
> Queue: Module-Starter-Plugin-CGIApp > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=41275 > > > Jaldhar, > > I hope you've been well. Any comment on the possible inclusion of these > changes? >
Sorry for the delays. I made the changes and did some testing on Windows but the new version is still sitting on my computer. I'll try and upload today or tomorrow. -- Jaldhar H. Vyas <jaldhar@braincells.com>
RT-Send-CC: mark [...] summersault.com
On Wed Dec 31 14:03:36 2008, JALDHAR wrote: Show quoted text
> > Sorry for the delays. I made the changes and did some testing on
Windows Show quoted text
> but the new version is still sitting on my computer. I'll try and
upload Show quoted text
> today or tomorrow. >
Well I finally did upload. 0.07 should arrive on CPAN as we speak. The trouble is on my Windows XP test box with ActiveState perl 5.10 it is failing in a bizarre way. It can't seem to find its template directory. which results in files being created 0 length or not at all. But the template directory does exist. Some weird permissions problem? unfortunately its out of my league. (Everything works perfectly on Linux of course.) So I am not closing this bug report until I get a second opinion.
I just noticed this was still open. The original problem was fixed in 0.08