DatabaseProcApplicationCreatedLinks
sybsystemprocssp_hidetext_rep  14 déc. 14Defects Propagation Dependencies

1     
2     /* Can be Executed in any database */
3     
4     /*
5     ** WARNING: this system procedure is an un-documented system procedure 
6     ** reserved for the exclusive use of Replication Server.  Do *NOT* use this
7     ** system procedure to hide text.  Use the system procedure
8     ** 'sp_hidetext' instead.
9     **
10    ** Parameters:
11    **	objname - Compiled object name
12    **	tabname - table name
13    **	username - user name
14    **
15    ** Returns:
16    **	1 - if error.
17    **	0 - if no error.
18    */
19    create or replace procedure sp_hidetext_rep
20        @objname varchar(255) = NULL,
21        @tabname varchar(255) = NULL,
22        @username varchar(255) = NULL,
23        @passwdvalue varbinary(256) = NULL,
24        @version int = 0,
25        @ownername varchar(255) = NULL,
26        @status int = 0
27    as
28        declare @ret int
29        declare @dbname varchar(255)
30        declare @sqlstr varchar(512)
31    
32        if (@passwdvalue is not NULL)
33        begin
34            select @sqlstr =
35                "SET ENCRYPTION PASSWD 0x" + bintostr(@passwdvalue)
36                + " FOR KEY master VERS " + convert(varchar, @version)
37                + " USER '" + @ownername + "'"
38                + " STATUS " + convert(varchar, @status)
39            exec (@sqlstr)
40        end
41    
42        execute @ret = sp_aux_text @objname, @tabname, @username, 2
43    
44        if @ret = 0
45        begin
46            /*
47            ** The built-in 'logexec()' logs for replication the execution 
48            ** of this system procedure.
49            ** If the current database is not marked for replication or it is 
50            ** 'master' then the built-in is a no-op.
51            */
52            if (logexec() != 1)
53            begin
54                select @dbname = db_name()
55                raiserror 17756, "sp_hidetext_rep", @dbname
56                select @ret = 1
57            end
58        end
59    
60        return @ret
61    


exec sp_procxmode 'sp_hidetext_rep', 'AnyMode'
go

Grant Execute on sp_hidetext_rep to public
go
DEFECTS
 MDYN 3 Proc uses Dynamic SQL but is not flagged with Dynamic Ownership Chain 19
 MGTP 3 Grant to public sybsystemprocs..sp_hidetext_rep  
 MUCO 3 Useless Code Useless Brackets 32
 MUCO 3 Useless Code Useless Brackets 52
 MDYS 2 Dynamic SQL Marker 39
 MTR1 2 Metrics: Comments Ratio Comments: 41% 19
 MTR2 2 Metrics: Cyclomatic Complexity Cyclo: 5 = 4dec - 1exi + 2 19
 MTR3 2 Metrics: Query Complexity Complexity: 17 19

DEPENDENCIES
PROCS AND TABLES USED
calls proc sybsystemprocs..sp_aux_text