DatabaseProcApplicationCreatedLinks
sybsystemprocssp_loginconfig  14 déc. 14Defects Propagation Dependencies

1     
2     /* Sccsid = "%Z% nt386/sproc/src/%M% %I% %G%" */
3     
4     /*
5     ** ISE_ADMIN
6     **
7     ** The stored procedures found in this file are just wrappers for the 
8     ** dbcc iseadmin() command.
9     */
10    
11    /*
12    ** SP_LOGINCONFIG 
13    **
14    ** Print out the login security configuration information obtained from the 
15    ** NT registry for the SQL Server and stored in the SQL Server. If a specific
16    ** config item is specified, only print it out. Otherwise print all config
17    ** items out.
18    */
19    
20    create or replace procedure sp_loginconfig
21        @item varchar(30) = NULL /* specific config item to print */
22    as
23    
24        declare @nullarg char(1)
25        declare @dummy int
26        declare @status int
27        declare @gp_enabled int
28    
29        /* 
30        ** If granular permissions is not enabled then sso_role is required.
31        ** If granular permissions is enabled then the permission 'manage any login' is
32        ** required.  proc_role and proc_auditperm will also do auditing
33        ** if required. Both will also print error message if required.
34        */
35    
36        select @nullarg = NULL
37        execute @status = sp_aux_checkroleperm "sso_role", "manage any login",
38            @nullarg, @gp_enabled output
39    
40        /* For Auditing */
41        if (@gp_enabled = 0)
42        begin
43            if (proc_role("sso_role") = 0)
44                return (1)
45        end
46        else
47        begin
48            select @dummy = proc_auditperm("manage any login", @status)
49        end
50    
51        if (@status != 0)
52            return (1)
53    
54        dbcc iseadmin("loginconfig", @item)
55    
56        /* 
57        ** If there was an error, the specific message was already sent to client 
58        ** within the iseadmin() module.
59        */
60        if @@error != 0
61            return (1)
62    
63        return (0)
64    /* end of sp_loginconfig */
65    


exec sp_procxmode 'sp_loginconfig', 'AnyMode'
go

Grant Execute on sp_loginconfig to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_loginconfig  
 MUCO 3 Useless Code Useless Brackets 41
 MUCO 3 Useless Code Useless Brackets 43
 MUCO 3 Useless Code Useless Brackets 44
 MUCO 3 Useless Code Useless Brackets 51
 MUCO 3 Useless Code Useless Brackets 52
 MUCO 3 Useless Code Useless Brackets 61
 MUCO 3 Useless Code Useless Brackets 63
 VNRD 3 Variable is not read @dummy 48
 MTR1 2 Metrics: Comments Ratio Comments: 58% 20
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 5dec - 2exi + 2 20
 MTR3 2 Metrics: Query Complexity Complexity: 21 20

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_aux_checkroleperm  
   reads table master..syscurconfigs (1)  
   reads table master..sysconfigures (1)