DatabaseProcApplicationCreatedLinks
sybsystemprocssp_logininfo  14 déc. 14Defects Propagation Dependencies

1     
2     /*
3     ** SP_LOGININFO 
4     **
5     ** Print out the account, the map name of the account, the type of account,
6     ** the privilege level of the account by which the account has access to
7     ** the SQL Server.
8     */
9     
10    create or replace procedure sp_logininfo
11        @account varchar(60) = NULL
12    as
13        declare @nullarg char(1)
14        declare @dummy int
15        declare @status int
16        declare @gp_enabled int
17    
18        /* 
19        ** If granular permissions is not enabled then sso_role is required.
20        ** If granular permissions is enabled then the permission 'manage roles' is
21        ** required.  proc_role and proc_auditperm will also do auditing
22        ** if required. Both will also print error message if required.
23        */
24    
25        select @nullarg = NULL
26        execute @status = sp_aux_checkroleperm "sso_role", "manage roles",
27            @nullarg, @gp_enabled output
28    
29        /* For Auditing */
30        if (@gp_enabled = 0)
31        begin
32            if (proc_role("sso_role") = 0)
33                return (1)
34        end
35        else
36        begin
37            select @dummy = proc_auditperm("manage roles", @status)
38        end
39    
40        if (@status != 0)
41            return (1)
42    
43        dbcc iseadmin("logininfo", @account)
44    
45        /* 
46        ** If there was an error, the specific message was already sent to client 
47        ** within the iseadmin() module.
48        */
49    
50        if @@error != 0
51            return (1)
52    
53        return (0)
54    
55    /* end of sp_logininfo */
56    


exec sp_procxmode 'sp_logininfo', 'AnyMode'
go

Grant Execute on sp_logininfo to public
go
DEFECTS
 MGTP 3 Grant to public sybsystemprocs..sp_logininfo  
 MUCO 3 Useless Code Useless Brackets 30
 MUCO 3 Useless Code Useless Brackets 32
 MUCO 3 Useless Code Useless Brackets 33
 MUCO 3 Useless Code Useless Brackets 40
 MUCO 3 Useless Code Useless Brackets 41
 MUCO 3 Useless Code Useless Brackets 51
 MUCO 3 Useless Code Useless Brackets 53
 VNRD 3 Variable is not read @dummy 37
 MTR1 2 Metrics: Comments Ratio Comments: 48% 10
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 5dec - 2exi + 2 10
 MTR3 2 Metrics: Query Complexity Complexity: 21 10

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