|
本帖最后由 andkylee 于 2012-2-28 13:46 编辑
利用手动修改master设备文件的方法。
先记录系统表sysloginroles数据初始页的页号:
select first from sysindexes where id =object_id('sysloginroles')
go
结果为:545
由于当前登录test就有sa_role权限,在sysloginroles表对应的srid为0,修改srid为1,这样登录test就具有了sso_role权限。
那么,就可以使用登录test向系统表sysloginroles中插入数据。
为了防止向sysloginroles中插入数据时报没有权限的错误。要先给test创建一个master库的别名。
use master
go
sp_addalias test,dbo
go
然后使用登录test来关闭ase。
使用十六进制编辑器修改master设备对应的master.dat文件。跳到第545页,将suid=12对应的srid由0修改为1.
然后再次启动ase。
使用test登录,
1> sp_helpuser dbo
2> go
Users_name ID_in_db Group_name Login_name
----------------- ----------- ----------------- -----------------
dbo 1 public sa
Users aliased to user.
Login_name
------------------------------
test
(return status = 0)
1> select * from sysloginroles
2> go
suid srid status
----------- ----------- ------
1 0 1
1 1 1
1 2 1
1 3 1
12 1 1
(5 rows affected)
1> sp_displaylogin
2> go
Suid: 12
Loginame: test
Fullname:
Default Database: master
Default Language:
Auto Login Script:
Configured Authorization:
sso_role (default ON)
Locked: NO
Date of Last Password Change: Feb 28 2012 1:28PM
Password expiration interval: 0
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts:
(return status = 0)
1> grant role sa_role to test
2> go
Msg 10353, Level 14, State 1:
Line 1:
You must have the following role(s) to execute this command/procedure: 'sa_role'
. Please contact a user with the appropriate role for help.
1> insert into sysloginroles values(12,0,1)
2> go
(1 row affected)
1> sp_displaylogin
2> go
Suid: 12
Loginame: test
Fullname:
Default Database: master
Default Language:
Auto Login Script:
Configured Authorization:
sa_role (default ON)
sso_role (default ON)
Locked: NO
Date of Last Password Change: Feb 28 2012 1:28PM
Password expiration interval: 0
Password expired: NO
Minimum password length: 6
Maximum failed logins: 0
Current failed login attempts:
(return status = 0)
修改好了。
|
|