应用程序中的部分管理权限 [英] Partial Admin Privileges in App

查看:92
本文介绍了应用程序中的部分管理权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,该应用程序通常可以以当前的非管理员用户身份运行,但是该应用程序的某些功能(通过单击按钮由用户激活)需要具有管理员权限才能工作.当用户尝试使用这些特权功能时,我希望UAC弹出,但是我不想以管理员身份运行该应用程序.如果不将特权功能移入其自己的可执行文件中,是否可以实现?

我已经搜索了最后一个小时左右,并且找不到任何不需要以管理员身份运行整个应用程序的内容.

编辑=============

就目前而言,我的解决方案是创建一个单独的控制台应用程序以包含特权代码.这不是我想要的方式,充其量只是一个变通办法.

我想我可以理解如果允许以较高的特权运行程序的某些部分,则可以利用某些深奥的攻击媒介,但这真是不便.我以为他们称这些东西为托管"代码.

I have an app that can mostly run as the current non-admin user, but some features of the app (user-activated by way of a button click) need to have admin privileges to work. I want the UAC to pop up when the user tries to use these privileged features, but I don''t want to have to run the app as admin. Is that possible without moving the privileged features into their own executable?

I''ve been googling for the last hour or so, and I can''t find anything that doesn''t require the entire app to be run as admin.

EDIT =============

As it stands right now, my solution was to create a separate console application to contain the privileged code. It''s not the way I wanted to do it, and at best it''s merely a work-around.

I guess I can understand the possibility of exploiting some esoteric attack vector if running parts of a program with elevated privileges was allowed, but this is damn inconvenient. I thought they called this stuff "managed" code.

推荐答案

这将对您有帮助吗?
在管理任务需要提升高度时,向按钮添加UAC屏蔽 [ http://msdn.microsoft.com/en-us/library/ms679687.aspx [ ^ ]
http://stackoverflow.com/questions/127042/how- to-uac-elevate-a-com-component-with-net [
Will this help?
Add a UAC shield to a button when elevation is required for admin tasks[^]

COM Elevation (in case this may help)
http://msdn.microsoft.com/en-us/library/ms679687.aspx[^]
http://stackoverflow.com/questions/127042/how-to-uac-elevate-a-com-component-with-net[^]


这篇关于应用程序中的部分管理权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆