rpms/zabbix/devel zabbix-1.6.3-pre.patch, NONE, 1.1 zabbix.spec, 1.33, 1.34

Jeffrey C. Ollie jcollie at fedoraproject.org
Fri Mar 6 17:28:22 UTC 2009


Author: jcollie

Update of /cvs/pkgs/rpms/zabbix/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv19927

Modified Files:
	zabbix.spec 
Added Files:
	zabbix-1.6.3-pre.patch 
Log Message:
* Wed Mar  4 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 1.6.2-4
- Update to a SVN snapshot of the upstream 1.6 branch to fix security
  issue (BZ#488501)


zabbix-1.6.3-pre.patch:

--- NEW FILE zabbix-1.6.3-pre.patch ---
diff --git a/ChangeLog b/ChangeLog
index b6ee465..e217193 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,71 @@
+Changes for 1.6.3
+
+ - [DEV-268] added support of <mode> for system.cpu.util under Solaris (Sasha)
+ - [ZBX-737] the behaviour of the agent's key "vfs.fs.size" improved to be similar to the "df" command (Dmitry)
+ - [ZBX-599] the purpose of the configuration parameter StartAgents precised (Dmitry)
+ - [ZBX-756] added tooltip in "status of ZABBIX" report for number of items and triggers parameter (Vedmak)
+ - [ZBX-740] fixed wrong aggregate graph drawing (Artem)
+ - [ZBX-747] fixed template linkage not working properly (Vedmak)
+ - [ZBX-746] fixed incorrect processing of net.tcp.listen (Sasha)
+ - [ZBX-745] fixed "invalid URL" when use small popup menus like ping etc (Vedmak)
+ - [ZBX-744] fixed "invalid URL" when add user to user group (Vedmak)
+ - [ZBX-743] fixed problem with "Too many open files" by agent under Solaris 2.5, 2.6 (Sasha)
+ - [ZBX-728] fixed displaying "no status update" error for template triggers (Vedmak)
+ - [ZBX-738] fixed processing of existing data when -n parameter is used for zabbix_server (Sasha)
+ - [ZBX-736] fixed "Undefined index error" during frontend installation (Vedmak)
+ - [ZBX-735] fixed filter in audit filtering only logs (Vedmak) 
+ - [ZBX-734] fixed evaluation of {ITEM.LASTVALUE} if the trigger expression consists of several items (Sasha) 
+ - [ZBX-732] fixed wrong action count in audit log (Vedmak)
+ - [ZBX-731] fixed resetting of web graph periods (Vedmak)
+ - [ZBX-730] fixed possible Windows agent crash when processing eventlog[] (Sasha)
+ - [ZBX-555] added entity counts on interfaces (Vedmak)
+ - [ZBX-724] improved queries in "Graphs" page (Artem)
+ - [ZBX-725] added new default user group "Disabled" (Vedmak)
+ - [ZBX-723] fixed Wrong URL when add rights to user group (Vedmak)
+ - [ZBX-720] edited configure.in file to make some error messages more sensible (Dmitry)
+ - [ZBX-665] corrected some typos in misc/conf/zabbix_server.conf (Dmitry)
+ - corrected some typos in test/env/standalone/conf/template_server.conf (Dmitry)
+ - [ZBX-615] fixed processing of four-character-long item keys (Dmitry)
+ - [ZBX-697] trigger description in "Last 20 issues" is link to the URL defined in trigger parameters + minor GUI typos fix (Vedmak)
+ - [ZBX-473] fixed SNMP-related compilation problem with undefined 'localname' under some platforms (Sasha)
+ - [ZBX-718] fixed web graphs start time not changing (Vedmak)
+ - [ZBX-699] fixed recursion detection in Include directive for config files (Sasha)
+ - [ZBX-301] fixed minor GUI text errors  (Vedmak)
+ - [ZBX-716] fixed wrong caption for graph item editing form (Vedmak)
+ - [ZBX-717] all templates linked to group Templates in default config (Sasha)
+ - [ZBX-715] fixed "Invalid URL" error when choose History from history submenu (Vedmak)
+ - [ZBX-713] fixed "values per second" having too many decimal places (Vedmak)
+ - [ZBX-710] fixed duplicating entries in hosts groups after import (Artem)
+ - [ZBX-709] improved item graph exporting (Artem)
+ - [ZBX-712] fixed simple/advanced item filter switch (Vedmak)
+ - [ZBX-707] fixed sql error when filter items by host group (Vedmak)
+ - [ZBX-706] fixed element validation in sysmap elements (Artem)
+ - [ZBX-705] improved {ESC.HISTORY} macro in recovery notifications (Sasha)
+ - [ZBX-647] fixed audit log record for graph update action "added" -> "updated" (Vedmak)
+ - [ZBX-700] fixed possible server crash when using {TRIGGER.NAME} for notifications (Sasha)
+ - [DEV-286] improved zabbix main menu (Artem)
+ - [ZBX-311] fixed PostgreSQL errors with out of range string data (Sasha)
+ - [ZBX-696] fixed import of triggers with {HOSTNAME} macro (Sasha)
+ - [ZBX-677] fixed handling of -c parameter in zabbix_sender. Thanks to Jakov Sosic (Sasha)
+ - [ZBX-693] fixed timeout handling for SNMP connect (Sasha)
+ - [ZBX-690] fixed memory leak if trigger evaluation fails (Sasha)
+ - [DEV-285] added configurable the first dropdown selection (Artem)
+ - [ZBX-689] allowed processing of non-agent based checks for unreachable hosts (Sasha)
+ - [ZBX-683] removed "Step" field for recovery messages from Event details (Sasha)
+ - [ZBX-680] fixed login while entering any page with HTTP auth enabled (Artem)
+ - [ZBX-678] default number of HTTP pollers was decreased to one (Sasha)
+ - [ZBX-676] fixed sql problem with deletion of many hosts (Artem)
+ - [ZBX-675] fixed wrong result of function "nodata" after server restart (Sasha)
+ - [ZBX-672] added polish locale (Artem)
+ - [ZBX-671] removed net-snmp debug messages from server logs (Sasha)
+ - [ZBX-662] fixed support of quotation marks in command in UserParameter's (Sasha)
+ - [ZBX-658] fixed deadlocks in dbcache module (Sasha)
+ - [ZBX-659] added define for menu caching (Artem)
+ - [ZBX-581] fixed latest data auto-refresh cripples filter viewing issue (Artem)
+ - [ZBX-657] improved performance of the graph related screen due to missing index (Sasha)
+ - [ZBX-656] fixed warning zbx_malloc: allocating already allocated memory in json.c (Sasha)
+ - [DEV-282] fixes frontend vulnerabilities (Artem)
+
 Changes for 1.6.2
 
  - [ZBX-653] fixes for postgresql (Artem)
diff --git a/bin/win32/zabbix_agentd.exe b/bin/win32/zabbix_agentd.exe
index 8ecd516..05560c8 100755
Binary files a/bin/win32/zabbix_agentd.exe and b/bin/win32/zabbix_agentd.exe differ
diff --git a/bin/win32/zabbix_get.exe b/bin/win32/zabbix_get.exe
index 917209d..61fb39f 100644
Binary files a/bin/win32/zabbix_get.exe and b/bin/win32/zabbix_get.exe differ
diff --git a/bin/win32/zabbix_sender.exe b/bin/win32/zabbix_sender.exe
index 4cf2486..3a751a0 100644
Binary files a/bin/win32/zabbix_sender.exe and b/bin/win32/zabbix_sender.exe differ
diff --git a/bin/win64/zabbix_agentd.exe b/bin/win64/zabbix_agentd.exe
index d737133..31ac444 100755
Binary files a/bin/win64/zabbix_agentd.exe and b/bin/win64/zabbix_agentd.exe differ
diff --git a/build/win32/project/Makefile_agent b/build/win32/project/Makefile_agent
new file mode 100644
index 0000000..38dd8a8
--- /dev/null
+++ b/build/win32/project/Makefile_agent
@@ -0,0 +1,188 @@
+PROGNAME = ..\..\..\bin\win32\zabbix_agentd.exe
+CC = cl.exe /nologo
+LINKER = link.exe /NOLOGO
+RC = rc.exe
+MC = mc.exe
+MT = mt.exe
+MESSAGES_H = messages.h
+INCS = /I .\ /I ..\include /I ..\..\..\include /I ..\..\..\src\zabbix_agent
+CFLAGS = $(INCS) /O2 /Ob1 /GF /FD /EHsc /MT /Gy /W3 /c /TC /D _WINDOWS /D _CONSOLE /D _MBCS /D NDEBUG /D WIN32 /D HAVE_WINLDAP_H /D HAVE_ASSERT_H /D ZABBIX_SERVICE /D WITH_COMMON_METRICS /D WITH_SPECIFIC_METRICS /D WITH_SIMPLE_METRICS /D "_VC80_UPGRADE=0x0600"
+RESOURCE_H  = resource.res
+OBJS  = ..\..\..\src\libs\zbxcommon\alias.o ..\..\..\src\libs\zbxcommon\comms.o ..\..\..\src\libs\zbxcommon\gnuregex.o ..\..\..\src\libs\zbxcommon\misc.o ..\..\..\src\libs\zbxcommon\regexp.o ..\..\..\src\libs\zbxcommon\str.o ..\..\..\src\libs\zbxcommon\xml.o ..\..\..\src\libs\zbxcommon\zbxgetopt.o ..\..\..\src\libs\zbxcomms\comms.o ..\..\..\src\libs\zbxconf\cfg.o ..\..\..\src\libs\zbxcrypto\base64.o ..\..\..\src\libs\zbxcrypto\md5.o ..\..\..\src\libs\zbxjson\json.o ..\..\..\src\libs\zbxlog\log.o ..\..\..\src\libs\zbxplugin\zbxplugin.o ..\..\..\src\libs\zbxsys\mutexs.o ..\..\..\src\libs\zbxsys\symbols.o ..\..\..\src\libs\zbxsys\threads.o ..\..\..\src\libs\zbxsysinfo\common\common.o ..\..\..\src\libs\zbxsysinfo\common\file.o ..\..\..\src\libs\zbxsysinfo\common\http.o ..\..\..\src\libs\zbxsysinfo\common\net.o ..\..\..\src\libs\zbxsysinfo\common\system.o ..\..\..\src\libs\zbxsysinfo\simple\ntp.o ..\..\..\src\libs\zbxsysinfo\simple\simple.o ..\..\..\src\libs\zbxsysinfo\win32\cpu.
 o ..\..\..\src\libs\zbxsysinfo\win32\diskio.o ..\..\..\src\libs\zbxsysinfo\win32\diskspace.o ..\..\..\src\libs\zbxsysinfo\win32\inodes.o ..\..\..\src\libs\zbxsysinfo\win32\kernel.o ..\..\..\src\libs\zbxsysinfo\win32\memory.o ..\..\..\src\libs\zbxsysinfo\win32\net.o ..\..\..\src\libs\zbxsysinfo\win32\pdhmon.o ..\..\..\src\libs\zbxsysinfo\win32\proc.o ..\..\..\src\libs\zbxsysinfo\win32\sensors.o ..\..\..\src\libs\zbxsysinfo\win32\services.o ..\..\..\src\libs\zbxsysinfo\win32\swap.o ..\..\..\src\libs\zbxsysinfo\win32\uptime.o ..\..\..\src\libs\zbxsysinfo\win32\win32.o ..\..\..\src\libs\zbxsysinfo\sysinfo.o ..\..\..\src\libs\zbxwin32\perfmon.o ..\..\..\src\libs\zbxwin32\service.o ..\..\..\src\zabbix_agent\active.o ..\..\..\src\zabbix_agent\cpustat.o ..\..\..\src\zabbix_agent\diskdevices.o ..\..\..\src\zabbix_agent\eventlog.o ..\..\..\src\zabbix_agent\interfaces.o ..\..\..\src\zabbix_agent\listener.o ..\..\..\src\zabbix_agent\logfiles.o ..\..\..\src\zabbix_agent\perfstat.o ..\..\
 ..\src\zabbix_agent\stats.o ..\..\..\src\zabbix_agent\zabbix_agentd.o ..\..\..\src\zabbix_agent\zbxconf.o
+LIBS = ws2_32.lib psapi.lib pdh.lib Wldap32.lib advapi32.lib uuid.lib
+LFLAGS = /INCREMENTAL:NO /MANIFEST /MANIFESTFILE:"zabbix_agentd.exe.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:"zabbix_agentd.pdb" /SUBSYSTEM:CONSOLE /DYNAMICBASE:NO /MACHINE:X86
+
+all: $(PROGNAME)
+
+clean:
+	del $(OBJS) $(RESOURCE_H) $(MESSAGES_H) $(PROGNAME) messages.rc MSG00001.bin zabbix_agentd.exe.manifest
+
+$(PROGNAME): $(MESSAGES_H) $(OBJS) $(RESOURCE_H)
+	$(LINKER) $(OBJS) $(RESOURCE_H) /OUT:$(PROGNAME) $(LFLAGS) $(LIBS)
+	$(MT) /outputresource:"$(PROGNAME);#1" /manifest zabbix_agentd.exe.manifest /nologo
+
+$(MESSAGES_H): messages.mc
+	$(MC) -U -s -h ".\\" -r ".\\" messages.mc
+
+$(RESOURCE_H): resource.rc
+	$(RC) /d "NDEBUG" /d "_VC80_UPGRADE=0x0600" /l 0x419 /fo"$(RESOURCE_H)" resource.rc
+	
+..\..\..\src\libs\zbxcommon\alias.o: ..\..\..\src\libs\zbxcommon\alias.c
+	$(CC) ..\..\..\src\libs\zbxcommon\alias.c /Fo"..\..\..\src\libs\zbxcommon\alias.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\comms.o: ..\..\..\src\libs\zbxcommon\comms.c
+	$(CC) ..\..\..\src\libs\zbxcommon\comms.c /Fo"..\..\..\src\libs\zbxcommon\comms.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\gnuregex.o: ..\..\..\src\libs\zbxcommon\gnuregex.c
+	$(CC) ..\..\..\src\libs\zbxcommon\gnuregex.c /Fo"..\..\..\src\libs\zbxcommon\gnuregex.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\misc.o: ..\..\..\src\libs\zbxcommon\misc.c
+	$(CC) ..\..\..\src\libs\zbxcommon\misc.c /Fo"..\..\..\src\libs\zbxcommon\misc.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\regexp.o: ..\..\..\src\libs\zbxcommon\regexp.c
+	$(CC) ..\..\..\src\libs\zbxcommon\regexp.c /Fo"..\..\..\src\libs\zbxcommon\regexp.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\str.o: ..\..\..\src\libs\zbxcommon\str.c
+	$(CC) ..\..\..\src\libs\zbxcommon\str.c /Fo"..\..\..\src\libs\zbxcommon\str.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\xml.o: ..\..\..\src\libs\zbxcommon\xml.c
+	$(CC) ..\..\..\src\libs\zbxcommon\xml.c /Fo"..\..\..\src\libs\zbxcommon\xml.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcommon\zbxgetopt.o: ..\..\..\src\libs\zbxcommon\zbxgetopt.c
+	$(CC) ..\..\..\src\libs\zbxcommon\zbxgetopt.c /Fo"..\..\..\src\libs\zbxcommon\zbxgetopt.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcomms\comms.o: ..\..\..\src\libs\zbxcomms\comms.c
+	$(CC) ..\..\..\src\libs\zbxcomms\comms.c /Fo"..\..\..\src\libs\zbxcomms\comms.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxconf\cfg.o: ..\..\..\src\libs\zbxconf\cfg.c
+	$(CC) ..\..\..\src\libs\zbxconf\cfg.c /Fo"..\..\..\src\libs\zbxconf\cfg.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcrypto\base64.o: ..\..\..\src\libs\zbxcrypto\base64.c
+	$(CC) ..\..\..\src\libs\zbxcrypto\base64.c /Fo"..\..\..\src\libs\zbxcrypto\base64.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxcrypto\md5.o: ..\..\..\src\libs\zbxcrypto\md5.c
+	$(CC) ..\..\..\src\libs\zbxcrypto\md5.c /Fo"..\..\..\src\libs\zbxcrypto\md5.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxjson\json.o: ..\..\..\src\libs\zbxjson\json.c
+	$(CC) ..\..\..\src\libs\zbxjson\json.c /Fo"..\..\..\src\libs\zbxjson\json.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxlog\log.o: ..\..\..\src\libs\zbxlog\log.c
+	$(CC) ..\..\..\src\libs\zbxlog\log.c /Fo"..\..\..\src\libs\zbxlog\log.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxplugin\zbxplugin.o: ..\..\..\src\libs\zbxplugin\zbxplugin.c
+	$(CC) ..\..\..\src\libs\zbxplugin\zbxplugin.c /Fo"..\..\..\src\libs\zbxplugin\zbxplugin.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsys\mutexs.o: ..\..\..\src\libs\zbxsys\mutexs.c
+	$(CC) ..\..\..\src\libs\zbxsys\mutexs.c /Fo"..\..\..\src\libs\zbxsys\mutexs.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsys\symbols.o: ..\..\..\src\libs\zbxsys\symbols.c
+	$(CC) ..\..\..\src\libs\zbxsys\symbols.c /Fo"..\..\..\src\libs\zbxsys\symbols.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsys\threads.o: ..\..\..\src\libs\zbxsys\threads.c
+	$(CC) ..\..\..\src\libs\zbxsys\threads.c /Fo"..\..\..\src\libs\zbxsys\threads.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\common\common.o: ..\..\..\src\libs\zbxsysinfo\common\common.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\common\common.c /Fo"..\..\..\src\libs\zbxsysinfo\common\common.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\common\file.o: ..\..\..\src\libs\zbxsysinfo\common\file.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\common\file.c /Fo"..\..\..\src\libs\zbxsysinfo\common\file.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\common\http.o: ..\..\..\src\libs\zbxsysinfo\common\http.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\common\http.c /Fo"..\..\..\src\libs\zbxsysinfo\common\http.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\common\net.o: ..\..\..\src\libs\zbxsysinfo\common\net.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\common\net.c /Fo"..\..\..\src\libs\zbxsysinfo\common\net.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\common\system.o: ..\..\..\src\libs\zbxsysinfo\common\system.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\common\system.c /Fo"..\..\..\src\libs\zbxsysinfo\common\system.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\simple\ntp.o: ..\..\..\src\libs\zbxsysinfo\simple\ntp.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\simple\ntp.c /Fo"..\..\..\src\libs\zbxsysinfo\simple\ntp.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\simple\simple.o: ..\..\..\src\libs\zbxsysinfo\simple\simple.c
+	$(CC) ..\..\..\src\libs\zbxsysinfo\simple\simple.c /Fo"..\..\..\src\libs\zbxsysinfo\simple\simple.o" $(CFLAGS)
+
+..\..\..\src\libs\zbxsysinfo\win32\cpu.o: ..\..\..\src\libs\zbxsysinfo\win32\cpu.c
[...26873 lines suppressed...]
 {
-	int i,j;
-	DB_RESULT	result;
-	DB_ROW		row;
-	char		new_expression[MAX_STRING_LEN];
-	char		new_expression_esc[MAX_STRING_LEN];
+	struct conv_t
+	{
+	        char	*rel;
+        	int	type;
+	};
+
+	struct special_conv_t
+	{
+	        char		*table_name, *field_name, *type_field_name;
+		struct conv_t	convs[10];
+	};
+
+	struct special_conv_t special_convs[]=
+	{
+		{"sysmaps_elements",	"elementid",	"elementtype",
+			{
+			{"hosts",	SYSMAP_ELEMENT_TYPE_HOST},
+			{"sysmaps",	SYSMAP_ELEMENT_TYPE_MAP},
+			{"triggers",	SYSMAP_ELEMENT_TYPE_TRIGGER},
+			{"groups",	SYSMAP_ELEMENT_TYPE_HOST_GROUP},
+			{"images",	SYSMAP_ELEMENT_TYPE_IMAGE},
+			{NULL}
+			}
+		},
+		{"events",		"objectid",	"object",
+			{
+			{"triggers",	EVENT_OBJECT_TRIGGER},
+			{"dhosts",	EVENT_OBJECT_DHOST},
+			{"dservices",	EVENT_OBJECT_DSERVICE},
+			{NULL}
+			}
+		},
+		{"operations",		"objectid",	"object",
+			{
+			{"users",	OPERATION_OBJECT_USER},
+			{"usrgrp",	OPERATION_OBJECT_GROUP},
+			{NULL}
+			}
+		},
+		{"ids",			"nextid",	NULL,
+			{
+			{NULL}
+			}
+		},
+		{"node_cksum",		"recordid",	NULL,
+			{
+			{NULL}
+			}
+		},
+		{"screens_items",	"resourceid",	"resourcetype",
+			{
+			{"graphs",	SCREEN_RESOURCE_GRAPH},
+			{"items",	SCREEN_RESOURCE_SIMPLE_GRAPH},
+			{"sysmaps",	SCREEN_RESOURCE_MAP},
+			{"items",	SCREEN_RESOURCE_PLAIN_TEXT},
+			{"groups",	SCREEN_RESOURCE_HOSTS_INFO},
+/*			{"",	SCREEN_RESOURCE_TRIGGERS_INFO},
+			{"",	SCREEN_RESOURCE_SERVER_INFO},
+			{"",	SCREEN_RESOURCE_CLOCK},*/
+			{"screens",	SCREEN_RESOURCE_SCREEN},
+			{"groups",	SCREEN_RESOURCE_TRIGGERS_OVERVIEW},
+			{"groups",	SCREEN_RESOURCE_DATA_OVERVIEW},
+/*			{"",	SCREEN_RESOURCE_URL},
+			{"",	SCREEN_RESOURCE_ACTIONS},
+			{"",	SCREEN_RESOURCE_EVENTS},*/
+			{NULL}
+			}
+		},
+		{NULL}
+	};
+
+	int		i, j, s, t;
 	zbx_uint64_t	prefix;
+	const ZBX_TABLE	*r_table;
 
 	if(old_id!=0)
 	{
@@ -135,55 +325,84 @@ int change_nodeid(int old_id, int new_id)
 	printf("Converting tables ");
 	fflush(stdout);
 
-	for(i=0;tables[i].table!=0;i++)
+	for (i = 0; NULL != tables[i].table; i++)
 	{
 		printf(".");
 		fflush(stdout);
 
-		prefix = (zbx_uint64_t)__UINT64_C(100000000000000)*(zbx_uint64_t)new_id;
-		if(tables[i].flags & ZBX_SYNC)
+		for (j = 0; NULL != tables[i].fields[j].name; j++)
 		{
-			prefix += (zbx_uint64_t)__UINT64_C(100000000000)*(zbx_uint64_t)new_id;
-		}
+			for (s = 0; NULL != special_convs[s].table_name; s++)
+				if (0 == strcmp(special_convs[s].table_name, tables[i].table) &&
+						0 == strcmp(special_convs[s].field_name, tables[i].fields[j].name))
+					break;
 
-		j=0;
-		while(tables[i].fields[j].name != 0)
-		{
-			if(tables[i].fields[j].type == ZBX_TYPE_ID)
+			if (NULL != special_convs[s].table_name)
 			{
-				DBexecute("update %s set %s=%s+"ZBX_FS_UI64" where %s>0\n",
-					tables[i].table,
-					tables[i].fields[j].name,
-					tables[i].fields[j].name,
-					prefix,
-					tables[i].fields[j].name);
+				for (t = 0; NULL != special_convs[s].convs[t].rel; t++)
+				{
+					convert_special_field(old_id, new_id, special_convs[s].table_name, special_convs[s].field_name,
+							special_convs[s].type_field_name, special_convs[s].convs[t].rel,
+							special_convs[s].convs[t].type);
+				}
+				continue;
 			}
-			j++;
-		}
 
-		if(strcmp(tables[i].table, "functions") == 0)
-		{
-			/* Special processing for trigger expressions */
-			result=DBselect("select expression,triggerid from triggers");
-			while((row=DBfetch(result)))
+			if (tables[i].fields[j].type == ZBX_TYPE_ID)
 			{
-				memset(new_expression, 0, MAX_STRING_LEN);
-				convert_trigger_expression(old_id, new_id, prefix, row[0], new_expression);
-				DBescape_string(new_expression, new_expression_esc,MAX_STRING_LEN);
-				DBexecute("update triggers set expression='%s' where triggerid=%s",
-						new_expression_esc,
-						row[1]);
-			}
-			DBfree_result(result);
+				if (0 == strcmp(tables[i].fields[j].name, tables[i].recid))	/* primaky key */
+				{
+					prefix = (zbx_uint64_t)__UINT64_C(100000000000000)*(zbx_uint64_t)new_id;
+
+					if (tables[i].flags & ZBX_SYNC)
+						prefix += (zbx_uint64_t)__UINT64_C(100000000000)*(zbx_uint64_t)new_id;
+				}
+				else if (NULL != tables[i].fields[j].rel)	/* relations */
+				{
+					if (NULL == (r_table = DBget_table(tables[i].fields[j].rel)))
+					{
+						printf("%s.%s FAILED\n", tables[i].table, tables[i].fields[j].name);
+						fflush(stdout);
+						continue;
+					}
 
+					prefix = (zbx_uint64_t)__UINT64_C(100000000000000)*(zbx_uint64_t)new_id;
+
+					if (r_table->flags & ZBX_SYNC)
+						prefix += (zbx_uint64_t)__UINT64_C(100000000000)*(zbx_uint64_t)new_id;
+				}
+				else if (0 == strcmp("profiles", tables[i].table))	/* special processing for table 'profiles' */
+				{
+					convert_profiles(old_id, new_id, tables[i].fields[j].name);
+					continue;
+				}
+				else
+				{
+					printf("%s.%s FAILED\n", tables[i].table, tables[i].fields[j].name);
+					fflush(stdout);
+					continue;
+				}
+
+				DBexecute("update %s set %s=%s+" ZBX_FS_UI64 " where %s>0",
+						tables[i].table,
+						tables[i].fields[j].name,
+						tables[i].fields[j].name,
+						prefix,
+						tables[i].fields[j].name);
+			}
 		}
 	}
+
+	/* Special processing for trigger expressions */
+	convert_triggers_expression(old_id, new_id);
+
 	DBexecute("insert into nodes (nodeid,name,ip,nodetype) values (%d,'Local node','127.0.0.1',1)",
-		new_id);
+			new_id);
+
 	DBcommit();
 	
 	DBclose();
-	printf(" done.\n\nConversion completed.\n");
+	printf(" done.\nConversion completed.\n");
 
 	return SUCCEED;
 }


Index: zabbix.spec
===================================================================
RCS file: /cvs/pkgs/rpms/zabbix/devel/zabbix.spec,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- zabbix.spec	25 Feb 2009 18:29:30 -0000	1.33
+++ zabbix.spec	6 Mar 2009 17:27:52 -0000	1.34
@@ -1,6 +1,6 @@
 Name:           zabbix
 Version:        1.6.2
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Open-source monitoring solution for your IT infrastructure
 
 Group:          Applications/Internet
@@ -14,6 +14,7 @@
 Source5:        zabbix-logrotate.in
 
 Patch0:         zabbix-1.6.2-cpustats.patch
+Patch1:		zabbix-1.6.3-pre.patch
 
 Buildroot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -197,6 +198,7 @@
 %prep
 %setup0 -q
 %patch0 -p1 -b .cpustats
+%patch1 -p1 -b .pre
 
 chmod -R a+rX .
 
@@ -463,6 +465,10 @@
 %defattr(-,root,root,-)
 
 %changelog
+* Wed Mar  4 2009 Jeffrey C. Ollie <jeff at ocjtech.us> - 1.6.2-4
+- Update to a SVN snapshot of the upstream 1.6 branch to fix security
+  issue (BZ#488501)
+
 * Wed Feb 25 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.6.2-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
 




More information about the fedora-extras-commits mailing list