Re: Permissions on sp_OASetProperty
- From: "Dan Guzman" <guzmanda@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Apr 2006 07:58:06 -0500
We have no users (other than dbo & guest) in the master database. How can
this be setup with the least amount of permissions being given.
Assuming SQL 2000 SP3 or above, you can use cross-database ownership
chaining to allow limited access to the sp_OA* procs and other potentially
dangerous master procs. Note that you should enable 'db chaining' in an
sa-owned database when only sysadmin role members are permitted to create
dbo-owned objects in that database.
1) From Enterprise Manager, uncheck 'only uses with sysadmin...' under
Management-->SQL Server Agent-->Job System and specify a Windows proxy
account when prompted. This proxy account is used as the OS security
context for access to external resources.
2) Change your user database owner to 'sa':
USE MyDatabase
EXEC sp_changedbowner 'sa'
3) Enable the 'db chaining' database option
EXEC sp_dboption 'MyDatabase', 'db chaining', true
4) Create a proc to wrap the needed functionality:
CREATE PROC dbo.usp_DoSomething
@MyData
AS
--initialization code, including sp_OACreate
EXEC sp_OASetProperty
@token,
@languageValue,
'CharSet',
'Shift-JIS'
--other code, including sp_OADestroy
GO
5) Create execute permission to users:
GRANT EXEC ON dbo.usp_DoSomething TO MyRole
This will provide an unbroken ownership chain because all of the objects
involved have the same owner (dbo) and both database owners are owned by the
same login (sa).
It is important that the proc be constructed in such a way as to prevent
ad-hoc execution of unintended commands.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Meenal Dhody" <meenal_dhody@xxxxxxxxxxx> wrote in message
news:%23EjS4BkaGHA.3992@xxxxxxxxxxxxxxxxxxxxxxx
We have a request to be able to execute the following from an application:
declare @languageValue varchar(1000)
exec sp_OASetProperty @languageValue, 'CharSet', 'Shift-JIS'
Currently the developer is unable to because they get an "EXECUTE
permission
denied on object 'sp_OASetProperty', database 'master', owner 'dbo'." when
running this.
We have no users (other than dbo & guest) in the master database. How can
this be setup with the least amount of permissions being given.
I appreciate any suggestions.
thanks
Meenal
.
- References:
- Permissions on sp_OASetProperty
- From: Meenal Dhody
- Permissions on sp_OASetProperty
- Prev by Date: Payroll Security
- Next by Date: SQL Service password change
- Previous by thread: Permissions on sp_OASetProperty
- Next by thread: sysxlogins table with <NULL> entries
- Index(es):
Relevant Pages
|