Skip Menu |

This queue is for tickets about the Win32API-Net CPAN distribution.

Report information
The Basics
Id: 11397
Status: new
Priority: 0/
Queue: Win32API-Net

People
Owner: JDB [...] cpan.org
Requestors: rurban [...] x-ray.at
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: (no value)
Fixed in: (no value)



Subject: locale independent APINet/t/test.t
Attached patch fixes Win32::APINet make test, on non-english Windows systems. When the "Administrators" and "Guest" groups are named differrently. The patch uses the first and third group from LocalGroupEnum, which is about the same.
--- perl-libwin32-0.191/APINet/t/test.t.orig 2002-07-09 02:15:52.000000000 +0100 +++ perl-libwin32-0.191/APINet/t/test.t 2005-02-06 17:26:52.054251400 +0100 @@ -8,6 +8,7 @@ BEGIN { $| = 1; print "1..18\n"; } END {print "not ok 1\n" unless $loaded;} +use Win32; use Win32API::Net qw/ :ALL /; $loaded = 1; print "ok 1\n"; @@ -114,26 +115,33 @@ print "not " unless UserEnum($dc, \@users, FILTER_NORMAL_ACCOUNT()); print "ok 10\n"; -print "not " unless LocalGroupGetInfo($dc, "Administrators", 1, - \%localGroupInfo); +print "not " unless LocalGroupEnum("", \@localGroups); print "ok 11\n"; +# pick out out the administrator and guest group names for further tests +$Administrators = $localGroups[0]; +$Guest = $localGroups[2]; + +print "not " unless LocalGroupGetInfo($dc, $Administrators, 1, + \%localGroupInfo); +print "ok 12\n"; undef %localGroupInfo; # LocalGroupAdd() $localGroupName="##Freds"; +if (grep /^##Freds$/,@localGroups) { + $localGroupName = $localGroups[1] . $localGroupName; +} +undef @localGroups; %localGroup=('name' => $localGroupName, 'comment' => 'All the freds'); print "not " unless LocalGroupAdd("", 1, \%localGroup, $fie); -print "ok 12\n"; +print "ok 13\n"; -@localGroupMembers=($testUserName, "Guest"); +# This will work only for english Windows +@localGroupMembers=($testUserName, $Guest); print "not " unless LocalGroupAddMembers("", $localGroupName, \@localGroupMembers); -print "ok 13\n"; - -print "not " unless LocalGroupEnum("", \@localGroups); print "ok 14\n"; -undef @localGroups; print "not " unless LocalGroupGetInfo("", $localGroupName, 1, \%lgInfo); print "ok 15\n"; @@ -142,7 +150,7 @@ print "ok 16\n"; undef %lgMembers; -@localGroupDelMembers=("Guest"); +@localGroupDelMembers=($Guest); print "not " unless LocalGroupDelMembers("", $localGroupName, \@localGroupDelMembers); print "ok 17\n";
[RURBAN - Sun Feb 6 11:30:11 2005]: Show quoted text
> Attached patch fixes Win32::APINet make test, on non-english Windows > systems. > When the "Administrators" and "Guest" groups are named differrently. > The patch uses the first and third group from LocalGroupEnum, which
is Show quoted text
> about the same.
I have 3 questions about the patch: 1) What is the purpose of this part: # LocalGroupAdd() $localGroupName="##Freds"; +if (grep /^##Freds$/,@localGroups) { + $localGroupName = $localGroups[1] . $localGroupName; +} 2) Is this comment really true: +# This will work only for english Windows +@localGroupMembers=($testUserName, $Guest); I thought the patch is actually fixing this issue. 3) Why are "Administrators" and "Guests" always the 1st and 3rd entry returned by LocalGroupEnum()? Cheers, -Jan