Database | Proc | Application | Created | Links |
sybsystemprocs | sp_aux_securityprofile_getattr ![]() | ![]() | 31 Aug 14 | Defects Dependencies |
1 2 create procedure sp_aux_securityprofile_getattr 3 @lrid int, 4 @lrname varchar(30), 5 @lrstatus int, 6 @lrdefdb varchar(30), 7 @lrdeflang varchar(30) 8 as 9 declare @lrstaleperiod varchar(6) 10 , @lrlastlogin varchar(5) 11 , @lrlgscript varchar(92) 12 , @max_sdr_srid int /* Max system defined role id */ 13 14 /* Initialize variables */ 15 select @max_sdr_srid = 31 /* Value of server's MAX_SDR_ROLES */ 16 17 /* Retrieve the 'track lastlogin' attribute. */ 18 select @lrlastlogin = 19 case (select int_value from master.dbo.sysattributes 20 where class = 39 and attribute = 1 and object = @lrid) 21 when 1 then "TRUE" 22 when 0 then "FALSE" 23 else NULL 24 end 25 /* Retrieve the 'stale period' attribute. */ 26 select @lrstaleperiod = (select char_value from master.dbo.sysattributes 27 where class = 39 and attribute = 2 and object = @lrid) 28 /* Retrieve the 'login script' attribute. */ 29 select @lrlgscript = (select char_value from master.dbo.sysattributes 30 where class = 39 and attribute = 3 and object = @lrid) 31 32 /* Storing the login profile name. */ 33 insert into #lrattrib values ("login profile", @lrname) 34 /* Storing the login profile id. */ 35 insert into #lrattrib values ("profile id", convert(varchar(92), @lrid)) 36 /* Storing the default status. */ 37 if ((@lrstatus & 1024) = 1024) 38 begin 39 insert into #lrattrib values ("default", "yes") 40 end 41 else 42 begin 43 insert into #lrattrib values ("default", "no") 44 end 45 /* Storing the default database. */ 46 if (@lrdefdb <> NULL) 47 begin 48 insert into #lrattrib values ("default database", 49 @lrdefdb) 50 end 51 /* Storing the default language. */ 52 if (@lrdeflang <> NULL) 53 begin 54 insert into #lrattrib values ("default language", 55 @lrdeflang) 56 end 57 /* 58 ** Store the list of roles that will be automatically activated 59 ** on login. System defined roles are automatically activated. 60 */ 61 insert into #lrattrib(name, value) 62 select "auto activated roles", role_name(srid) 63 from master.dbo.sysloginroles 64 where suid = @lrid and ((status & 1) = 1 or 65 (srid >= 0 and srid <= @max_sdr_srid)) 66 67 /* Store the list of roles that needs to be manually activated */ 68 insert into #lrattrib(name, value) 69 select "manually activated roles", role_name(srid) 70 from master.dbo.sysloginroles 71 where suid = @lrid 72 and not (srid >= 0 and srid <= @max_sdr_srid) 73 and status = 0 74 /* 75 ** Check if an authentication mechanism is specified (2048). 76 ** If so, store the authentication mechanism. 77 */ 78 if ((@lrstatus & 2048) = 2048) 79 begin --{ 80 if ((@lrstatus & 32) = 32) 81 begin 82 insert into #lrattrib values ("authenticate with", "ASE") 83 end 84 else if ((@lrstatus & 64) = 64) 85 begin 86 insert into #lrattrib values ("authenticate with", "LDAP") 87 end 88 else if ((@lrstatus & 128) = 128) 89 begin 90 insert into #lrattrib values ("authenticate with", "PAM") 91 end 92 else if ((@lrstatus & 256) = 256) 93 begin 94 insert into #lrattrib values ("authenticate with", "KERBEROS") 95 end 96 else 97 begin 98 insert into #lrattrib values ("authenticate with", "ANY") 99 end 100 end --} 101 102 /* Store 'track lastlogin' attribute. */ 103 if (@lrlastlogin <> NULL) 104 begin 105 insert into #lrattrib values ("track lastlogin", @lrlastlogin) 106 end 107 /* Store 'stale period' attribute. */ 108 if (@lrstaleperiod <> NULL) 109 begin 110 insert into #lrattrib values ("stale period", @lrstaleperiod) 111 end 112 /* Store 'login script' attribute. */ 113 if (@lrlgscript <> NULL) 114 begin 115 insert into #lrattrib values ("login script", @lrlgscript) 116 end 117
DEFECTS | |
![]() | master..sysattributes |
![]() | 20 |
![]() | 27 |
![]() | 30 |
![]() | 73 |
![]() | master..sysloginroles |
![]() | |
![]() | 46 |
![]() | 52 |
![]() | 103 |
![]() | 108 |
![]() | 113 |
![]() | 33 |
![]() | 35 |
![]() | 39 |
![]() | 43 |
![]() | 48 |
![]() | 54 |
![]() | 61 |
![]() | 68 |
![]() | 82 |
![]() | 86 |
![]() | 90 |
![]() | 94 |
![]() | 98 |
![]() | 105 |
![]() | 110 |
![]() | 115 |
![]() | 37 |
![]() | 46 |
![]() | 52 |
![]() | 78 |
![]() | 80 |
![]() | 84 |
![]() | 88 |
![]() | 92 |
![]() | 103 |
![]() | 108 |
![]() | 113 |
![]() (class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo) Intersection: {object, class, attribute} | 20 |
![]() (class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo) Intersection: {object, class, attribute} | 27 |
![]() (class, attribute, object_type, object, object_info1, object_info2, object_info3, object_cinfo) Intersection: {object, class, attribute} | 30 |
![]() | 65 |
![]() | 72 |
![]() | 19 |
![]() | 26 |
![]() | 29 |
![]() | 2 |
![]() | 2 |
![]() | 2 |
DEPENDENCIES |
PROCS AND TABLES USED reads table master..sysattributes (1) ![]() reads table master..sysloginroles (1) ![]() writes table tempdb..#lrattrib (1) CALLERS called by proc sybsystemprocs..sp_securityprofile ![]() |