Old 5th May 2004, 22:44   #1
superrock
Member
 
superrock's Avatar
 
Join Date: Jan 2002
Location: Graz, Austria
Posts: 50
AccessControl bugfix

Hi,

I worked on a bugfix of the AccessControl Dll. I would be interested to update the release in the archive at nis.ssourceforge.net !

Extended and bug fixed by Andreas Rock (andreas.rock@bigfoot.com)"
=======================================================

1. Bug fixes

1.1 Error handling

If an error occures a message box will be displayed.
The error message is then given back on the stack.
I've changed it in that way, that you must always pop the error
status from the stack and no message box on erros is displayed.

The message contains the error code in first 4 characters:
e.g. 1001::Trustee is missing

Usage new: e.g. for grant file

# Give ownership for file C:\test.txt to Waterloo\Mathias
AccessControl::SetFileOwner \
"C:\test.txt" "Waterloo\Mathias"
pop $0
StrCmp $0 "" aclok
MessageBox MB_OK "Acl error=$0"
aclok:

Usage old:
# Give ownership for file C:\test.txt to Waterloo\Mathias
AccessControl::SetFileOwner \
"C:\test.txt" "Waterloo\Mathias"



1.2 Function ParseSid: line 243 ShowError("uh..");

Must be uncommented. Error is shown by calling function!


2.0 Error messages, empty if no error occured

Error messages:

1001:Trustee is missing
1002:Permission flags are missing
1003:Bug: Unsupported change mode:
1004:Filesystem path missing
1005:Invalid filesystem path missing
1006:Root key name missing
1007:Bad root key name (..)
1008:Registry key name missing


2001:Bad trustee ..
2002:Bad permission flags ..
2003:Cannot read access control list. GetNamedSecurityInfo error code:..
2004:Cannot build new access control list. SetEntriesAcl error code:..
2005:Cannot apply new ownership. SetNamedSecurityInfo error code:..

3. Known bugs

The original project file for VisualStudio 1.0 only works with the release version.
The debug part can't produce a dll.
I've prepared a working project file for VisualStudio1.1 (see AccessControlStudioNet2003.zip).


Regards,Rocky
Attached Files
File Type: zip acesscontrolnew.zip (32.8 KB, 195 views)
superrock is offline   Reply With Quote
Old 6th May 2004, 18:06   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
Please test it, give others some time to test it, and e-mail it to me when you think it's ready for uploading.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 21st January 2005, 20:18   #3
JoeAcunzo
Junior Member
 
Join Date: Feb 2004
Posts: 29
The attached zip is missing AccessControl.c. I believe there is a bug in the call to GetNamedSecurityInfo. The last parameter is NULL, and according to Microsoft documentation, it cannot be NULL. I'd like to fix this problem, as I believe it may be the cause of a problem for some of my customers (this call fails).

I have the source to the original AccessControl plugin, but not to this new version. I'd like to use the new version so I can include error messages in the details window, which I save to a log file after install completes.

Can someone post or send me the source to this new version?

Thanks!
Joe A.
JoeAcunzo is offline   Reply With Quote
Old 21st January 2005, 23:16   #4
superrock2
Junior Member
 
Join Date: Nov 2004
Location: Graz, Austria
Posts: 7
AccessControl.c

Hi!

I am sorry that this file is missing. Attached you will find my complete source set.

Please reply your changes!
superrock2 is offline   Reply With Quote
Old 21st January 2005, 23:20   #5
superrock2
Junior Member
 
Join Date: Nov 2004
Location: Graz, Austria
Posts: 7
Missing attachment

Hi!

Sorry I was not logged properly. So I lost the attachement.
Attached you will find my complete source set.
Attached Files
File Type: zip accesscontrolnew2.zip (43.7 KB, 187 views)
superrock2 is offline   Reply With Quote
Old 26th January 2005, 20:36   #6
superrock2
Junior Member
 
Join Date: Nov 2004
Location: Graz, Austria
Posts: 7
GetNamedSecurityInfo

Hi Joe,


Could you solve your problem with "GetNamedSecurityInfo"?

It would be nice get the last version of it.
Then we could make it available in the archive.
superrock2 is offline   Reply With Quote
Old 26th January 2005, 21:17   #7
superrock2
Junior Member
 
Join Date: Nov 2004
Location: Graz, Austria
Posts: 7
Publishing new AccessControl plugin

Dear Kichik,

As I saw in thread http://forums.winamp.com/showthread....90#post1573690 the problem was only a user problem, no function problem.

I would like to publish my extension now. I have tested it well and it's working since may 2004.

The problem is, that I have added an error flag, wich must be popped from the stack. The old scripts must be changed therefore.

Should I prepare a new release with a new name like AccessControlX and publish it on the archive ?
superrock2 is offline   Reply With Quote
Old 26th January 2005, 22:17   #8
JoeAcunzo
Junior Member
 
Join Date: Feb 2004
Posts: 29
Thanks for the source Rocky, but I wouldn't post it the the archive just yet! Here's why...

Besides my problem using "Users" for a Windows group name on non-English Windows (it must be translated, or better yet, use the SID), there are at least 2 coding errors in AccessControl.

1. The last parameter of GetNamedSecurityInfo() is a NULL. According to Microsoft documentation, it must be a pointer to a pointer, and then LocalFree'ed when done.

2. It uses GetLastError() for GetNamedSecurityInfo (and other) functions, but those are documented to return the error code on the function call, and does not mention GetLastError() as usable (though it appears to work, should be fixed).

So I will make these fixes in the next few days and post the source on this thread. I'm still trying to get our maintenance release of ComputerTime onto our site at www.softwaretime.com. Thanks.

Joe A.
JoeAcunzo is offline   Reply With Quote
Old 27th January 2005, 15:15   #9
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
superrock2, you can use the script's error flag in the latest NSIS version (extra->exec_flags.exec_error). If you use it instead of the stack, it could be compatible with the old version.

BTW, what happened to your old user? Send me a PM if you want it back.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump