它是不好放的PERMISSION_SET =不安全SQL 2005? [英] Is it bad to put WITH PERMISSION_SET = UNSAFE in SQL 2005?

查看:300
本文介绍了它是不好放的PERMISSION_SET =不安全SQL 2005?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用CLR,使使用的东西在.NET 3.5中的存储过程。如果我不把PERMISSION_SET =不安全,我不能做那事就这样消逝了,给我这个错误

I need to use CLR to make a stored procedure that uses stuff in .net 3.5. If I don't put Permission_Set = UnSafe I can't do it it will just die and give me this error

部署错误SQL01268:净的SqlClient   数据提供:消息6503,级别16,   状态12,行1大会   System.Core程序,版本= 3.5.0.0,   文化=中立,   公钥= b77a5c561934e089。是   在SQL目录中没有发现。一个   而该批物质发生错误   正在执行。

Deploy error SQL01268: .Net SqlClient Data Provider: Msg 6503, Level 16, State 12, Line 1 Assembly 'system.core, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' was not found in the SQL catalog. An error occurred while the batch was being executed.

所以,我发现这篇文章

<一个href="http://weblogs.asp.net/paulomorgado/archive/2009/06/13/playing-with-sql-server-clr-integration-part-iv-deploying-to-sql-server-2005.aspx" rel="nofollow">http://weblogs.asp.net/paulomorgado/archive/2009/06/13/playing-with-sql-server-clr-integration-part-iv-deploying-to-sql-server-2005.aspx

和最后一行说,这

现在数据库管理员将肯定不会让我利用这一点,但它是乐趣构建它。我不知道他指的权限被设置为不安全的。

"Now the DBAs won’t definitely let me use this, but it was fun to build it." I am not sure if he was referring to the permissions being set to unsafe.

这样可以,如果你这样做了一些巨大的大洞发生的呢?

So can some huge gaping hole happen if you do this?

推荐答案

有哪些限制哪些组件可以做三种不同的PERMISSION_SET选项

There are three different permission_set options which restrict what the assembly can do

安全 - 限制组件管理code

SAFE - Restricts the assembly to managed code

EXTERNAL_ACCESS - 允许访问文件,网络资源等。

EXTERNAL_ACCESS - allows access to files, network resources, etc..

不安全 - 无限制访问 - 包括非管理code执行

UNSAFE - Unrestricted access - including the execution of non-managed code

MSDN 文档给出如下指导

指定不安全使得在装配完全自由的code在SQL Server进程空间,可以潜在地危及的SQL Server的稳健性进行操作。不安全的组件也有可能颠覆SQL Server或公共语言运行库的安全系统。应该只授予高度受信任的程序集不安全权限。

Specifying UNSAFE enables the code in the assembly complete freedom to perform operations in the SQL Server process space that can potentially compromise the robustness of SQL Server. UNSAFE assemblies can also potentially subvert the security system of either SQL Server or the common language runtime. UNSAFE permissions should be granted only to highly trusted assemblies.

如果您的程序集只使用.NET 3.5的功能,我不明白为什么它会需要不安全访问。

If your assembly only uses features of .NET 3.5, i don't see why it would need UNSAFE access.

这是你正在使用从System.Core程序库不允许的类型或成员的一种可能。微软的这些列表。 不允许的类型和成员在System.Core.dll的

It's possible you are using one of the types or members disallowed from the System.Core library. Microsoft has a list of these. Disallowed Types and Members in System.Core.dll

这里有一些更多的信息。 宿主保护属性和CLR集成编程

There is some more info here. Host Protection Attributes and CLR Integration Programming

这篇关于它是不好放的PERMISSION_SET =不安全SQL 2005?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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