首页> 外文期刊>MSDN Magazine >Manipulate Privileges In Managed Code Reliably, Securely, And Efficiently
【24h】

Manipulate Privileges In Managed Code Reliably, Securely, And Efficiently

机译:可靠,安全,高效地使用托管代码处理特权

获取原文
获取原文并翻译 | 示例
       

摘要

Like many developers of managed code, I frequently interact with system internals. One day, while working on the managed access control list (ACL) class library for the Microsoft~®.NET Framework 2.0 (see my article in the November 2004 issue of MSDN~® Magazine at msdn.microsoft.com/msdnmag/issues/04/11/ AccessControlinNET), I had to implement support for changing a security descriptor on an object. In some situations, this operation requires enabling Take Ownership and Security privileges. I poked around and discovered that there was no existing support in the .NET Framework for performing this task. Simple enough, I thought—a P/Invoke of the AdjustToken-Privileges API, and I'd be on my way. Little did I know how complex this task would become. I quickly discarded my original implementation due to several critical flaws, and about a dozen iterations later, I bring you the story of one of the coolest system programming quests in my recent memory. This article contains two solutions to the problem: the first, simpler one, is tailored to the .NET Framework 1.1 and can be used today. The second solution incorporates several advanced features available only in the .NET Framework 2.0. Regardless of which version of the Framework you are developing for, and irrespective of whether you want to understand the many technical complexities of the implementation, the solution presented here is going to be a valuable addition to your programming toolbox.
机译:像许多托管代码开发人员一样,我经常与系统内部进行交互。有一天,当为Microsoft〜.NET Framework 2.0处理托管访问控制列表(ACL)类库时(请参阅我在2004年11月发行的MSDN〜®Magazine上的文章,网址为msdn.microsoft.com/msdnmag/issues/ 04/11 / AccessControlinNET),我必须实现对更改对象安全描述符的支持。在某些情况下,此操作需要启用“获取所有权和安全性”特权。我四处寻找,发现.NET Framework中不存在执行此任务的支持。我想这很简单-P /调用AdjustToken-Privileges API,就可以了。我几乎不知道这项任务将变得多么复杂。由于几个关键缺陷,我很快放弃了最初的实现,大约十几次迭代之后,我带了一个我最近记忆中最酷的系统编程任务之一的故事。本文包含针对该问题的两种解决方案:第一种,更简单的解决方案,是针对.NET Framework 1.1量身定制的,目前可以使用。第二种解决方案合并了仅在.NET Framework 2.0中可用的几个高级功能。无论您要开发哪个版本的Framework,并且无论您是否要了解实现的许多技术复杂性,此处介绍的解决方案都将成为您的编程工具箱的宝贵补充。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号