Skip Menu |

This queue is for tickets about the File-HomeDir-Win32 CPAN distribution.

Report information
The Basics
Id: 15501
Status: new
Priority: 0/
Queue: File-HomeDir-Win32

People
Owner: Nobody in particular
Requestors: barbie [...] missbarbell.co.uk
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.03
Fixed in: (no value)



Subject: Domain/Node fix + odd '&' => '&&' fix
Hi Rob, Was just looking at some test failures (via CPAN-YACSmoke obviously) and picked up that File-HomeDir-Win32-0.03 wasn't passing tests on my machine. There are two reasons why, the first I understand, but the other I am assuming was a typo. 1) Node and Domain. My machine was originally set up as a Star (MessageLabs sister company) machine, but since then my network access has been fixed to use the correct domain. As such my profile, using Win32::NodeName in _find_homedirs(), doesn't get logged, causing all sorts of test failures. The attached patch additionally uses Win32::DomainName to record profiles. 2) & and && Following the call to _find_homedirs() in the import() function, the condition uses '&'. While this works in some cases, I get test failures in 01-dynamic.t and 01-warning.t. Changing to '&&' works fine. 3) test change While checking out the above I changed two tests in 01-dynamic.t to help me see what was being affected, as such I think it would be better to use these (is() instead of ok() and eq). Patch has all the above fixes. Use as according to taste :) BTW Now that I've got my head around Sean's module and your module, and the fact you have said you no longer have a Windows box, if you want a new maintainer, let me know. Barbie.
--- File-HomeDir-Win32-0.03/t/01-dynamic.t Thu Nov 3 16:42:03 2005 +++ File-HomeDir-Win32-0.03_01/t/01-dynamic.t Thu Nov 3 15:54:30 2005 @@ -25,12 +25,12 @@ } ok( defined home(), "home defined"); -ok( home() eq home($ENV{USERNAME}), "home = home(username)"); +is( home(), home($ENV{USERNAME}), "home = home(username)"); ok( -d home(), "home exists"); { - ok( $~{''} eq home(), "\$~{} = home(username)"); - ok( $~{$ENV{USERNAME}} eq home(), "\$~{} = home(username)"); + is( $~{''}, home(), "\$~{} = home(username)"); + is( $~{$ENV{USERNAME}}, home(), "\$~{} = home(username)"); } --- File-HomeDir-Win32-0.03/lib/File/HomeDir/Win32.pm Thu Nov 3 16:42:02 2005 +++ File-HomeDir-Win32-0.03_01/lib/File/HomeDir/Win32.pm Thu Nov 3 16:53:51 2005 @@ -40,15 +40,15 @@ while (my $level = shift @names) { $level .= "::", - if (@names); + if (@names); return, - unless (defined $stash->{$level}); + unless (defined $stash->{$level}); if (@names) { - $stash = $stash->{$level}; + $stash = $stash->{$level}; } else { - no warnings 'redefine'; - $stash->{$level} = $value, - if ((defined &{$stash->{$level}}) && ((ref $value) eq "CODE")); + no warnings 'redefine'; + $stash->{$level} = $value, + if ((defined &{$stash->{$level}}) && ((ref $value) eq "CODE")); } } } @@ -56,7 +56,7 @@ # print STDERR "caller = $caller\n"; _find_homedirs(), unless (keys %HomeDirs); - if ((keys %HomeDirs) & (defined &{$stash->{home}})) { + if ((keys %HomeDirs) && (defined &{$stash->{home}})) { if (@_ > 1) { carp "Exporter arguments ignored"; } @@ -79,7 +79,9 @@ sub _find_homedirs { %HomeDirs = ( ); - my $node = Win32::NodeName; + my $node_name = Win32::NodeName; + my $domain_name = Win32::DomainName; + my $profiles = $Registry{'HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\'}; unless ($profiles) { # Windows 98 @@ -96,13 +98,13 @@ my $uid = Win32::Security::SID::ConvertSidToName($sid); my $domain = ""; if ($uid =~ /^(.+)\\(.+)$/) { - $domain = $1; - $uid = $2; + $domain = $1; + $uid = $2; } - if ($domain eq $node) { - my $path = $profiles->{$p}->{ProfileImagePath}; - $path =~ s/\%(.+)\%/$ENV{$1}/eg; - $HomeDirs{$uid} = $path; + if ($domain eq $node_name || $domain eq $domain_name) { + my $path = $profiles->{$p}->{ProfileImagePath}; + $path =~ s/\%(.+)\%/$ENV{$1}/eg; + $HomeDirs{$uid} = $path; } } }
Date: Thu, 03 Nov 2005 20:18:19 +0000
From: Robert Rothenberg <robrwo [...] gmail.com>
To: bug-File-HomeDir-Win32 [...] rt.cpan.org
CC: rkobes [...] cpan.org, randy [...] theoryx5.uwinnipeg.ca
Subject: Re: [cpan #15501] Domain/Node fix + odd '&' => '&&' fix
RT-Send-Cc:
Hi Barbie, I no longer maintain that module (I no longer have a Windows machine). Randy Kobes maintains it now. Rob On 11/03/2005 05:08 PM via RT wrote: Show quoted text
> This message about File-HomeDir-Win32 was sent to you by BARBIE > <BARBIE@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: <URL: > https://rt.cpan.org/Ticket/Display.html?id=15501 > > > Hi Rob, > > Was just looking at some test failures (via CPAN-YACSmoke obviously) > and picked up that File-HomeDir-Win32-0.03 wasn't passing tests on my > machine. There are two reasons why, the first I understand, but the > other I am assuming was a typo. > > 1) Node and Domain. > > My machine was originally set up as a Star (MessageLabs sister > company) machine, but since then my network access has been fixed to > use the correct domain. As such my profile, using Win32::NodeName in > _find_homedirs(), doesn't get logged, causing all sorts of test > failures. The attached patch additionally uses Win32::DomainName to > record profiles. > > 2) & and && > > Following the call to _find_homedirs() in the import() function, the > condition uses '&'. While this works in some cases, I get test > failures in 01-dynamic.t and 01-warning.t. Changing to '&&' works > fine. > > 3) test change > > While checking out the above I changed two tests in 01-dynamic.t to > help me see what was being affected, as such I think it would be > better to use these (is() instead of ok() and eq). > > > Patch has all the above fixes. Use as according to taste :) > > BTW Now that I've got my head around Sean's module and your module, > and the fact you have said you no longer have a Windows box, if you > want a new maintainer, let me know. > > Barbie. >
Date: Fri, 04 Nov 2005 10:09:29 -0600
From: "Randy Kobes" <r.kobes [...] uwinnipeg.ca>
To: <rrwo [...] cpan.org>,<bug-File-HomeDir-Win32 [...] rt.cpan.org>
CC: <rkobes [...] cpan.org>
Subject: Re: [cpan #15501] Domain/Node fix + odd '&' => '&&' fix
RT-Send-Cc:
Thanks, Barbie! These look good - I'll apply them, and upload a new CPAN version. best regards, Randy Show quoted text
>>> robrwo@gmail.com 11/03/05 2:18 PM >>>
Hi Barbie, I no longer maintain that module (I no longer have a Windows machine). Randy Kobes maintains it now. Rob On 11/03/2005 05:08 PM via RT wrote: Show quoted text
> This message about File-HomeDir-Win32 was sent to you by BARBIE > <BARBIE@cpan.org> via rt.cpan.org > > Full context and any attached attachments can be found at: <URL: > https://rt.cpan.org/Ticket/Display.html?id=15501 > > > Hi Rob, > > Was just looking at some test failures (via CPAN-YACSmoke obviously) > and picked up that File-HomeDir-Win32-0.03 wasn't passing tests on my > machine. There are two reasons why, the first I understand, but the > other I am assuming was a typo. > > 1) Node and Domain. > > My machine was originally set up as a Star (MessageLabs sister > company) machine, but since then my network access has been fixed to > use the correct domain. As such my profile, using Win32::NodeName in > _find_homedirs(), doesn't get logged, causing all sorts of test > failures. The attached patch additionally uses Win32::DomainName to > record profiles. > > 2) & and && > > Following the call to _find_homedirs() in the import() function, the > condition uses '&'. While this works in some cases, I get test > failures in 01-dynamic.t and 01-warning.t. Changing to '&&' works > fine. > > 3) test change > > While checking out the above I changed two tests in 01-dynamic.t to > help me see what was being affected, as such I think it would be > better to use these (is() instead of ok() and eq). > > > Patch has all the above fixes. Use as according to taste :) > > BTW Now that I've got my head around Sean's module and your module, > and the fact you have said you no longer have a Windows box, if you > want a new maintainer, let me know. > > Barbie. >