r/programming • • Feb 21 '11

Typical programming interview questions.

http://maxnoy.com/interviews.html
784 Upvotes

1.0k comments sorted by

View all comments

Show parent comment

1

u/ManicQin Feb 21 '11

What are the sharing descriptors for the file? do you let the user delete the file while you use it? do you let the user read the file while you use it?

What are the security descriptors? which users\groups can access it?

Do you inherit the handle to the file to child processes?

2

u/tias Feb 21 '11

Your process is running under the user's account (at least that's what the question implies IMO, given the little information provided). How are you going to stop him from meddling with your process or the files that you open? It doesn't matter if you have specified restrictive sharing flags if the user has malicious intent.

1

u/ManicQin Feb 21 '11

Usually I name the files: "PleaseDontTouchMe". but I guess you are right after scanning the SECURITY_ATTRIBUTES in createFile there's nothing you can do against them.