<?xml version="1.0"?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Windows Perl Scripting Forums &#187; Tag: perms - Recent Posts</title>
<link>http://www.roth.net/forums/</link>
<description>Windows Perl Scripting Forums &#187; Tag: perms - Recent Posts</description>
<language>en</language>
<pubDate>Wed, 22 May 2013 06:05:10 +0000</pubDate>

<item>
<title>Anonymous on "Win32::Perms::ResolveSid"</title>
<link>http://www.roth.net/forums/topic.php?id=278#post-590</link>
<pubDate>Wed, 01 Jul 2009 00:14:09 +0000</pubDate>
<dc:creator>Anonymous</dc:creator>
<guid isPermaLink="false">590@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Always fails with error code 0x000003e5 (Overlapped I/O operation is in progress).
&#60;/p&#62;</description>
</item>
<item>
<title>Anonymous on "Win32::Perms::ResolveSid"</title>
<link>http://www.roth.net/forums/topic.php?id=278#post-589</link>
<pubDate>Tue, 30 Jun 2009 11:45:05 +0000</pubDate>
<dc:creator>Anonymous</dc:creator>
<guid isPermaLink="false">589@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;I have script form Chapter 11 of Win32 Perl Programming, by David Roth. There is always error in line 09 .&#60;br /&#62;
I change var $Account so:&#60;br /&#62;
$Account ='\\\\$machine\\$user';&#60;br /&#62;
$Account ='$domain\\$user';&#60;br /&#62;
$Account ='$user';&#60;br /&#62;
No effect. There is always error in line 09 .&#60;br /&#62;
Where is my mistake?&#60;/p&#62;
&#60;p&#62;01. use Win32::Perms;&#60;br /&#62;
02. my $Domain = Win32::DomainName();&#60;br /&#62;
03. my $User = Win32::LoginName();&#60;br /&#62;
04. my $Account = sprintf( &#34;%s%s&#34;, ( &#34;&#34; ne $Domain )?&#60;br /&#62;
&#34;$Domain\\&#34;:&#34;&#34;, $User );&#60;br /&#62;
05. my %Sid = (&#60;br /&#62;
06.  text  =&#38;gt; &#34;&#34;,&#60;br /&#62;
07.  binary =&#38;gt; &#34;&#34;&#60;br /&#62;
08. );&#60;br /&#62;
09. if( $Sid{text} = Win32::Perms::ResolveSid( $Account, $Sid{binary} ) )&#60;br /&#62;
10. {&#60;br /&#62;
11.  print &#34;You are logged in as $Account.\n&#34;;&#60;br /&#62;
12.  print &#34;Your SID is: $Sid{text}\n&#34;;&#60;br /&#62;
13.  print &#34;Your binary SID is: '$Sid{binary}'\n&#34;;&#60;br /&#62;
14. }&#60;br /&#62;
15. else&#60;br /&#62;
16. {&#60;br /&#62;
17.  print &#34;\tCouldn't lookup the SID for $Domain\\$User: $^E\n&#34;;&#60;br /&#62;
18. }
&#60;/p&#62;</description>
</item>
<item>
<title>mvancl on "Registry keys with (forward)slashes can&#039;t open"</title>
<link>http://www.roth.net/forums/topic.php?id=191#post-446</link>
<pubDate>Tue, 18 Dec 2007 13:31:44 +0000</pubDate>
<dc:creator>mvancl</dc:creator>
<guid isPermaLink="false">446@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi Harlan,&#60;/p&#62;
&#60;p&#62;I&#38;#39;m not sure&#38;nbsp;if I understand you. The code converting slashes to backslashes in paths is in function FixPath (source code in &#60;a href=&#34;../pub/ntperl/perms/20020605/source/Perms_Source.Zip&#34;&#62;&#60;a href=&#34;ftp://www.roth.net/pub/ntperl/perms/20020605/source/&#38;#038;lt;font&#34; rel=&#34;nofollow&#34;&#62;ftp://www.roth.net/pub/ntperl/perms/20020605/source/&#38;#038;lt;font&#60;/a&#62; color=&#34;#800080&#34;&#38;gt;Perms_Source.Zip) &#38;lt;/font&#38;gt;&#60;/a&#62;In README file is note: &#38;quot;Forward and backslashes are supported (all forward slashes will first be converted to backslashes)&#38;quot;. And also my script walks recursively&#38;nbsp;through&#38;nbsp;complete registry tree but keys containing forwardslashes in its name which is not able to open (new returns undef).&#60;/p&#62;
&#60;p&#62;&#38;nbsp;M. Vancl&#60;/p&#62;</description>
</item>
<item>
<title>keydet89 on "Registry keys with (forward)slashes can&#039;t open"</title>
<link>http://www.roth.net/forums/topic.php?id=191#post-445</link>
<pubDate>Tue, 18 Dec 2007 12:52:55 +0000</pubDate>
<dc:creator>keydet89</dc:creator>
<guid isPermaLink="false">445@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;M. Vancl,&#60;/p&#62;
&#60;p&#62;Can you add code that explicitly reverts the slashes under those conditions?&#60;/p&#62;
&#60;p&#62;Harlan &#60;/p&#62;</description>
</item>
<item>
<title>mvancl on "Registry keys with (forward)slashes can&#039;t open"</title>
<link>http://www.roth.net/forums/topic.php?id=191#post-444</link>
<pubDate>Tue, 18 Dec 2007 10:53:45 +0000</pubDate>
<dc:creator>mvancl</dc:creator>
<guid isPermaLink="false">444@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I have problem with walking through all registry keys because there are keys containing normal slashes like:&#60;br /&#62;HKCU\Software\Microsoft\Windows\MediaPlayer\Player\Skins\&#60;strong&#62;res://wmploc/RT_TEXT/MainAppSkin.wsz&#60;/strong&#62;&#60;br /&#62;and all slashes are unconditionaly converted in function FixPath to backslashes and then is path incorrectly splitted.&#60;/p&#62;
&#60;p&#62;Is any solution ?&#60;/p&#62;
&#60;p&#62;Thanks&#60;/p&#62;
&#60;p&#62;M. Vancl&#60;/p&#62;</description>
</item>
<item>
<title>anowak on "Win32::Perms not accepting long security group names"</title>
<link>http://www.roth.net/forums/topic.php?id=185#post-432</link>
<pubDate>Sun, 04 Nov 2007 23:20:11 +0000</pubDate>
<dc:creator>anowak</dc:creator>
<guid isPermaLink="false">432@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I am having an issue with Win32::Perms and applying security groups with long names?&#60;/p&#62;
&#60;p&#62;I create a group &#38;quot;this.is.a.very.long.security.group.name.that.does.not.work&#38;quot; under the domain MYDOMAIN&#60;/p&#62;
&#60;p&#62;code is as below&#38;nbsp;&#60;/p&#62;
&#60;p&#62;=======================================&#60;br /&#62;use Win32::Perms;&#60;br /&#62;Win32::Perms::LookupDC(0);&#60;/p&#62;
&#60;p&#62;my $folder = &#38;quot;C:\\MyFolder&#38;quot;;&#60;/p&#62;
&#60;p&#62;my $permission = new Win32::Perms( $folder ) or print $!;&#60;br /&#62;$permission-&#38;gt;Allow(&#38;quot;MYDOMAIN\\this.is.a.very.long.security.group.name.that.does.not.work&#38;quot;, 1179817, 3);&#60;br /&#62;$permission-&#38;gt;Set();&#60;br /&#62;$permission-&#38;gt;Close();&#60;br /&#62;=======================================&#60;/p&#62;
&#60;p&#62;When I read the permissions they seem to be fine it just does not apply them?. &#60;/p&#62;
&#60;p&#62;Any ideas why this would be?&#60;/p&#62;
&#60;p&#62;Regards&#60;/p&#62;</description>
</item>
<item>
<title>MiniMe on "Win32::Perms and Windows Server 2003"</title>
<link>http://www.roth.net/forums/topic.php?id=17#post-425</link>
<pubDate>Tue, 09 Oct 2007 22:53:23 +0000</pubDate>
<dc:creator>MiniMe</dc:creator>
<guid isPermaLink="false">425@http://www.roth.net/forums/</guid>
<description>&#60;p&#62;Hi Kelly,&#60;/p&#62;
&#60;p&#62;&#38;nbsp;I&#38;#39;m having the same issues with the Perms plugin. I debugged and chacked all the return values and the Allow command returns a &#38;quot;True&#38;quot; value so for the code everything was succesfull. I asume this is a bug and I&#38;#39;m using icalcs.exe now for doing the trick.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;/p&#62;
&#60;p&#62;&#38;nbsp;Steve&#60;/p&#62;</description>
</item>
<item>
<title>lennu on "Memory-Problems with Win32::Perms"</title>
<link>http://www.roth.net/forums/topic.php?id=163#post-384</link>
<pubDate>Wed, 01 Aug 2007 21:32:12 +0000</pubDate>
<dc:creator>lennu</dc:creator>
<guid isPermaLink="false">384@http://www.roth.net/forums/</guid>
<description>Hi,&#60;br /&#62;
&#60;br /&#62;
I encountered a memory problem with Win32::Perms and hope somebody has got a hint for me.&#60;br /&#62;
&#60;br /&#62;
I've got a file containing a list of thousands of files and directories (one object per line) and wrote a script to take each file/directory and read the permissions.&#60;br /&#62;
&#60;br /&#62;
Code extract of my first try:&#60;br /&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
open&#38;#40;LISTFILE, &#38;quot;&#38;lt; xyz.txt&#38;quot;&#38;#41;;&#60;br /&#62;
while&#38;#40;my $line = &#38;lt;LISTFILE&#38;gt;&#38;#41; &#38;#123;&#60;br /&#62;
&#38;nbsp; chomp $line;&#60;br /&#62;
&#38;nbsp; next if &#38;#40;!-e $line&#38;#41;;&#60;br /&#62;
&#38;nbsp; checkPermissions&#38;#40;$line&#38;#41;;&#60;br /&#62;
&#38;#125;&#60;br /&#62;
close LISTFILE;&#60;br /&#62;
&#60;br /&#62;
sub checkPermissions &#38;#123;&#60;br /&#62;
&#38;nbsp; my &#38;#40;$obj&#38;#41; = @_;&#60;br /&#62;
&#38;nbsp; my $Perm = new Win32&#38;#58;&#38;#58;Perms&#38;#40;$obj&#38;#41;;&#60;br /&#62;
&#38;nbsp; #...do something with $Perm...&#60;br /&#62;
&#38;nbsp; $Perm-&#38;gt;Close&#38;#40;&#38;#41;;&#60;br /&#62;
&#38;#125;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;&#60;br /&#62;
&#60;br /&#62;
Code extract of my second try:&#60;br /&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
my $Perm = new Win32&#38;#58;&#38;#58;Perms&#38;#40;$0&#38;#41;;&#60;br /&#62;
open&#38;#40;LISTFILE, &#38;quot;&#38;lt; xyz.txt&#38;quot;&#38;#41;;&#60;br /&#62;
while&#38;#40;my $line = &#38;lt;LISTFILE&#38;gt;&#38;#41; &#38;#123;&#60;br /&#62;
&#38;nbsp; chomp $line;&#60;br /&#62;
&#38;nbsp; next if &#38;#40;!-e $line&#38;#41;;&#60;br /&#62;
&#38;nbsp; checkPermissions&#38;#40;$line&#38;#41;;&#60;br /&#62;
&#38;#125;&#60;br /&#62;
close LISTFILE;&#60;br /&#62;
$Perm-&#38;gt;Close;&#60;br /&#62;
&#60;br /&#62;
sub checkPermissions &#38;#123;&#60;br /&#62;
&#38;nbsp; my &#38;#40;$obj&#38;#41; = @_;&#60;br /&#62;
&#38;nbsp; $Perm-&#38;gt;Remove&#38;#40;-1&#38;#41;;&#60;br /&#62;
&#38;nbsp; $Perm-&#38;gt;Import&#38;#40;$obj&#38;#41;;&#60;br /&#62;
&#38;nbsp; #...do something with $Perm...&#60;br /&#62;
&#38;nbsp; $Perm-&#38;gt;Close&#38;#40;&#38;#41;;&#60;br /&#62;
&#38;#125;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;&#60;br /&#62;
&#60;br /&#62;
In both cases the memory usage increases. Is this a memory handle bug in the Perm.dll or am I doing something wrong?&#60;br /&#62;
&#60;br /&#62;
Regards,&#60;br /&#62;
  Lennart Freyberg&#60;br /&#62;
&#60;br /&#62;
(Perl version: 5.8.7 813, Windows 2k)</description>
</item>
<item>
<title>jsanio on "Recursing Permissions on a Registry Object"</title>
<link>http://www.roth.net/forums/topic.php?id=117#post-291</link>
<pubDate>Fri, 23 Feb 2007 02:18:27 +0000</pubDate>
<dc:creator>jsanio</dc:creator>
<guid isPermaLink="false">291@http://www.roth.net/forums/</guid>
<description>Hi All&#60;br /&#62;
&#60;br /&#62;
I am running &#60;br /&#62;
              - Perl v5.8.7&#60;br /&#62;
              - Win32-Perms [0.2002.06.05]&#60;br /&#62;
              - Win32-Registry (Sept 2005)  Also with Win32::TieRegistry (Mar 2006) &#60;br /&#62;
&#60;br /&#62;
I am executing the code as administrator&#60;br /&#62;
&#60;br /&#62;
I have googled the the web and news groups and have not found a response to this issue. &#60;br /&#62;
&#60;br /&#62;
I am trying to recursively add permissions (read access) to all Keys under the the HKLM,HKCC hives. I am able to successfully update the Target Hive or Sub key BUT I am unable to recurse down the hive adding the priviledges. &#60;br /&#62;
&#60;br /&#62;
Any and all comments are welcome.&#60;br /&#62;
&#60;br /&#62;
&#60;br /&#62;
CODE SNIP&#60;br /&#62;
&#60;br /&#62;
	my $RegKeyObj=$Registry-&#38;gt;Connect( $HOST, $regkey, { Access=&#38;gt;KEY_ALL_ACCESS, Delimiter=&#38;gt;&#38;quot;/&#38;quot; });&#60;br /&#62;
		$::HKEY_CURRENT_USER-&#38;gt;Connect($HOST,$key) or die &#38;quot;Can't read $HOST $regkey $^E\n&#38;quot;;&#60;br /&#62;
				my $PermsObj = new Win32::Perms($key); &#60;br /&#62;
		$PermsObj-&#38;gt;Dump;&#60;br /&#62;
		$PermsObj-&#38;gt;Remove($LocalGroup);&#60;br /&#62;
		print &#38;quot;The path represents a &#38;quot;, $TYPE{$PermsObj-&#38;gt;GetType()}, &#38;quot;.\n&#38;quot;; &#60;br /&#62;
			print 	 $SubDir, &#38;quot;-- $? --    \n&#38;quot;;&#60;br /&#62;
			print ($PermsObj-&#38;gt;IsContainer())? &#38;quot;&#38;quot;:&#38;quot;not &#38;quot; ;&#60;br /&#62;
			print $?,&#38;quot;\n&#38;quot;;&#60;br /&#62;
				if ( $PermsObj-&#38;gt;IsContainer() ) {			&#60;br /&#62;
					if ($PermsObj-&#38;gt;Allow($LocalGroup,READ,CONTAINER_INHERIT_ACE)) {&#60;br /&#62;
					$PermsObj-&#38;gt;SetRecurse();&#60;br /&#62;
					print &#38;quot;$?\n&#38;quot;;&#60;br /&#62;
					print &#38;quot;Change Successful\n&#38;quot;;&#60;br /&#62;
					} else {&#60;br /&#62;
				      	print &#38;quot;Change Failed\n&#38;quot;;&#60;br /&#62;
					}	&#60;br /&#62;
				}&#60;br /&#62;
				if ($PermsObj-&#38;gt;Allow($LocalGroup,READ&#124;READ_CONTROL&#124;STANDARD_RIGHTS_READ,CONTAINER_INHERIT_ACE&#124;OBJECT_INHERIT_ACE)) {&#60;br /&#62;
				$PermsObj-&#38;gt;SetRecurse(); &#60;br /&#62;
				print &#38;quot;$?\n&#38;quot;;&#60;br /&#62;
				print &#38;quot;Change Successful\n&#38;quot;;&#60;br /&#62;
				} else {&#60;br /&#62;
				print &#38;quot;Change Failed\n&#38;quot;;&#60;br /&#62;
				}	&#60;br /&#62;
&#60;br /&#62;
			};&#60;br /&#62;
			if ($@) {&#60;br /&#62;
			 print $@,&#38;quot;\n&#38;quot;;&#60;br /&#62;
		 	}	 &#60;br /&#62;
	}&#60;br /&#62;
&#38;lt;&#38;lt;&#38;lt; SNOP</description>
</item>
<item>
<title>runrig on "Win32::Perms hanging"</title>
<link>http://www.roth.net/forums/topic.php?id=49#post-116</link>
<pubDate>Sat, 11 Nov 2006 18:53:46 +0000</pubDate>
<dc:creator>runrig</dc:creator>
<guid isPermaLink="false">116@http://www.roth.net/forums/</guid>
<description>I would like to copy permissions from one registry key to another (actually a bunch of others), but either nothing happens, or it gets hung up on the Set(or SetDacl) eating more and more memory. I've tried passing in a 'registry:...' style path and a Win32::Registry object, but no luck. &#60;br /&#62;
&#60;br /&#62;
If I create the Win32::Perms object with a Win32::Registry object, and try to set permission on a 'registry:...' path, it eats memory. If I try to Set on a Win32::Registry object, then nothing happens.&#60;br /&#62;
&#60;br /&#62;
If I try to create a Win32::Perms object with a 'registry:..' path, then the Dump doesn't have the ACL permissions for groups and users.&#60;br /&#62;
&#60;br /&#62;
Here is the code:&#60;br /&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
#!/usr/bin/perl&#60;br /&#62;
&#60;br /&#62;
use strict;&#60;br /&#62;
use warnings;&#60;br /&#62;
&#60;br /&#62;
use Win32&#38;#58;&#38;#58;Registry;&#60;br /&#62;
use Win32&#38;#58;&#38;#58;Perms;&#60;br /&#62;
&#60;br /&#62;
my $path = 'SOFTWARE\\Classes';&#60;br /&#62;
my $key1 = 'opendocument.WriterDocument.1';&#60;br /&#62;
my $key2 = 'opendocument.WriterGlobalDocument.1';&#60;br /&#62;
&#60;br /&#62;
$&#38;#58;&#38;#58;HKEY_LOCAL_MACHINE-&#38;gt;Open&#38;#40;&#38;quot;$path\\$key1&#38;quot;, my $doc1&#38;#41; or die &#38;quot;Acck&#38;#58; $^E&#38;quot;;&#60;br /&#62;
&#60;br /&#62;
#This doesn't work &#38;#40;nothing in Dump&#38;#41;&#60;br /&#62;
#my $p = Win32&#38;#58;&#38;#58;Perms-&#38;gt;new&#38;#40;&#38;quot;HKEY_LOCAL_MACHINE\\$path\\$key1&#38;quot;&#38;#41;;&#60;br /&#62;
&#60;br /&#62;
my $p = Win32&#38;#58;&#38;#58;Perms-&#38;gt;new&#38;#40;$doc1&#38;#41;;&#60;br /&#62;
$p-&#38;gt;Dump;&#60;br /&#62;
print &#38;quot;Set\n&#38;quot;;&#60;br /&#62;
$p-&#38;gt;SetDacl&#38;#40;&#38;quot;registry&#38;#58;HKEY_LOCAL_MACHINE\\$path\\$key2&#38;quot;, 1&#38;#41; or die &#38;quot;Acck&#38;#58; $^E&#38;quot;;&#60;br /&#62;
print &#38;quot;Set!\n&#38;quot;;&#60;br /&#62;
$p-&#38;gt;Close;&#60;br /&#62;
$doc1-&#38;gt;Close;&#60;br /&#62;
#$doc2-&#38;gt;Close;&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;</description>
</item>
<item>
<title>collier on "Win32::Perms and Windows Server 2003"</title>
<link>http://www.roth.net/forums/topic.php?id=17#post-47</link>
<pubDate>Mon, 21 Aug 2006 17:25:06 +0000</pubDate>
<dc:creator>collier</dc:creator>
<guid isPermaLink="false">47@http://www.roth.net/forums/</guid>
<description>Hello,&#60;br /&#62;
&#60;br /&#62;
I borrowed chunks of an example script to modify the perms on files and directories. The aim of my script is to find objects which contain user X in their ACLs, add user Y with the same perms as user X, then delete user X. (I guess that's the long way of saying that the script does a user search and replace).&#60;br /&#62;
&#60;br /&#62;
My script works fine on my Win2K test machine, but no such luck on the Win2K3 server for which I was writing the script. Both machines have ActivePerl 5.8.8.&#60;br /&#62;
&#60;br /&#62;
On the Win2K3 machine, the script &#60;em&#62;appears&#60;/em&#62; to work--the $Perm-&#38;gt;Add() method returns sensible values with each run--but the ACLs aren't modified.&#60;br /&#62;
&#60;br /&#62;
Any ideas?&#60;br /&#62;
&#60;br /&#62;
Thanks in advance.&#60;br /&#62;
&#60;br /&#62;
-Kelly</description>
</item>

</channel>
</rss>
