Friday, April 11, 2014

lr_param_sprintf security issue when run over a firewall(Error: CCI security error: You are running under secure mode and the function lr_param_sprintf is not allowed in this mode. )

The function lr_param_sprintf sometimes causes a security issue in the script when run from Performance Center.

Error Message
Error: CCI security error: You are running under secure mode and the function lr_param_sprintf is not allowed in this mode.

This function causes an issue in Performance Center due to the way the function works and the way the Load Generators have been setup in the environment as this function does not work over a firewall.
Solution:This is an example of how function could be to generate a timestamp value –

lr_param_sprintf( "timeStamp" , "%ld", time(&t) );
An easier and workable way of which is

char strTime[10]; //timestamp variable
/*
-- -- -- -- -- -- -- --
Other code goes here
-- -- -- -- -- -- -- --
*/
lr_save_string( (char*)itoa( time(&t), strTime, 10 ), "timeStamp" );

No comments: