English 中文(简体)
initiating a program that has more user privilages in restricted user
原标题:

I have users with limited access granted to one of my hard drives. Those users are not given the permittion to delete the files in that drive. but I have a application that should allow those users to delete files in the above mentioned drive.

1) How can I do this?

2) When a low priviliaged user loged to my application, can I write a hidden thread/ program that that gives high privileged user authority (only for this application), as in impersonating another user, so that he will be abel to delete files via this appliction in the restricted hard disk?

Thanks

问题回答

Depending on your OS you can do various things.

In a UNIX like environment you can write a program and use setuid or setguid so that it runs with priviledges of another (more priviledged) user.

Alternatively in Windows or UNIX you can run a service as the more priviledged user and let it take requests from other users/processes to carry out the operation on their behalf. You d have to look into ways to communicate with the service.

Hope that helps.

Probably the easiest way is to write a service which exposes a named pipe, and create a client application which talks to the pipe and issues instructions to your service. The service runs under LocalSystem or a nominated higher-privilege account, and carries out instructions from the app running under a user account with lower privilege. You d need some sort of handshake to establish bona-fides when you connect to the pipe, but it s not hard to do. You could use WCF instead of pipes, but I don t think you get much advantage from that in this scenario.





相关问题
PHP Cannot write to file even though it has 777 permissions

Im trying to make a php file write to a file that resides in the same folder. Both the php file and the file its trying to write to have their permissions set to 777 (its a linux server) as well as ...

How to unit test file permissions in NUnit?

I m trying to unit test file read operations. In this scenario I also need make sure that, if a particular user don t have read access he should get an exception... But somehow I m unable to get it ...

Changing vista file permissions programmatically

I want to add some files to C:windowsXXX (windows protected folder, in Vista), under the "TrustedInstaller" for my application. I do not want to replace any file so no issues on Windows Resource(...

热门标签