Click here to Skip to main content
11,629,371 members (66,968 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ password
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 16-Jan-13 19:03pm
Comments
«_Superman_» at 17-Jan-13 4:03am
   
The lpszPassword parameter of LogonUser is optional.
So what happens if you initialize it to NULL?
AlexeyLoire at 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 at 3-Mar-13 14:09pm
   
Did you try initializing lpszPassword as _T("") instead of NULL?
AlexeyLoire at 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)

  Print Answers RSS


Advertise | Privacy | Mobile
Web03 | 2.8.150723.1 | Last Updated 17 Jan 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100