Index: /branches/amp_4_0/amp.spec
===================================================================
--- /branches/amp_4_0/amp.spec	(revision 2571)
+++ /branches/amp_4_0/amp.spec	(working copy)
@@ -1,37 +1,37 @@
 Name:           amp
-Version:        3.7.1.0
+Version:        4.0.0
 Release:        1%{?dist}
 Summary:        Array Management Platform
-Group:          Development/Tools
-License:        LGPL
-URL:            www.arraynetworks.com
+Group:          Applications/System
+License:        Proprietary
+URL:            https://www.arraynetworks.com
 Source0:        amp.tar.gz
+BuildArch:      x86_64
+AutoReq:        no
 
-BuildArch: x86_64
-
-Requires: glibc
-Requires: openssl
-Requires: keepalived
-Requires: httpd
-Requires: mod_ssl
-Requires: tar
-Requires: systemd
-Requires: traceroute
-Requires: iputils
-Requires: logrotate
-Requires: pcre
-Requires: ntp
-Requires: tftp
-Requires: net-tools
-Requires: python-psycopg2
-Requires: json-c
-Requires: java
+Requires:       glibc
+Requires:       openssl
+Requires:       keepalived
+Requires:       httpd
+Requires:       mod_ssl
+Requires:       tar
+Requires:       systemd
+Requires:       traceroute
+Requires:       iputils
+Requires:       logrotate
+Requires:       pcre
+Requires:       chrony
+Requires:       tftp
+Requires:       net-tools
+Requires:       python3-psycopg2
+Requires:       json-c
+Requires:       java
 
 BuildRequires: pcre-devel
-AutoReq: no
 
+
 %description
-virtulization configuration client for arraynetworks.
+Array Management Platform (AMP) is designed to help customers centrally manage and monitor products released by Array Networks
 
 %prep
 %setup -q -c
@@ -50,7 +50,7 @@
 
 if [ -f "/usr/local/bin/composer/composer_node" ]; then
         /usr/local/bin/composer/composer_node stop
-    fi
+fi
 mkdir -p /var/tmp/composer
 tar -zxvf /ca/etc/composer-2.5.0.2.tgz -C /var/tmp/composer
 mkdir -p /usr/local/bin/composer
@@ -129,7 +129,7 @@
 install -dDm 0755 %{buildroot}/etc/sysctl.d/
 install -dDm 0755 %{buildroot}/etc/security/limits.d/
 install -dDm 0755 %{buildroot}/etc/sysconfig/network-scripts/
-install -dDm 0755 %{buildroot}/usr/lib64/python2.7/site-packages/
+install -dDm 0755 %{buildroot}/usr/lib64/python3.13/site-packages/
 install -dDm 0755 %{buildroot}/etc/NetworkManager/conf.d/
 
 install -Dm 0755 src/bin/telnet %{buildroot}/usr/bin/
@@ -190,8 +190,7 @@
 install -Dm 0644 src/openssh/sshd_config %{buildroot}/ca/etc/
 install -Dm 0755 src/openssh/ssh-regenkey.sh %{buildroot}/ca/bin/
 install -Dm 0755 src/webui/tftp/pulltftp %{buildroot}/ca/bin/
-install -Dm 0755 src/library/libpyexauth/_pyexauth.so %{buildroot}/usr/lib64/python2.7/site-packages/
-install -Dm 0755 src/library/libpyexauth/_cffi_backend.so %{buildroot}/usr/lib64/python2.7/site-packages/
+install -Dm 0755 src/library/libpyexauth/_pyexauth.so %{buildroot}/usr/lib64/python3.13/site-packages/
 install -Dm 0644 conf/array.conf %{buildroot}/etc/NetworkManager/conf.d/array.conf
 install -Dm 0755 scripts/check_build.py %{buildroot}/ca/bin/check_build.py
 install -Dm 0755 scripts/check_adc_ssl.py %{buildroot}/ca/bin/check_adc_ssl.py
@@ -265,8 +264,8 @@
 %attr (755,root,root)/ca/bin/ssh-regenkey.sh
 %attr (644,root,root)/ca/etc/sshd_config
 %attr (755,root,root)/ca/bin/pulltftp
-%attr (755,root,root)/usr/lib64/python2.7/site-packages/_pyexauth.so
-%attr (755,root,root)/usr/lib64/python2.7/site-packages/_cffi_backend.so
+%attr (755,root,root)/usr/lib64/python3.13/site-packages/_pyexauth.so
+#%attr (755,root,root)/usr/lib64/python3.13/site-packages/_cffi_backend.so
 %attr (644,root,root)/etc/NetworkManager/conf.d/array.conf
 %attr (755,root,root)/ca/bin/check_build.py
 %attr (755,root,root)/ca/bin/check_adc_ssl.py
@@ -284,6 +283,6 @@
    %{nil}
 
 %changelog
-* Mon Jun 23 2014 Jarod.W <work.iec23801@gmail.com> - 1.0-1
-- init the spec.
+* Tue May 14 2025 AMP Dev - 4.x
+- Initial release
 
Index: /branches/amp_4_0/src/backend/backend.c
===================================================================
--- /branches/amp_4_0/src/backend/backend.c	(revision 2571)
+++ /branches/amp_4_0/src/backend/backend.c	(working copy)
@@ -18,7 +18,6 @@
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
-#include <sys/sysctl.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netinet/tcp.h>
@@ -463,7 +462,7 @@
 
 	if ( pos == NULL ) {
 	} else {
-		strncpy(pos, " \n", 2);
+		strlcpy(pos, " \n", sizeof(pos));
 	}
 
 	/*myinputlim++;  for integration with yyparse*/
Index: /branches/amp_4_0/src/backend/sys_cmd.c
===================================================================
--- /branches/amp_4_0/src/backend/sys_cmd.c	(revision 2571)
+++ /branches/amp_4_0/src/backend/sys_cmd.c	(working copy)
@@ -24,7 +24,6 @@
 #include <arpa/inet.h>
 #include <sys/sysinfo.h>
 #include <sys/fcntl.h>
-#include <sys/sysctl.h>
 #include <sys/param.h>
 #include <sys/utsname.h>
 #include <ctype.h>
@@ -409,10 +408,10 @@
 	}
 
 	bzero(&entry, sizeof(entry));
-	readdir_r(dp, &entry, &res_p);
+	readdir(dp);
 	while (res_p != NULL) {
-		if (strncmp(entry.d_name, SYS_SNAP_GPG, sizeof(SYS_SNAP_GPG)) != 0) {		   	
-			readdir_r(dp, &entry, &res_p);
+		if (strncmp(entry.d_name, SYS_SNAP_GPG, sizeof(SYS_SNAP_GPG)) != 0) {
+		    readdir(dp);
 			continue;
 		}
 		p = strstr(entry.d_name, SYS_SNAP_GPG_SUFFIX);
@@ -429,8 +428,7 @@
 		ctime_r(&sbuf.st_mtime, buf);
 		buf[24] = '\0';	
 		printf("%-20s\n", buf+4);
-
-		readdir_r(dp, &entry, &res_p);
+        readdir(dp);
 	}
 
 	return 0;
@@ -510,17 +508,17 @@
 
 	num = 0;
 	bzero(&entry, sizeof(entry));
-	readdir_r(dp, &entry, &res_p);
+    readdir(dp);
 	while (res_p != NULL) {
 		p = strstr(entry.d_name, SYS_SNAP_GPG_SUFFIX);
-		if (p == NULL) {		   	
-			readdir_r(dp, &entry, &res_p);
+		if (p == NULL) {
+            readdir(dp);
 			continue;
 		} else {
 			size_t len = strlen(entry.d_name);
 			/* the suffix must be SYS_SNAP_GPG_SUFFIX */
 			if ((entry.d_name + len - sizeof(SYS_SNAP_GPG_SUFFIX) + 1) != p) {
-				readdir_r(dp, &entry, &res_p);
+			    readdir(dp);
 				continue;
 			}
 		}
@@ -534,7 +532,7 @@
 		}
 		snprintf(buf, sizeof(buf), "cp -f %s%s %s%s", ARRAY_DEBUG_BASE, entry.d_name, ARRAY_DEBUG_BASE, "sys_debug_all");
 		system(buf);
-		readdir_r(dp, &entry, &res_p);
+		readdir(dp);
 	}
 	closedir(dp);
 
@@ -1739,7 +1737,6 @@
 	int i = 0;
 	printf("System Memory Status:\n");
 
-	memset(&tm, 0, sizeof(struct tm));
 	time(&nowtime);
 	tm = localtime(&nowtime);
 	printf("%20s: %d:%d:%d\n", "time", tm->tm_hour, tm->tm_min, tm->tm_sec);
@@ -1834,12 +1831,8 @@
 	time_t nowtime = 0;
 	struct tm *tm = NULL;
 
-	memset(tmp1, 0, sizeof(tmp1));
-	memset(tmp2, 0, sizeof(tmp2));
-	
 	printf("System CPU Status:\n");
 
-	memset(&tm, 0, sizeof(struct tm));
 	time(&nowtime);
 	tm = localtime(&nowtime);
 	printf("%17s: %d:%d:%d\n", "time", tm->tm_hour, tm->tm_min, tm->tm_sec);
@@ -1927,7 +1920,6 @@
 	
 	printf("System Disk Status:\n");
 
-	memset(&tm, 0, sizeof(struct tm));
 	time(&nowtime);
 	tm = localtime(&nowtime);
 	printf("%18s: %d:%d:%d\n", "time",tm->tm_hour, tm->tm_min, tm->tm_sec);
@@ -1944,7 +1936,6 @@
 	snprintf(cmd, sizeof(cmd), "%s", "du -s /ca | awk '{printf $1}'");
 	fp = popen(cmd, "r");
 	if(fp){
-		memset(buf, 0, sizeof(buf));
 		if(fread(buf, sizeof(buf), 1, fp) >= 0){
 			sscanf(buf, "%lu", &im_space);
 			float ims1 = (((float)used * 100)/total);
@@ -2129,7 +2120,7 @@
 show_system_repo(void)
 {
     char repo_cmd[COMMAND_LEN] = { '\0' };
-    char cmd_buf[128] = { '\0' };
+    char cmd_buf[512] = { '\0' };
     FILE *fp;
 
     snprintf(repo_cmd, COMMAND_LEN, "sed -n '3p' %s | cut -c9-", REPO_PATH);
@@ -2159,7 +2150,7 @@
     char  buff[64];
     fgets(buff, sizeof(buff), fp);
     printf("%s", buff);
-    fclose(fp);
+    pclose(fp);
     return 0;
 }
 
@@ -2202,7 +2193,7 @@
 	while (fgets(buff, sizeof(buff), fp)) {
 		printf("%s", buff);
 	}   
-	fclose(fp);
+	pclose(fp);
 
 	return 0;
 }
Index: /branches/amp_4_0/src/backend/sys_tool.c
===================================================================
--- /branches/amp_4_0/src/backend/sys_tool.c	(revision 2571)
+++ /branches/amp_4_0/src/backend/sys_tool.c	(working copy)
@@ -14,7 +14,6 @@
  */
 
 #include <sys/types.h>
-#include <sys/sysctl.h>
 #include <sys/time.h>
 #include <sys/param.h>
 #include <sys/resource.h>
@@ -1153,8 +1152,8 @@
 	fclose(fp);
 	(void) closedir(dirp);
 	/* sort the result and output */
-	snprintf(cmd, sizeof(cmd), "/usr/bin/sort +3 -4 +1 -2M +2 -3 +4 -5 %s",
-		 in);
+	int max_buff = 2048;
+	snprintf(cmd, max_buff, "/usr/bin/sort +3 -4 +1 -2M +2 -3 +4 -5 %s",in);
 	std_close_on_exec_off(); /* open standard fd */
 	system(cmd);
 	std_close_on_exec_on(); /* close standad fd */
@@ -1518,7 +1517,8 @@
 	}
 
 	ctime_no_newline(snow);
-	snprintf(buf, MAX_LINE_SIZE + 1, "#Last configuration change at "
+	int max_buff = 4096;
+	snprintf(buf, max_buff, "#Last configuration change at "
 		 "%s by %s\n", snow, sess_state.account);
 
 	if (write_buff(buf, config_fd) < 0) {
@@ -2191,7 +2191,7 @@
 		return -1;
 	}
 
-	sprintf(spasswd, "%s\n", passwd);
+	snprintf(spasswd, sizeof(spasswd), "%.*s\n", (int)(sizeof(spasswd) - 2), passwd);
 	/*change session state*/
 	sess_state.acc_level = CLI_LEVEL_ENABLE;
 	Fclose(fp_passwd);
@@ -2829,10 +2829,11 @@
 	}
 
 	chdir(CATMP_DIR);
-	snprintf(cmd, sizeof(cmd), "cp -fr %s/* %s", restore_path, CATMP_DIR);
+	int max_buff = 5120;
+	snprintf(cmd, max_buff, "cp -fr %s/* %s", restore_path, CATMP_DIR);
 	system(cmd);
 
-	snprintf(cmd, sizeof(cmd), "rm -fr %s",restore_path);
+	snprintf(cmd, max_buff, "rm -fr %s",restore_path);
 	system(cmd);
 	chdir("/");
 
@@ -3049,7 +3050,7 @@
     /*delete multiple file(s)*/
     while ((file = readdir(dir)) != NULL) {
         /*remove the file, firstly get the full pathname*/
-        snprintf(fname, sizeof(fname), "%s%s", USR_CFG_DIR, file->d_name);
+        snprintf(fname, BUFSIZE, "%s%s", USR_CFG_DIR, file->d_name);
         unlink(fname);
     }
     closedir(dir);
Index: /branches/amp_4_0/src/backend/sys_update.c
===================================================================
--- /branches/amp_4_0/src/backend/sys_update.c	(revision 2571)
+++ /branches/amp_4_0/src/backend/sys_update.c	(working copy)
@@ -193,7 +193,7 @@
 amp_system_update(const char *url, char *option)
 {
     int ret = -1;
-    int deferred;
+    int deferred = 0;
     char *download_cli = NULL;
     char *upgrade_cli = NULL;
     char *package_url = NULL;
Index: /branches/amp_4_0/src/cli/Makefile
===================================================================
--- /branches/amp_4_0/src/cli/Makefile	(revision 2571)
+++ /branches/amp_4_0/src/cli/Makefile	(working copy)
@@ -11,7 +11,7 @@
 	-L ../library/ca_util -lcautil -L ../library/version -lversion -L ../library/management -lsuppress_print \
 	-L ../library/avx_log -lavxlog 
 
-FLAGS += $(JSON_LIB) -I../library/avx_log 
+FLAGS += $(JSON_LIB) -I../library/avx_log
 
 all: ca_shell
 
Index: /branches/amp_4_0/src/cli/shell.c
===================================================================
--- /branches/amp_4_0/src/cli/shell.c	(revision 2571)
+++ /branches/amp_4_0/src/cli/shell.c	(working copy)
@@ -46,7 +46,7 @@
 #include <sys/file.h>
 #define MAX_LOG_STRING 1024
 #define DISP_BYTE	256
-char token [MAX_LOG_STRING];
+char token [MAX_LOG_STRING * 6];
 /* bug 11939, end */
 
 /* bug 13614, tangmeng, 20060712 */
Index: /branches/amp_4_0/src/library/libpyexauth/Makefile
===================================================================
--- /branches/amp_4_0/src/library/libpyexauth/Makefile	(revision 2571)
+++ /branches/amp_4_0/src/library/libpyexauth/Makefile	(working copy)
@@ -5,7 +5,7 @@
 all: _pyexauth.so
 
 _pyexauth.so:
-	cd ./$(.CURDIR) && ./$(.CURDIR)/pyexauth_build.py
+	cd ./$(.CURDIR) && python3 ./$(.CURDIR)/pyexauth_build.py
 
 install:
 	install -m 755 ./$(.CURDIR)/_pyexauth.so ./$(.CURDIR)/../../webui/webui/htdocs/new/src/hive
Index: /branches/amp_4_0/src/library/node_man/node_sys.c
===================================================================
--- /branches/amp_4_0/src/library/node_man/node_sys.c	(revision 2571)
+++ /branches/amp_4_0/src/library/node_man/node_sys.c	(working copy)
@@ -16,7 +16,6 @@
  */
 
 #include <sys/types.h>
-#include <sys/sysctl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
Index: /branches/amp_4_0/src/webui/tftp/tftp.c
===================================================================
--- /branches/amp_4_0/src/webui/tftp/tftp.c	(revision 2571)
+++ /branches/amp_4_0/src/webui/tftp/tftp.c	(working copy)
@@ -78,7 +78,7 @@
 #define PKTSIZE    SEGSIZE+4
 char    ackbuf[PKTSIZE];
 int	timeout;
-jmp_buf	toplevel;
+
 jmp_buf	timeoutbuf;
 
 #define FIFO_5040 "/ca/conf/fifo5040"
Index: /branches/amp_4_0/src/webui/webui/htdocs/new/src/client/Gruntfile.js
===================================================================
--- /branches/amp_4_0/src/webui/webui/htdocs/new/src/client/Gruntfile.js	(revision 2571)
+++ /branches/amp_4_0/src/webui/webui/htdocs/new/src/client/Gruntfile.js	(working copy)
@@ -241,7 +241,7 @@
 
         bgShell: {
             update_index_html: {
-              cmd: 'python ../update_index_html.py',
+              cmd: 'python3 ../update_index_html.py',
               bg: false,
             }
         }
