Click here to Skip to main content
15,885,875 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hello community.
I met quite a problem during writting my software.
The software is doing delayed deletion of files and folders. Main algorythm is in win32 service which gets data and user credentials from db. For deleting an object it must impersonate itself as user that had added it in db. It's kind of security precaution for software for not allowing to delete system objects or that this user had no right to delete.
Actually everything goes good with domain users and with local users exept one little case: if user has no password.
Similar question has been asked here before but there has been no solution that made me satisfied. The solution that was proposed in similar post is to change local security policy which makes a huge hole in system's security. I think when the software changes system policies is not 'comme il faut'.
First i thought about filling ACL with user credentials and getting user's determining user rights on object and then just delete it with service itself with LocalSystem privileges, but i'm not sure that is "good style" to perform my task. So i still need to delete object under user's security context.
Looking forward to your answers.
Best regards, Alexey.
Posted
Comments
«_Superman_» 17-Jan-13 4:03am    
The lpszPassword parameter of LogonUser is optional.
So what happens if you initialize it to NULL?
Alexey Loire 17-Jan-13 11:11am    
i got ERROR_ACCOUNT_RESTRICTION (1327).
I suppose that this parameter is only optional to system accounts such as LocalSystem that haven't any pwd.
Michael Haephrati 3-Mar-13 14:09pm    
Did you try initializing lpszPassword as _T("") instead of NULL?
Alexey Loire 5-Mar-13 0:27am    
of course i did. Not an option ><

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900