Archive: AccessControl::GrantOnFile NT4 problem


AccessControl::GrantOnFile NT4 problem
AccessControl::GrantOnFile $INSTDIR "(S-1-5-32-545)" "FullAccess"


works great except on NT4 SP6a

I get

ConvertStringSidToSidA entry point not found in advapi32.dll

Any ideas how to get around this?


Regards,

Gary


You should ask the plug-in writer. Please post the final answer here so we can all know what went wrong, in case someone ever gets this again.


I did, the answer is below. I solved it by doing this, which isn't as nice but works -

Call GetWindowsVersion
Pop $R0

StrCmp $R0 "NT 4.0" nt4baddy notnt4


nt4baddy:
exec "$SYSDIR\cacls.exe $\"$INSTDIR$\" /e /g BUILTIN\Users:F"
goto done
notnt4:
AccessControl::GrantOnFile $INSTDIR "(S-1-5-32-545)" "FullAccess"
done:



And the writers response -



> AccessControl::GrantOnFile $INSTDIR \"(S-1-5-32-545)\" \"FullAccess\"
>
> Give me -
>
> ConvertStringSidToSidA entrypoint not found in advapi32.dll

Maybe you can check (for instance with the dependency walker, http://www.dependencywalker.com/), if advapi32.dll contains a symbol like ConvertStringSidToSidW? In that case defining _UNICODE or late loading of the symbol would help. If that's not the case only asking Microsoft for the source code of that function would help ;-). Well, or we could steal that function from Wine (http://winehq.com/). But when doing that, the access control plugin would have to be relicensed under the terms of the GPL.

Ciao,
Mathias


According to MSDN ConvertStringSidToSid is 2000 and above only.