Subject: | Win32::FileSecurity::Set fail on some localised system |
I am using the Win32::FileSecurity perl module to get and set ACL on files
Using Win32::FileSecurity module on a german system I get the following
error
NT-AUTORIT-T\SYSTEM
Error handling error: 1706, LookupAccountName at foo.pl
line 120.
The source code of my test is as simple as
----->
use Win32::FileSecurity qw (Get Set);
Get("C:\foo.txt",\%hash);
Set("C:\foo.txt",\%hash);
----->
On a localized system the Win32::FileSecurity::Set() call is failing due
to a wrong interpretation of translated "NT AUTHORITY" string
looking at FileSecurity.c between line 500 and 530
the user names passed in the ACL hash are parsed to removed
well known domain part (LOCAL, NT AUTHORITY etc...)
these values are hardcoded with English version
see FileSecurity.c:100
static char *szLocalLookup[] = { "BUILTIN", "NT AUTHORITY", NULL } ;
for instance on a German system the system account , "NT
AUTHORITY\System" is called "NT-AUTORITÄT\SYSTEM"
see http://blogs.msdn.com/michkap/archive/2006/12/01/1183198.aspx for
all possible translations.
such parsing should not be performed on username set in the hash.