?
Solved

Security in Windows 2000

Posted on 2003-03-04
12
Medium Priority
?
208 Views
Last Modified: 2010-04-01
One windows NT/2000 user have no acces right of the files in one directory, but I want the program that user execute can access these files, How can I fulfill this?
0
Comment
Question by:Seashore
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
  • +1
12 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 8069253
>>How can I fulfill this?

No way but impersonating an account that is granted access, which means obtaining the credentials - and for that you usually need a username/password. If you do not have the correct permissions to access a file, there usually is something else going wrong..
0
 

Author Comment

by:Seashore
ID: 8069357
I need code sample.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8070186
Seashore,
Do you have a username and password for an account that can access those files?
-- Dan
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Seashore
ID: 8077643
Yes, I Have
0
 
LVL 86

Accepted Solution

by:
jkr earned 1200 total points
ID: 8080171
>>but I want the program that user execute can access these files

In this case (having the username and the password) you would call 'CreateProcessWithLogonW()' (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocesswithlogonw.asp), e.g.

   STARTUPINFO         si;
   PROCESS_INFORMATION pi;

   BOOL                bRes;

   bRes    =   CreateProcessWithLogonW(
                 L"TheUser",
                 L"TheDomain",
                 L"ThePassword",
                 LOGON_WITH_PROFILE ,
                 L"C:\\path\\program.exe",
                 NULL,
                 0,
                 NULL,
                 0,
                 &si,
                 &pi
               );
0
 

Author Comment

by:Seashore
ID: 8124021
When I run this code, I got a access violation in module "advapi32.dll".
I use Windows 2000 professional.
0
 
LVL 11

Expert Comment

by:bcladd
ID: 9888128
No comment has been added lately, so it's time to clean up this TA. I will
leave a recommendation in the Cleanup topic area that this question is:

Answered: Points to DanRollins: Grade A

Please leave any comments here within the next seven days.

Experts: Silence means you don't care. Grading recommendations are made in light
of the posted grading guidlines (http://www.experts-exchange.com/help.jsp#hi73).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

-bcl (bcladd)
EE Cleanup Volunteer
0
 
LVL 86

Expert Comment

by:jkr
ID: 9889262
bcladd,

>>Answered: Points to DanRollins: Grade A

Are you sure that 'Do you have a username and password for an account that can access those files?' answered the Q? Not trying to put down Dan's comment, but please review again :o)
0
 
LVL 11

Expert Comment

by:bcladd
ID: 9889497
Damn, damn, damn.

I read the right post; attributed it to the wrong poster. My apologies to DanRollins and jkr:

The recommended disposition of this question is:

Answered: Points to jkr: Grade A

(I don't actually have to change the answer I accepted (mentally), just read who posted it correctly.)

-bcl
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 9890062
dang and that was one of my more brilliant insights.  But It's not about the points.  I'm just here to help...[jkr make points] :)
0
 
LVL 86

Expert Comment

by:jkr
ID: 9890618
Dan - :o)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question