zabbix-agent2/src/libs/zbxdbupgrade/dbupgrade_5030.c
/* Patches and helper functions for ZBXNEXT-6368 */
Patches and helper functions for ZBXNEXT-6368
Patches and helper functions for ZBXNEXT - 6368
static int	is_valid_opcommand_type(const char *type_str, const char *scriptid)
{
#define ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT	4	/* not used after upgrade */
	unsigned int	type;
	if (SUCCEED != is_uint31(type_str, &type))
		return FAIL;
	switch (type)
	{
		case ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT:
		case ZBX_SCRIPT_TYPE_IPMI:
		case ZBX_SCRIPT_TYPE_SSH:
		case ZBX_SCRIPT_TYPE_TELNET:
			if (SUCCEED == DBis_null(scriptid))
				return SUCCEED;
			else
				return FAIL;
		case ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT:
			if (FAIL == DBis_null(scriptid))
				return SUCCEED;
			else
				return FAIL;
		default:
			return FAIL;
	}
#undef ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT
}
static int is_valid_opcommand_type ( const char * type_str , const char * scriptid ) { #define ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT 	4	/* not used after upgrade */
 unsigned int type ; if ( SUCCEED != is_uint31 ( type_str , & type ) ) return FAIL ; switch ( type ) { case ZBX_SCRIPT_TYPE_CUSTOM_SCRIPT : case ZBX_SCRIPT_TYPE_IPMI : case ZBX_SCRIPT_TYPE_SSH : case ZBX_SCRIPT_TYPE_TELNET : if ( SUCCEED == DBis_null ( scriptid ) ) return SUCCEED ; else return FAIL ; case ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT : if ( FAIL == DBis_null ( scriptid ) ) return SUCCEED ; else return FAIL ; default : return FAIL ; } #undef  ZBX_SCRIPT_TYPE_GLOBAL_SCRIPT
 }
Patches and helper functions for ZBXNEXT-6368
Patches and helper functions for ZBXNEXT - 6368