diff --git a/SOURCES/net-snmp-5.7.2-acfs.patch b/SOURCES/net-snmp-5.7.2-acfs.patch index 0bfe198..249281f 100644 --- a/SOURCES/net-snmp-5.7.2-acfs.patch +++ b/SOURCES/net-snmp-5.7.2-acfs.patch @@ -1,6 +1,6 @@ -diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.orig net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c ---- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.orig 2018-04-05 18:29:29.042682282 +0200 -+++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-04-05 19:03:16.270523986 +0200 +diff -urNp a/agent/mibgroup/hardware/fsys/fsys_mntent.c b/agent/mibgroup/hardware/fsys/fsys_mntent.c +--- a/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-08-14 10:42:04.298706747 +0200 ++++ b/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-08-14 10:42:27.177735016 +0200 @@ -142,6 +142,7 @@ _fsys_type( char *typename ) !strcmp(typename, MNTTYPE_SIMFS) || !strcmp(typename, MNTTYPE_VZFS) || @@ -9,9 +9,9 @@ diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.orig net-snmp !strcmp(typename, MNTTYPE_LOFS)) return NETSNMP_FS_TYPE_OTHER; -diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.orig net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h ---- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.orig 2018-04-05 18:28:36.694091896 +0200 -+++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h 2018-04-05 20:14:55.695813461 +0200 +diff -urNp a/agent/mibgroup/hardware/fsys/mnttypes.h b/agent/mibgroup/hardware/fsys/mnttypes.h +--- a/agent/mibgroup/hardware/fsys/mnttypes.h 2018-08-14 10:42:04.298706747 +0200 ++++ b/agent/mibgroup/hardware/fsys/mnttypes.h 2018-08-14 10:42:27.177735016 +0200 @@ -151,6 +151,9 @@ #ifndef MNTTYPE_BTRFS #define MNTTYPE_BTRFS "btrfs" @@ -22,3 +22,16 @@ diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.orig net-snmp-5. /* * File systems to skip +diff -urNp a/agent/mibgroup/hardware/fsys/mounts.h b/agent/mibgroup/hardware/fsys/mounts.h +--- a/agent/mibgroup/hardware/fsys/mounts.h 2012-10-10 00:28:58.000000000 +0200 ++++ b/agent/mibgroup/hardware/fsys/mounts.h 2018-08-14 10:44:30.798843141 +0200 +@@ -56,6 +56,9 @@ + #ifndef MOUNT_UFS + #define MOUNT_UFS "ufs" + #endif ++#ifndef MOUNT_ACFS ++#define MOUNT_ACFS "acfs" ++#endif + + /* + #ifndef MNTTYPE_AFS diff --git a/SOURCES/net-snmp-5.7.2-fsync.patch b/SOURCES/net-snmp-5.7.2-fsync.patch new file mode 100644 index 0000000..6076dae --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-fsync.patch @@ -0,0 +1,71 @@ +diff -urNp old/configure new/configure +--- old/configure 2018-09-06 11:04:16.372792568 +0200 ++++ new/configure 2018-09-06 11:04:44.475765043 +0200 +@@ -25265,7 +25265,7 @@ fi + + + # Agent: +-for ac_func in cgetnext chown execv gai_strerror getgrnam gethostname getloadavg getpid getpwnam hasmntopt initgroups if_nameindex if_indextoname if_nametoindex localtime_r mkstemp mktime poll regcomp setgid setgroups setmntent setuid sigaction sigblock sighold sigprocmask statfs statvfs stime strncasecmp system uname usleep ++for ac_func in cgetnext chown execv forkall fsync gai_strerror getgrnam gethostname getloadavg getpid getpwnam hasmntopt initgroups if_nameindex if_indextoname if_nametoindex localtime_r mkstemp mktime poll regcomp setgid setgroups setmntent setuid sigaction sigblock sighold sigprocmask statfs statvfs stime strncasecmp system uname usleep + do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` + ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +diff -urNp old/configure.d/config_os_functions new/configure.d/config_os_functions +--- old/configure.d/config_os_functions 2018-09-06 11:04:16.396792546 +0200 ++++ new/configure.d/config_os_functions 2018-09-06 11:04:44.508765009 +0200 +@@ -88,7 +88,8 @@ AC_REPLACE_FUNCS([getopt inet_nto + + # Agent: + AC_CHECK_FUNCS([cgetnext chown execv ] dnl +- [gai_strerror getgrnam ] dnl ++ [forkall fsync ] dnl ++ [gai_strerror getgrnam ] dnl + [gethostname getloadavg ] dnl + [getpid getpwnam ] dnl + [hasmntopt initgroups ] dnl +diff -urNp old/include/net-snmp/net-snmp-config.h.in new/include/net-snmp/net-snmp-config.h.in +--- old/include/net-snmp/net-snmp-config.h.in 2018-09-06 11:04:16.370792571 +0200 ++++ new/include/net-snmp/net-snmp-config.h.in 2018-09-06 11:04:44.492765026 +0200 +@@ -176,6 +176,9 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_FSTAB_H + ++/* Define to 1 if you have the `fsync' function. */ ++#undef HAVE_FSYNC ++ + /* Define to 1 if you have the `funlockfile' function. */ + #undef HAVE_FUNLOCKFILE + +diff -urNp old/net-snmp-create-v3-user.in new/net-snmp-create-v3-user.in +--- old/net-snmp-create-v3-user.in 2018-09-06 11:04:16.372792568 +0200 ++++ new/net-snmp-create-v3-user.in 2018-09-13 09:17:05.427712857 +0200 +@@ -148,3 +148,4 @@ if test ! -d $outfile ; then + touch $outfile + fi + echo $line >> $outfile ++sync +diff -urNp old/snmplib/read_config.c new/snmplib/read_config.c +--- old/snmplib/read_config.c 2018-09-06 11:04:16.395792547 +0200 ++++ new/snmplib/read_config.c 2018-09-07 06:53:33.671501357 +0200 +@@ -1508,6 +1508,9 @@ read_config_store(const char *type, cons + #ifdef NETSNMP_PERSISTENT_MASK + mode_t oldmask; + #endif ++#if HAVE_FSYNC ++ int fd; ++#endif + + if (netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, + NETSNMP_DS_LIB_DONT_PERSIST_STATE) +@@ -1538,6 +1541,11 @@ read_config_store(const char *type, cons + if (line[strlen(line)] != '\n') + fprintf(fout, "\n"); + DEBUGMSGTL(("read_config:store", "storing: %s\n", line)); ++#if HAVE_FSYNC ++ fd = fileno(fout); ++ fflush(fout); ++ fsync(fd); ++#endif + fclose(fout); + } else { + if (strcmp(NETSNMP_APPLICATION_CONFIG_TYPE, type) != 0) { diff --git a/SOURCES/net-snmp-5.7.2-man-page.patch b/SOURCES/net-snmp-5.7.2-man-page.patch new file mode 100644 index 0000000..428cea9 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-man-page.patch @@ -0,0 +1,35 @@ +--- net-snmp-5.7.3/man/net-snmp-create-v3-user.1.def 2014-12-08 21:23:22.000000000 +0100 ++++ /tmp/net-snmp-create-v3-user.1.def 2018-01-23 10:22:29.096506633 +0100 +@@ -3,7 +3,7 @@ + net-snmp-create-v3-user \- create a SNMPv3 user in net-snmp configuration file + .SH SYNOPSIS + .PP +-.B net-snmp-create-v3-user [-ro] [-a authpass] [-x privpass] [-X DES|AES] ++.B net-snmp-create-v3-user [-ro] [-A authpass] [-a MD5|SHA] [-X privpass] [-x DES|AES] + .B [username] + .SH DESCRIPTION + .PP +@@ -16,13 +16,16 @@ + displays the net-snmp version number + .TP + \fB\-ro\fR +-create an user with read-only permissions ++creates a user with read-only permissions + .TP +-\fB\-a authpass\fR +-specify authentication password ++\fB\-A authpass\fR ++specifies the authentication password + .TP +-\fB\-x privpass\fR +-specify encryption password ++\fB\-a MD5|SHA\fR ++specifies the authentication password hashing algorithm + .TP +-\fB\-X DES|AES\fR +-specify encryption algorithm ++\fB\-X privpass\fR ++specifies the encryption password ++.TP ++\fB\-x DES|AES\fR ++specifies the encryption algorithm diff --git a/SOURCES/net-snmp-5.7.2-zfs-support.patch b/SOURCES/net-snmp-5.7.2-zfs-support.patch new file mode 100644 index 0000000..c3b4872 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-zfs-support.patch @@ -0,0 +1,49 @@ +diff -urNp old/agent/mibgroup/hardware/fsys/fsys_getfsstats.c new/agent/mibgroup/hardware/fsys/fsys_getfsstats.c +--- old/agent/mibgroup/hardware/fsys/fsys_getfsstats.c 2018-06-21 16:03:13.675537036 +0200 ++++ new/agent/mibgroup/hardware/fsys/fsys_getfsstats.c 2018-06-21 16:10:36.212652288 +0200 +@@ -88,6 +88,8 @@ _fs_type( char *typename ) + return NETSNMP_FS_TYPE_EXT2; + else if ( !strcmp(typename, MOUNT_NTFS) ) + return NETSNMP_FS_TYPE_NTFS; ++ else if ( !strcmp(typename, MOUNT_ZFS) ) ++ return NETSNMP_FS_TYPE_OTHER; + + /* + * NetBSD also recognises the following filesystem types: +diff -urNp old/agent/mibgroup/hardware/fsys/fsys_mntent.c new/agent/mibgroup/hardware/fsys/fsys_mntent.c +--- old/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-06-21 16:03:13.675537036 +0200 ++++ new/agent/mibgroup/hardware/fsys/fsys_mntent.c 2018-06-21 16:12:36.982882380 +0200 +@@ -142,6 +142,7 @@ _fsys_type( char *typename ) + !strcmp(typename, MNTTYPE_SIMFS) || + !strcmp(typename, MNTTYPE_VZFS) || + !strcmp(typename, MNTTYPE_BTRFS) || ++ !strcmp(typename, MNTTYPE_ZFS) || + !strcmp(typename, MNTTYPE_ACFS) || + !strcmp(typename, MNTTYPE_LOFS)) + return NETSNMP_FS_TYPE_OTHER; +diff -urNp old/agent/mibgroup/hardware/fsys/mnttypes.h new/agent/mibgroup/hardware/fsys/mnttypes.h +--- old/agent/mibgroup/hardware/fsys/mnttypes.h 2018-06-21 16:03:13.675537036 +0200 ++++ new/agent/mibgroup/hardware/fsys/mnttypes.h 2018-06-21 16:13:22.793403430 +0200 +@@ -151,6 +151,9 @@ + #ifndef MNTTYPE_BTRFS + #define MNTTYPE_BTRFS "btrfs" + #endif ++#ifndef MNTTYPE_ZFS ++#define MNTTYPE_ZFS "zfs" ++#endif + #ifndef MNTTYPE_ACFS + #define MNTTYPE_ACFS "acfs" + #endif +diff -urNp old/agent/mibgroup/hardware/fsys/mounts.h new/agent/mibgroup/hardware/fsys/mounts.h +--- old/agent/mibgroup/hardware/fsys/mounts.h 2018-06-21 16:03:13.675537036 +0200 ++++ new/agent/mibgroup/hardware/fsys/mounts.h 2018-06-21 16:14:08.014939906 +0200 +@@ -56,6 +56,9 @@ + #ifndef MOUNT_ACFS + #define MOUNT_ACFS "acfs" + #endif ++#ifndef MOUNT_ZFS ++#define MOUNT_ZFS "zfs" ++#endif + + /* + #ifndef MNTTYPE_AFS diff --git a/SPECS/net-snmp.spec b/SPECS/net-snmp.spec index a59db4f..95ecc4b 100644 --- a/SPECS/net-snmp.spec +++ b/SPECS/net-snmp.spec @@ -11,7 +11,7 @@ Summary: A collection of SNMP protocol tools and libraries Name: net-snmp Version: 5.7.2 -Release: 33%{?dist}.2 +Release: 37%{?dist} Epoch: 1 License: BSD @@ -103,6 +103,9 @@ Patch67: net-snmp-5.7.2-iterator-fix.patch Patch68: net-snmp-5.7.2-autofs.patch Patch69: net-snmp-5.7.2-leak-backport.patch Patch70: net-snmp-5.7.2-acfs.patch +Patch71: net-snmp-5.7.2-fsync.patch +Patch72: net-snmp-5.7.2-zfs-support.patch +Patch73: net-snmp-5.7.2-man-page.patch Requires(post): chkconfig Requires(preun): chkconfig @@ -326,6 +329,9 @@ The net-snmp-sysvinit package provides SysV init scripts for Net-SNMP daemons. %patch68 -p1 -b .autofspatch %patch69 -p1 -b .leak-backport %patch70 -p1 -b .acfs +%patch71 -p1 -b .fsync +%patch72 -p1 -b .zfs-support +%patch73 -p1 -b .man-page %ifarch sparc64 s390 s390x # disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 @@ -621,11 +627,19 @@ rm -rf ${RPM_BUILD_ROOT} %{_initrddir}/snmptrapd %changelog -* Mon Apr 23 2018 Josef Ridky - 1:5.7.2-33.2 -- Add ACFS support (#1570506) +* Thu Sep 06 2018 Josef Ridky - 1:5.7.2-37 +- fix fsync issue (#1520761) -* Wed Mar 28 2018 Josef Ridky - 1:5.7.2-33.1 -- Build for z-stream (#1560965) +* Tue Aug 14 2018 Josef Ridky - 1:5.7.2-36 +- Add missing part of ACFS support (#1564400) + +* Thu Jun 21 2018 Josef Ridky - 1:5.7.2-35 +- Add fsync to prevet data lose on power failure (#1520761) +- Add ZFS support (#1533943) +- Fix man page (#1537460) + +* Fri Apr 20 2018 Josef Ridky - 1:5.7.2-34 +- Add ACFS support (#1564400) * Tue Mar 27 2018 Josef Ridky - 1:5.7.2-33 - Backport upstream leak fix (#1533780) @@ -1892,3 +1906,4 @@ rm -rf ${RPM_BUILD_ROOT} * Tue Dec 30 1997 Otto Hammersmith - created the package... possibly replace cmu-snmp with this. +