Hello community, here is the log from the commit of package health-check for openSUSE:Leap:15.2 checked in at 2020-01-17 12:01:25 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:15.2/health-check (Old) and /work/SRC/openSUSE:Leap:15.2/.health-check.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "health-check" Fri Jan 17 12:01:25 2020 rev:18 rq:763591 version:0.03.04 Changes: -------- --- /work/SRC/openSUSE:Leap:15.2/health-check/health-check.changes 2020-01-15 15:10:39.710081046 +0100 +++ /work/SRC/openSUSE:Leap:15.2/.health-check.new.26092/health-check.changes 2020-01-17 12:01:26.292503997 +0100 @@ -1,0 +2,27 @@ +Tue Dec 17 19:35:34 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 0.03.04 + * syscall: handle a null return from localtime + * set *inode to zero to clear up a static analysis false warning + * ignore return from proc_pids_add_proc + * net: pass size of link string in net_get_inode_by_path + +------------------------------------------------------------------- +Tue Aug 27 09:47:44 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 0.03.03 + * No functional changes + +------------------------------------------------------------------- +Fri Jun 14 22:04:13 UTC 2019 - Martin Hauke <[email protected]> + +- Update to version 0.03.01 + * Use safer strlcpy instead of strncpy + * Remove events.h and references to timer stats + * Fix buffer truncation warnings from gcc-9 + * Specify trusty in travis file + * Add older package name for json c +- Add BuildRequires: pkgconfig(libbsd) +- Use https for Source and URL + +------------------------------------------------------------------- Old: ---- health-check-0.03.00.tar.gz New: ---- health-check-0.03.04.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ health-check.spec ++++++ --- /var/tmp/diff_new_pack.XZAiLJ/_old 2020-01-17 12:01:26.840504238 +0100 +++ /var/tmp/diff_new_pack.XZAiLJ/_new 2020-01-17 12:01:26.844504240 +0100 @@ -1,7 +1,7 @@ # # spec file for package health-check # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2017, Martin Hauke <[email protected]> # # All modifications and additions to the file contributed by third parties @@ -13,20 +13,21 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Name: health-check -Version: 0.03.00 +Version: 0.03.04 Release: 0 Summary: Process monitoring tool License: GPL-2.0-or-later Group: System/Monitoring -URL: http://kernel.ubuntu.com/~cking/health-check -Source: http://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.gz +URL: https://kernel.ubuntu.com/~cking/health-check +Source: https://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.gz BuildRequires: pkgconfig BuildRequires: pkgconfig(json-c) +BuildRequires: pkgconfig(libbsd) %description Health-check monitors processes and optionally their child ++++++ health-check-0.03.00.tar.gz -> health-check-0.03.04.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/.travis.yml new/health-check-0.03.04/.travis.yml --- old/health-check-0.03.00/.travis.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/health-check-0.03.04/.travis.yml 2019-12-16 14:01:05.000000000 +0100 @@ -0,0 +1,18 @@ +dist: bionic +sudo: required + +matrix: + include: + - env: PEDANTIC=1 + +before_install: + - sudo apt-get update -q + - sudo apt-get install build-essential + - sudo apt-get install libjson-c-dev || true + - sudo apt-get install libjson0-dev || true + - sudo apt-get install libbsd-dev || true + +language: c + +script: +- make -j2 PEDANTIC=$PEDANTIC diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/Makefile new/health-check-0.03.04/Makefile --- old/health-check-0.03.00/Makefile 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/Makefile 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ # -# Copyright (C) 2013-2018 Canonical, Ltd. +# Copyright (C) 2013-2019 Canonical, Ltd. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -15,7 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -VERSION=0.03.00 +VERSION=0.03.04 # # Codename "Where have all my cycles gone?" # @@ -34,7 +34,7 @@ -Wno-missing-braces -Wno-sign-compare -Wno-multichar endif -LDFLAGS += -lpthread +LDFLAGS += -lpthread -lbsd ifeq ($(JSON_OUTPUT),y) LDFLAGS += -ljson-c CFLAGS += -DJSON_OUTPUT @@ -62,12 +62,10 @@ ctxt-switch.o: ctxt-switch.c list.h json.h ctxt-switch.h health-check.h -event.o: event.c list.h json.h event.h health-check.h - fnotify.o: fnotify.c fnotify.h list.h json.h proc.h health-check.h health-check.o: health-check.c list.h json.h pid.h proc.h syscall.h timeval.h \ - fnotify.h event.h cpustat.h mem.h net.h ctxt-switch.h + fnotify.h cpustat.h mem.h net.h ctxt-switch.h json.o: json.c json.h health-check.h @@ -89,7 +87,8 @@ dist: rm -rf health-check-$(VERSION) mkdir health-check-$(VERSION) - cp -rp Makefile *.c *.h scripts health-check.8 COPYING health-check-$(VERSION) + cp -rp Makefile *.c *.h .travis.yml scripts health-check.8 \ + COPYING health-check-$(VERSION) tar -zcf health-check-$(VERSION).tar.gz health-check-$(VERSION) rm -rf health-check-$(VERSION) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/cpustat.c new/health-check-0.03.04/cpustat.c --- old/health-check-0.03.00/cpustat.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/cpustat.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/ctxt-switch.c new/health-check-0.03.04/ctxt-switch.c --- old/health-check-0.03.00/ctxt-switch.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/ctxt-switch.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/event.h new/health-check-0.03.04/event.h --- old/health-check-0.03.00/event.h 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/event.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2013-2016 Canonical, Ltd. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Author: Colin Ian King <[email protected]> - */ -#ifndef __EVENT_H__ -#define __EVENT_H__ - -#define _GNU_SOURCE - -#include "json.h" -#include "proc.h" -#include "list.h" - -#define TIMER_STATS "/proc/timer_stats" - -#if (defined(__x86_64__) || defined(__i386__) || defined(__arm__)) -#define EVENT_SUPPORTED 1 -#else -#define EVENT_SUPPORTED 0 -#endif - - -/* wakeup event information per process */ -typedef struct { - proc_info_t *proc; /* Proc specific info */ - char *func; /* Kernel waiting func */ - char *callback; /* Kernel timer callback func */ - char *ident; /* Unique identity */ - uint64_t count; /* Number of events */ -} event_info_t; - -extern int event_get_all_pids(const list_t *pids, proc_state state); -extern void event_dump_diff(json_object *j_tests, const double duration); -extern void event_stop(void); -extern void event_init(void); -extern void event_cleanup(void); - -#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/fnotify.c new/health-check-0.03.04/fnotify.c --- old/health-check-0.03.00/fnotify.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/fnotify.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/health-check.8 new/health-check-0.03.04/health-check.8 --- old/health-check-0.03.00/health-check.8 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/health-check.8 2019-12-16 14:01:05.000000000 +0100 @@ -89,7 +89,7 @@ This manual page was written by Colin King <[email protected]>, for the Ubuntu project (but may be used by others). .SH COPYRIGHT -Copyright \(co 2014-2018 Canonical Ltd. +Copyright \(co 2014-2019 Canonical Ltd. .br This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/health-check.c new/health-check-0.03.04/health-check.c --- old/health-check-0.03.00/health-check.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/health-check.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -37,6 +37,7 @@ #include <limits.h> #include <grp.h> #include <pwd.h> +#include <bsd/string.h> #include "list.h" #include "json.h" @@ -45,7 +46,6 @@ #include "syscall.h" #include "timeval.h" #include "fnotify.h" -#include "event.h" #include "cpustat.h" #include "mem.h" #include "net.h" @@ -320,7 +320,7 @@ fprintf(stderr, "executable name too long.\n"); health_check_exit(EXIT_FAILURE); } - strncpy(path, filename, sizeof(path) - 1); + strlcpy(path, filename, sizeof(path) - 1); if (is_executable(path)) return path; else @@ -346,7 +346,7 @@ continue; /* Too long */ else { pathlen = len; - strncpy(path, p, pathlen); + strlcpy(path, p, pathlen); } } else { if (getcwd(p, PATH_MAX) == NULL) @@ -477,8 +477,8 @@ } if ((getuid() !=0 ) || (geteuid() != 0)) { - fprintf(stderr, "%s requires root privileges to write to %s\n", - APP_NAME, TIMER_STATS); + fprintf(stderr, "%s requires root trace processes\n", + APP_NAME); health_check_exit(EXIT_FAILURE); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/json.c new/health-check-0.03.04/json.c --- old/health-check-0.03.00/json.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/json.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/list.c new/health-check-0.03.04/list.c --- old/health-check-0.03.00/list.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/list.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/mem.c new/health-check-0.03.04/mem.c --- old/health-check-0.03.00/mem.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/mem.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/net.c new/health-check-0.03.04/net.c --- old/health-check-0.03.00/net.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/net.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,6 +30,7 @@ #include <arpa/inet.h> #include <netdb.h> #include <dirent.h> +#include <bsd/string.h> #include "list.h" #include "proc.h" @@ -37,10 +38,6 @@ #include "health-check.h" #include "net.h" -#ifndef LINE_MAX -#define LINE_MAX (4096) -#endif - #define NET_HASH_SIZE (1993) typedef struct { @@ -137,7 +134,7 @@ return NULL; } - strncpy(n->path, path, PATH_MAX); + strlcpy(n->path, path, PATH_MAX); n->inode = inode; n->proc = proc_cache_find_by_pid(pid); n->fd = fd; @@ -173,11 +170,12 @@ * net_get_inode_by_path() * given a /proc/$pid/fd/fdnum path, look up a network inode */ -static int net_get_inode_by_path(const char *path, uint64_t *inode, char *link) +static int net_get_inode_by_path(const char *path, uint64_t *inode, char *link, const size_t link_len) { ssize_t len; + *inode = 0; - if ((len = readlink(path, link, PATH_MAX)) < 0) { + if ((len = readlink(path, link, link_len - 1)) < 0) { *link = '\0'; return -1; } @@ -191,12 +189,12 @@ */ static net_hash_t *net_cache_inode_by_pid_and_fd(const pid_t pid, const int fd) { - char path[PATH_MAX], link[PATH_MAX]; + char path[PATH_MAX], link[PATH_MAX + 1]; uint64_t inode; net_hash_t *nh = NULL; snprintf(path, sizeof(path), "/proc/%i/fd/%i", pid, fd); - if (net_get_inode_by_path(path, &inode, link) != -1) + if (net_get_inode_by_path(path, &inode, link, sizeof(link)) != -1) nh = net_hash_add(link, inode, pid, fd); return nh; @@ -247,8 +245,8 @@ while ((d = readdir(fds)) != NULL) { uint64_t inode; - char tmp[LINE_MAX]; - char link[PATH_MAX]; + char tmp[PATH_MAX + sizeof(d->d_name) + 2]; + char link[PATH_MAX + 1]; uint32_t fd; if (d->d_name[0] == '.') @@ -257,7 +255,7 @@ continue; snprintf(tmp, sizeof(tmp), "%s/%s", path, d->d_name); - if (net_get_inode_by_path(tmp, &inode, link) != -1) { + if (net_get_inode_by_path(tmp, &inode, link, sizeof(link)) != -1) { sscanf(d->d_name, "%" SCNu32, &fd); if (net_hash_add(link, inode, pid, fd) == NULL) { (void)closedir(fds); @@ -301,7 +299,7 @@ if (getnameinfo((struct sockaddr *)sin, sizeof(*sin), name, len, NULL, 0, NI_NUMERICHOST) == 0) return; - strncpy(name, "<unknown>", len); + strlcpy(name, "<unknown>", len); return; } @@ -319,7 +317,7 @@ if (getnameinfo((struct sockaddr *)sin6, sizeof(*sin6), name, len, NULL, 0, NI_NUMERICHOST) == 0) return; - strncpy(name, "<unknown>", len); + strlcpy(name, "<unknown>", len); return; } @@ -359,8 +357,8 @@ */ static char *net_get_addr(net_addr_info_t *addr_info) { - static char tmp[256]; char buf[4096]; + static char tmp[sizeof(buf) + 16]; in_port_t port; switch (addr_info->type) { @@ -524,7 +522,7 @@ memset(&new_addr, 0, sizeof(new_addr)); new_addr.inode = nh->inode; new_addr.type = NET_UNKNOWN; - strncpy(new_addr.u.path, nh->path, PATH_MAX); + strlcpy(new_addr.u.path, nh->path, sizeof(new_addr.u.path)); if ((addr_info = net_addr_add(&new_addr)) == NULL) goto out; } @@ -635,7 +633,7 @@ memset(&new_addr, 0, sizeof(new_addr)); new_addr.inode = inode; new_addr.type = NET_UNIX; - strncpy(new_addr.u.path, path, PATH_MAX); + strlcpy(new_addr.u.path, path, PATH_MAX); net_addr_add(&new_addr); } (void)fclose(fp); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/pid.c new/health-check-0.03.04/pid.c --- old/health-check-0.03.00/pid.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/pid.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/proc.c new/health-check-0.03.04/proc.c --- old/health-check-0.03.00/proc.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/proc.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -296,7 +296,7 @@ proc_info_t *p = (proc_info_t *)l->data; if (p->cmdline && strcmp(p->cmdline, procname) == 0) { - proc_pids_add_proc(pids, p); + (void)proc_pids_add_proc(pids, p); found = true; } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/syscall.c new/health-check-0.03.04/syscall.c --- old/health-check-0.03.00/syscall.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/syscall.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -1804,8 +1804,12 @@ char buf[64]; syscall_wakelock_info_t *info = (syscall_wakelock_info_t *)ls->data; time_t whence_time = (time_t)info->tv.tv_sec; - struct tm *whence_tm = localtime(&whence_time); + struct tm whence_null_tm, *whence_tm = localtime(&whence_time); + if (!whence_tm) { + (void)memset(&whence_null_tm, 0, sizeof(whence_null_tm)); + whence_tm = &whence_null_tm; + } strftime(buf, sizeof(buf), "%x %X", whence_tm); if (info->locked) { @@ -2221,7 +2225,7 @@ s->proc->cmdline, tmp, rate, s->poll_infinite, s->poll_zero); if (s->poll_count) { - char min_timeout[64], max_timeout[64], avg_timeout[64]; + char min_timeout[70], max_timeout[70], avg_timeout[70]; units = syscall_timeout_to_human_time(s->poll_min < 0.0 ? 0.0 : s->poll_min, false, tmp, sizeof(tmp)); snprintf(min_timeout, sizeof(min_timeout), "%s %-4s", tmp, units); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/health-check-0.03.00/timeval.c new/health-check-0.03.04/timeval.c --- old/health-check-0.03.00/timeval.c 2018-06-16 20:55:48.000000000 +0200 +++ new/health-check-0.03.04/timeval.c 2019-12-16 14:01:05.000000000 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (C) 2013-2018 Canonical, Ltd. + * Copyright (C) 2013-2019 Canonical, Ltd. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License
