Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package procenv for openSUSE:Factory checked in at 2021-03-17 20:16:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/procenv (Old) and /work/SRC/openSUSE:Factory/.procenv.new.2401 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "procenv" Wed Mar 17 20:16:52 2021 rev:2 rq:879593 version:0.54 Changes: -------- --- /work/SRC/openSUSE:Factory/procenv/procenv.changes 2021-03-02 15:25:39.641781965 +0100 +++ /work/SRC/openSUSE:Factory/.procenv.new.2401/procenv.changes 2021-03-17 20:20:08.143332347 +0100 @@ -1,0 +2,18 @@ +Wed Mar 17 07:53:32 UTC 2021 - Michael Vetter <[email protected]> + +- Update to 0.54: + * --capabilities: Added new capabilities: + * CAP_BPF + * CAP_CHECKPOINT_RESTORE + * CAP_PERFMON + * --clocks: Add CLOCK_TAI. + * --memory: Add details of total and available memory and swap. + Requires the libsysinfo package on *BSD. + * --process: Fixed nasty bug (infinite loop) on *BSD if any of + the following sysconf's are set: + * security.bsd.see_other_uids=0 + * security.bsd.see_other_gids=0 + * kern.randompid=1 + * Fix compiler flag checking in the configure script. + +------------------------------------------------------------------- Old: ---- procenv-0.53.tar.gz New: ---- procenv-0.54.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ procenv.spec ++++++ --- /var/tmp/diff_new_pack.CPHYoW/_old 2021-03-17 20:20:08.615332992 +0100 +++ /var/tmp/diff_new_pack.CPHYoW/_new 2021-03-17 20:20:08.615332992 +0100 @@ -18,7 +18,7 @@ Name: procenv -Version: 0.53 +Version: 0.54 Release: 0 Summary: Process Environment Dump Tool License: GPL-3.0-or-later ++++++ procenv-0.53.tar.gz -> procenv-0.54.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/Makefile.in new/procenv-0.54/Makefile.in --- old/procenv-0.53/Makefile.in 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/Makefile.in 2021-03-15 23:11:38.000000000 +0100 @@ -90,7 +90,8 @@ target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -241,7 +242,6 @@ distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ -AM_CFLAGS = @AM_CFLAGS@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/NEWS new/procenv-0.54/NEWS --- old/procenv-0.53/NEWS 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/NEWS 2021-03-15 23:11:38.000000000 +0100 @@ -1,3 +1,19 @@ +0.54 2021-03-15 + + * --capabilities: Added new capabilities: + - `CAP_BPF` + - `CAP_CHECKPOINT_RESTORE` + - `CAP_PERFMON` + * --clocks: Add CLOCK_TAI. + * --memory: Add details of total and available memory and swap. + Requires the `libsysinfo` package on *BSD. + * --process: Fixed nasty bug (infinite loop) on *BSD if any of + the following sysconf's are set: + - `security.bsd.see_other_uids=0` + - `security.bsd.see_other_gids=0` + - `kern.randompid=1` + * Fix compiler flag checking in the configure script. + 0.53 2021-03-01 * Really fix FreeBSD capabilities/capsicum build. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/TODO new/procenv-0.54/TODO --- old/procenv-0.53/TODO 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/TODO 2021-03-15 23:11:38.000000000 +0100 @@ -27,8 +27,6 @@ - LSM - add details for SMACK and TOMOYO (available in Centos 7). - move into a new --security section? -- --memory: show physical RAM: - bytes = (_SC_PHYS_PAGES * _SC_PAGESIZE) - FreeBSD: - MAC: mac_get_file(3), mac(3,4) - --stat: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/aclocal.m4 new/procenv-0.54/aclocal.m4 --- old/procenv-0.53/aclocal.m4 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/aclocal.m4 2021-03-15 23:11:38.000000000 +0100 @@ -1479,3 +1479,4 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/ax_check_compile_flag.m4]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/configure new/procenv-0.54/configure --- old/procenv-0.53/configure 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/configure 2021-03-15 23:11:38.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for procenv 0.53. +# Generated by GNU Autoconf 2.69 for procenv 0.54. # # Report bugs to <[email protected]>. # @@ -582,8 +582,8 @@ # Identity of this package. PACKAGE_NAME='procenv' PACKAGE_TARNAME='procenv' -PACKAGE_VERSION='0.53' -PACKAGE_STRING='procenv 0.53' +PACKAGE_VERSION='0.54' +PACKAGE_STRING='procenv 0.54' PACKAGE_BUGREPORT='[email protected]' PACKAGE_URL='https://github.com/jamesodhunt/procenv' @@ -645,7 +645,6 @@ PROCENV_PLATFORM_FREEBSD_TRUE PROCENV_PLATFORM_DARWIN_FALSE PROCENV_PLATFORM_DARWIN_TRUE -AM_CFLAGS AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V @@ -1326,7 +1325,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures procenv 0.53 to adapt to many kinds of systems. +\`configure' configures procenv 0.54 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1397,7 +1396,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of procenv 0.53:";; + short | recursive ) echo "Configuration of procenv 0.54:";; esac cat <<\_ACEOF @@ -1514,7 +1513,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -procenv configure 0.53 +procenv configure 0.54 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1939,7 +1938,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by procenv $as_me 0.53, which was +It was created by procenv $as_me 0.54, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2324,7 +2323,7 @@ -PROCENV_VERSION=0.53 +PROCENV_VERSION=0.54 # Expand $ac_aux_dir to an absolute path. @@ -5041,6 +5040,65 @@ fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sysinfo" >&5 +$as_echo_n "checking for library containing sysinfo... " >&6; } +if ${ac_cv_search_sysinfo+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sysinfo (); +int +main () +{ +return sysinfo (); + ; + return 0; +} +_ACEOF +for ac_lib in '' sysinfo; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_sysinfo=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_sysinfo+:} false; then : + break +fi +done +if ${ac_cv_search_sysinfo+:} false; then : + +else + ac_cv_search_sysinfo=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sysinfo" >&5 +$as_echo "$ac_cv_search_sysinfo" >&6; } +ac_res=$ac_cv_search_sysinfo +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + HAVE_SYSINFO=yes +else + HAVE_SYSINFO=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing numa_available" >&5 $as_echo_n "checking for library containing numa_available... " >&6; } if ${ac_cv_search_numa_available+:} false; then : @@ -6013,7 +6071,7 @@ # Define the identity of the package. PACKAGE='procenv' - VERSION='0.53' + VERSION='0.54' cat >>confdefs.h <<_ACEOF @@ -6235,11 +6293,17 @@ fi -original_cflags="$CFLAGS" -CFLAGS=-Werror=format-security -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CC supports -Werror=format-security" >&5 -$as_echo_n "checking whether CC supports -Werror=format-security... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext +# Check available compiler flags + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector" >&5 +$as_echo_n "checking whether C compiler accepts -fstack-protector... " >&6; } +if ${ax_cv_check_cflags___fstack_protector+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -fstack-protector" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -6251,15 +6315,90 @@ } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - AM_CFLAGS=-Werror=format-security + ax_cv_check_cflags___fstack_protector=yes else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + ax_cv_check_cflags___fstack_protector=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector" >&5 +$as_echo "$ax_cv_check_cflags___fstack_protector" >&6; } +if test "x$ax_cv_check_cflags___fstack_protector" = xyes; then : + CFLAGS="$CFLAGS -fstack-protector" +else + : +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wformat" >&5 +$as_echo_n "checking whether C compiler accepts -Wformat... " >&6; } +if ${ax_cv_check_cflags___Wformat+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wformat" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags___Wformat=yes +else + ax_cv_check_cflags___Wformat=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wformat" >&5 +$as_echo "$ax_cv_check_cflags___Wformat" >&6; } +if test "x$ax_cv_check_cflags___Wformat" = xyes; then : + CFLAGS="$CFLAGS -Wformat" +else + : +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Wformat-security" >&5 +$as_echo_n "checking whether C compiler accepts -Wformat-security... " >&6; } +if ${ax_cv_check_cflags___Wformat_security+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS -Wformat-security" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ax_cv_check_cflags___Wformat_security=yes +else + ax_cv_check_cflags___Wformat_security=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$original_cflags" + CFLAGS=$ax_check_save_flags +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Wformat_security" >&5 +$as_echo "$ax_cv_check_cflags___Wformat_security" >&6; } +if test "x$ax_cv_check_cflags___Wformat_security" = xyes; then : + CFLAGS="$CFLAGS -Wformat-security" +else + : +fi # Check whether --enable-compiler-optimisations was given. @@ -7016,7 +7155,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by procenv $as_me 0.53, which was +This file was extended by procenv $as_me 0.54, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -7083,7 +7222,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -procenv config.status 0.53 +procenv config.status 0.54 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -7962,6 +8101,7 @@ libnuma : ${HAVE_NUMA} libpthread : ${HAVE_PTHREAD} libkvm : ${HAVE_KVM} + libsysinfo / sysinfo : ${HAVE_SYSINFO} " >&5 $as_echo " Configure settings for $PACKAGE_NAME version $VERSION @@ -7979,4 +8119,5 @@ libnuma : ${HAVE_NUMA} libpthread : ${HAVE_PTHREAD} libkvm : ${HAVE_KVM} + libsysinfo / sysinfo : ${HAVE_SYSINFO} " >&6; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/configure.ac new/procenv-0.54/configure.ac --- old/procenv-0.53/configure.ac 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/configure.ac 2021-03-15 23:11:38.000000000 +0100 @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -m4_define([procenv_version], [0.53]) +m4_define([procenv_version], [0.54]) AC_INIT(procenv,[procenv_version],[[email protected]],,[https://github.com/jamesodhunt/procenv]) @@ -50,6 +50,10 @@ [HAVE_KVM=yes], [HAVE_KVM=no]) +AC_SEARCH_LIBS([sysinfo], [sysinfo], + [HAVE_SYSINFO=yes], + [HAVE_SYSINFO=no]) + AC_SEARCH_LIBS([numa_available], [numa], [HAVE_NUMA=yes], [HAVE_NUMA=no]) @@ -112,15 +116,11 @@ fi ])) -original_cflags="$CFLAGS" -CFLAGS=-Werror=format-security -AC_MSG_CHECKING([whether CC supports -Werror=format-security]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AC_MSG_RESULT([yes])] - [AM_CFLAGS=-Werror=format-security], - [AC_MSG_RESULT([no])]) -CFLAGS="$original_cflags" -AC_SUBST([AM_CFLAGS]) +# Check available compiler flags + +AX_CHECK_COMPILE_FLAG([-fstack-protector], [CFLAGS="$CFLAGS -fstack-protector"]) +AX_CHECK_COMPILE_FLAG([-Wformat], [CFLAGS="$CFLAGS -Wformat"]) +AX_CHECK_COMPILE_FLAG([-Wformat-security], [CFLAGS="$CFLAGS -Wformat-security"]) AC_ARG_ENABLE([compiler-optimisations], AS_HELP_STRING([--disable-compiler-optimisations], @@ -226,4 +226,5 @@ libnuma : ${HAVE_NUMA} libpthread : ${HAVE_PTHREAD} libkvm : ${HAVE_KVM} + libsysinfo / sysinfo : ${HAVE_SYSINFO} ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/m4/ax_check_compile_flag.m4 new/procenv-0.54/m4/ax_check_compile_flag.m4 --- old/procenv-0.53/m4/ax_check_compile_flag.m4 1970-01-01 01:00:00.000000000 +0100 +++ new/procenv-0.54/m4/ax_check_compile_flag.m4 2021-03-15 23:11:38.000000000 +0100 @@ -0,0 +1,53 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) +# +# DESCRIPTION +# +# Check whether the given FLAG works with the current language's compiler +# or gives an error. (Warnings, however, are ignored) +# +# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on +# success/failure. +# +# If EXTRA-FLAGS is defined, it is added to the current language's default +# flags (e.g. CFLAGS) when the check is done. The check is thus made with +# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to +# force the compiler to issue an error when a bad flag is given. +# +# INPUT gives an alternative input source to AC_COMPILE_IFELSE. +# +# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this +# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. +# +# LICENSE +# +# Copyright (c) 2008 Guido U. Draheim <[email protected]> +# Copyright (c) 2011 Maarten Bosmans <[email protected]> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 6 + +AC_DEFUN([AX_CHECK_COMPILE_FLAG], +[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF +AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl +AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ + ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], + [AS_VAR_SET(CACHEVAR,[yes])], + [AS_VAR_SET(CACHEVAR,[no])]) + _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) +AS_VAR_IF(CACHEVAR,yes, + [m4_default([$2], :)], + [m4_default([$3], :)]) +AS_VAR_POPDEF([CACHEVAR])dnl +])dnl AX_CHECK_COMPILE_FLAGS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/man/procenv.1 new/procenv-0.54/man/procenv.1 --- old/procenv-0.53/man/procenv.1 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/man/procenv.1 2021-03-15 23:11:38.000000000 +0100 @@ -372,7 +372,8 @@ Display memory details. See .BR getpagesize (2) "" ", " -.BR numa (3) "" " (Linux) and " numa (7) "" " (Linux)." +.BR numa (3) "" " (Linux) and " numa (7) "" " (Linux)" ", " +.BR sysinfo (3) "" . .PP .\" .TP @@ -460,7 +461,7 @@ flattened format with each value on a separate line preceded by all appropriate headings which are separated by the current separator. .IP \(bu -The \fB\-\-message\-queues\fR, \fB\-\-semaphores\fR and +The \fB\-\-message\-queues\fR, \fB\-\-semaphores\fR and \fB\-\-shared\-memory\fR options are not available on BSD since although the values are queryable, there is no documented method to do so. .sp 1 @@ -549,6 +550,7 @@ .BR capabilities (7) "" " (Linux), " .BR capsicum (4) "" " (BSD)" "" ", " .BR cc (1) "" , +.BR clock_gettime (2) "" " (Linux), " .BR credentials (7) "" , .BR date (1) "" , .BR env (1) "" , diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/procenv.spec new/procenv-0.54/procenv.spec --- old/procenv-0.53/procenv.spec 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/procenv.spec 2021-03-15 23:11:38.000000000 +0100 @@ -1,12 +1,12 @@ Name: procenv -Version: 0.53 +Version: 0.54 Release: 1%{?dist} Summary: Utility to show process environment Group: Applications/System License: GPLv3+ URL: https://github.com/jamesodhunt/procenv -Source0: https://github.com/jamesodhunt/procenv/archive/0.53.tar.gz +Source0: https://github.com/jamesodhunt/procenv/archive/0.54.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # fixme: should be autoconf >= 2.68, but Fedora packages or alien'ed dpkg diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/Makefile.am new/procenv-0.54/src/Makefile.am --- old/procenv-0.53/src/Makefile.am 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/Makefile.am 2021-03-15 23:11:38.000000000 +0100 @@ -3,9 +3,7 @@ AM_CFLAGS = \ -pedantic \ -std=gnu99 \ - -Wall -Wunused \ - -fstack-protector \ - -Wformat + -Wall -Wunused # XXX: magic option that will remove all unused symbols diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/Makefile.in new/procenv-0.54/src/Makefile.in --- old/procenv-0.53/src/Makefile.in 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/Makefile.in 2021-03-15 23:11:38.000000000 +0100 @@ -131,7 +131,8 @@ @ENABLE_TESTS_TRUE@@HAVE_CHECK_TRUE@ check_pr_list$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_compile_flag.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -284,10 +285,6 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ - -# keep it tight -AM_CFLAGS = -pedantic -std=gnu99 -Wall -Wunused -fstack-protector \ - -Wformat $(am__append_1) $(am__append_2) -Werror AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ @@ -393,6 +390,10 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AUTOMAKE_OPTIONS = subdir-objects + +# keep it tight +AM_CFLAGS = -pedantic -std=gnu99 -Wall -Wunused $(am__append_1) \ + $(am__append_2) -Werror procenv_SOURCES = procenv.c procenv.h pr_list.c pr_list.h pstring.c \ pstring.h string-util.c string-util.h output.c output.h util.c \ util.h types.h messages.h platform.h platform-headers.h \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/platform/freebsd/platform.c new/procenv-0.54/src/platform/freebsd/platform.c --- old/procenv-0.53/src/platform/freebsd/platform.c 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/platform/freebsd/platform.c 2021-03-15 23:11:38.000000000 +0100 @@ -320,25 +320,19 @@ entry ("number", "%u of %lu", cpu, max); } -/* Who would have thought handling PIDs was so tricky? */ static void handle_proc_branch_freebsd (void) { int count = 0; - int i; char errors[_POSIX2_LINE_MAX]; kvm_t *kvm; struct kinfo_proc *procs; struct kinfo_proc *p; - pid_t current; - int done = false; char *str = NULL; pid_t ultimate_parent = 0; common_assert (); - current = getpid (); - kvm = kvm_openfiles (NULL, _PATH_DEVNULL, NULL, O_RDONLY, errors); if (! kvm) die ("unable to open kvm"); @@ -347,90 +341,124 @@ if (! procs) die ("failed to get process info"); - /* Calculate the lowest PID number which gives us the ultimate - * parent of all processes. + /* Walk up the process tree looking for the "ultimate parent process". + * + * Every PID has a parent PID, which has a parent PID, which has a parent + * PID, _et cetera_. Hence, this should be easy. The difficulty is knowing + * when to stop, but even then the results may appear confusing to + * users... * * On FreeBSD systems, PID 0 ('[kernel]') is the ultimate - * parent rather than PID 1 ('init'). + * parent rather than PID 1 ('init'). And this kernel PID appears in the + * process table... unless you're confined in a jail. But FreeBSD also + * offers a few sysctl kernel options that the admin can set: + * + * - sysctl security.bsd.see_other_uids=0 + * - sysctl security.bsd.see_other_gids=0 * - * However, this doesn't work in a FreeBSD jail since in that - * environment: + * If these security otions are set to zero, a process cannot see it's + * ultimate parent, unless that process is running as the super-user. But + * if those options are set and the process is running inside a jail, it + * can only see direct ancestor parent processes running with its UID/GID, + * unless running as root. * - * - there is no init process visible. - * - there is no kernel thread visible. - * - the ultimate parent PID will either by 1 (the "invisible" + * Summary of jail PID visibility: + * + * - There is no init process visible. + * - There is no kernel thread visible. + * - The ultimate parent PID will either by 1 (the "invisible" * init process) or 'n' where 'n' is a PID>1 which is also * "invisible" (since it lives outside the jail in the host * environment). * + * Further note that if kern.randompid=1 is set, you cannot make + * assumptions about PID/PPID relationships (where PID >1 atleast). + * * Confused yet? + * + * Notes: + * + * - kvm_getprocs() doesn't return details of the kernel "pid" (0). + * + * Summary: + * + * +------------+ + * | ultimate | + * +---------+-------+----------+-----+------+-------+ + * | secure? | jail? | user | pid | ppid | notes | + * |---------+-------+----------+-----+------+-------| + * | n | n | non-root | 1 | 0 | | + * | n | n | root | 1 | 0 | | + * |---------+-------+----------+-----+------+-------| + * | n | y | non-root | any | 1 | | + * | n | y | root | any | 1 | | + * |---------+-------+----------+-----+------+-------| + * | y | n | non-root | any | 1 | | + * | y | n | root | 1 | 0 | | + * |---------+-------+----------+-----+------+-------| + * | y | y | non-root | any | any | (1) | + * | y | y | root | any | 1 | | + * +---------+-------+----------+-----+------+-------+ + * + * Key: + * + * (1) - This scenario appears awkward to determine. + + * The solution to determine the "full" process ancestry for any PID for + * all cases in the table is thankfully simple: + * + * - Iterate the list of entries returned by kvm_getprocs() + * - Find the entry corresponding to the current process and determine the + * parent PID. + * - Re-scan the list looking for the parent PID. If it isn't in the + * table, the ancestry is complete. This works: + * + * - In a "normal" system: + * + * Since kvm_getprocs() doesn't return details for PID 0, it's only + * "mentioned in passing" by being referred to as a PPID for PID 1. + * + * - In a jail environment: + * + * Since the jail hides PID 1 (and PID 0). + * - In a secure system where security.bsd.see_other_uids=0 and/or + * security.bsd.see_other_gids=0: + * + * Since those options hide part of the process hierarchy. */ - p = &procs[0]; - ultimate_parent = p->ki_pid; + /* Start by finding ourself ;) */ + pid_t pid_to_find = getpid (); - for (i = 1; i < count; i++) { - p = &procs[i]; - if (p->ki_pid < ultimate_parent) - ultimate_parent = p->ki_pid; - } + bool found_pid; - while (! done) { - for (i = 0; i < count && !done; i++) { - p = &procs[i]; + while (true) { + found_pid = false; - if (p->ki_pid == current) { - if (misc.in_jail) { - struct kinfo_proc *p2; - int ppid_found = false; - int j; - - /* Determine if the parent PID - * actually exists within the - * jail. - */ - for (j = 0; j < count; j++) { - p2 = &procs[j]; - - if (p2->ki_pid == p->ki_ppid) { - ppid_found = true; - break; - } - } - - if (p->ki_ppid == 1 || (p->ki_ppid && ! ppid_found)) { - /* Found the "last" PID (whose parent is either - * the "invisible init" or which exists outside the jail) - * so record it and hop out. - */ - appendf (&str, "%d ('%s') %d (%s)", - (int)current, p->ki_comm, - p->ki_ppid, UNKNOWN_STR); - done = true; - break; - } else { - /* Found a valid parent pid */ - appendf (&str, "%d ('%s'), ", - (int)current, p->ki_comm); - } - - } else if (! ultimate_parent && current == ultimate_parent) { - - /* Found the "last" PID so record it and hop out */ - appendf (&str, "%d ('%s')", - (int)current, p->ki_comm); - done = true; - break; - } else { - /* Found a valid parent pid */ - appendf (&str, "%d ('%s'), ", - (int)current, p->ki_comm); - } + for (int i=0; i < count; i++) { + p = &procs[i]; - /* Move on */ - current = p->ki_ppid; + if (p->ki_pid == pid_to_find) { + appendf (&str, "%s%d ('%s')", + (pid_to_find == getpid () ? "" : ", "), + (int)p->ki_pid, + p->ki_comm); + + ultimate_parent = p->ki_ppid; + pid_to_find = ultimate_parent; + found_pid = true; } } + + /* If the pid wasn't found, we're either in a secure or jailed + * environment (where only a subset of pids is visible to us), + * or we tried to look for details of kernel "pseudo pid" (pid 0). + * + * Either way, we can't go any further up the process tree. + */ + if ((! found_pid) || pid_to_find == 0) { + break; + } } if (kvm_close (kvm) < 0) @@ -528,5 +556,6 @@ .show_mounts = show_mounts_freebsd, .show_rlimits = show_rlimits_generic, + .handle_memory = show_memory_generic, .handle_proc_branch = handle_proc_branch_freebsd, }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/platform/linux/platform.c new/procenv-0.54/src/platform/linux/platform.c --- old/procenv-0.53/src/platform/linux/platform.c 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/platform/linux/platform.c 2021-03-15 23:11:38.000000000 +0100 @@ -355,6 +355,24 @@ } #endif /* CAP_AUDIT_READ */ +#ifdef CAP_PERFMON + if (LINUX_KERNEL_MM (5, 8)) { + show_capability (caps, CAP_PERFMON); + } +#endif /* CAP_PERFMON */ + +#ifdef CAP_BPF + if (LINUX_KERNEL_MM (5, 8)) { + show_capability (caps, CAP_BPF); + } +#endif /* CAP_BPF */ + +#ifdef CAP_CHECKPOINT_RESTORE + if (LINUX_KERNEL_MM (5, 9)) { + show_capability (caps, CAP_CHECKPOINT_RESTORE); + } +#endif /* CAP_CHECKPOINT_RESTORE */ + section_close (); /* It's possible that procenv is running on a system which has @@ -444,7 +462,7 @@ const char *delim = ":"; char *file = "/proc/self/cgroup"; FILE *f; - char buffer[1024]; + char buffer[PROCENV_BUFFER]; size_t len; f = fopen (file, "r"); @@ -698,7 +716,7 @@ FILE *f; char **fields; const char *field; - char buffer[1024]; + char buffer[PROCENV_BUFFER]; size_t len; size_t count; @@ -1235,7 +1253,7 @@ static void handle_proc_branch_linux (void) { - char buffer[1024]; + char buffer[PROCENV_BUFFER]; char path[PATH_MAX]; char name[16]; char pid[16]; @@ -2146,7 +2164,7 @@ bool result = false; const char *cpuinfo = "/proc/cpuinfo"; FILE *f = NULL; - char buffer[1024]; + char buffer[PROCENV_BUFFER]; f = fopen (cpuinfo, "r"); if (! f) { @@ -2216,8 +2234,8 @@ .show_shared_mem = show_shared_mem_linux, .show_timezone = show_timezone_linux, + .handle_memory = show_memory_generic, .handle_numa_memory = handle_numa_memory_linux, .handle_proc_branch = handle_proc_branch_linux, .handle_scheduler_type = handle_scheduler_type_linux, - }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/platform/platform-generic.c new/procenv-0.54/src/platform/platform-generic.c --- old/procenv-0.53/src/platform/platform-generic.c 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/platform/platform-generic.c 2021-03-15 23:11:38.000000000 +0100 @@ -68,9 +68,6 @@ #if defined (PROCENV_PLATFORM_LINUX) || defined (PROCENV_PLATFORM_HURD) -#ifdef CLOCK_MONOTONIC_RAW - show_clock_res (CLOCK_MONOTONIC_RAW); -#endif show_clock_res (CLOCK_PROCESS_CPUTIME_ID); show_clock_res (CLOCK_THREAD_CPUTIME_ID); #if defined CLOCK_BOOTTIME @@ -78,6 +75,11 @@ #endif #endif + +#if defined CLOCK_TAI + show_clock_res (CLOCK_TAI); +#endif + } #endif @@ -536,6 +538,88 @@ free (cpu_list); } +#define PROCENV_KB (1024) +#define PROCENV_MB (1024*PROCENV_KB) +#define PROCENV_GB (1024*PROCENV_MB) + +static +void +show_human_size_entry (size_t value) +{ + double result; + char *units; + + if (value > PROCENV_GB) { + result = ((double)value/PROCENV_GB); + units = "GB"; + } else if (value > PROCENV_MB) { + result = ((double)value/PROCENV_MB); + units = "MB"; + } else if (value > PROCENV_KB) { + result = ((double)value/PROCENV_KB); + units = "KB"; + } else { + result = (double)value; + units = "bytes"; + } + + entry ("human", "%2.2f %s", + result, + units); +} + +#define mk_mem_section(name, value) \ +{ \ + section_open (name); \ + entry ("bytes", "%lu", value); \ + show_human_size_entry (value); \ + section_close (); \ +} + +void +show_memory_generic (void) +{ + struct sysinfo info; + + int ret = sysinfo (&info); + + if (ret < 0) { + return; + } + + int multiplier = info.mem_unit; + + unsigned long total_ram = info.totalram * multiplier; + unsigned long free_ram = info.freeram * multiplier; + unsigned long shared_ram = info.sharedram * multiplier; + unsigned long buffer_ram = info.bufferram * multiplier; + + unsigned long total_swap = info.totalswap * multiplier; + unsigned long free_swap = info.freeswap * multiplier; + + /*------------------------------*/ + + section_open ("ram"); + + mk_mem_section ("total", total_ram); + mk_mem_section ("free", free_ram); + mk_mem_section ("shared", shared_ram); + mk_mem_section ("buffer", buffer_ram); + + section_close (); + + /*------------------------------*/ + + section_open ("swap"); + + mk_mem_section ("total", total_swap); + mk_mem_section ("free", free_swap); + + section_close (); + + /*------------------------------*/ +} + #endif /* PROCENV_PLATFORM_LINUX || PROCENV_PLATFORM_FREEBSD || PROCENV_PLATFORM_HURD */ #if defined (PROCENV_PLATFORM_LINUX) || \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/platform/platform-generic.h new/procenv-0.54/src/platform/platform-generic.h --- old/procenv-0.53/src/platform/platform-generic.h 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/platform/platform-generic.h 2021-03-15 23:11:38.000000000 +0100 @@ -69,6 +69,7 @@ #if !defined (PROCENV_PLATFORM_DARWIN) bool get_time_generic (struct timespec *ts); void show_clocks_generic (void); +void show_memory_generic (void); #endif #endif /* _PROCENV_PLATFORM_GENERIC_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/platform.h new/procenv-0.54/src/platform.h --- old/procenv-0.53/src/platform.h 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/platform.h 2021-03-15 23:11:38.000000000 +0100 @@ -156,6 +156,7 @@ void (*show_shared_mem) (void); void (*show_timezone) (void); + void (*handle_memory) (void); void (*handle_numa_memory) (void); void (*handle_proc_branch) (void); void (*handle_scheduler_type) (void); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/procenv.c new/procenv-0.54/src/procenv.c --- old/procenv-0.53/src/procenv.c 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/procenv.c 2021-03-15 23:11:38.000000000 +0100 @@ -1440,6 +1440,9 @@ entry ("page size", "%d bytes", getpagesize ()); + if (ops->handle_memory) + ops->handle_memory (); + if (ops->handle_numa_memory) ops->handle_numa_memory (); @@ -1897,7 +1900,7 @@ modestr = format_perms (st.st_mode); if (! modestr) die ("failed to allocate space for permissions string"); - perms = (st.st_mode &= ~S_IFMT); + perms = (st.st_mode & ~S_IFMT); if (perms & S_ISUID) modestr[3] = 's'; @@ -4380,7 +4383,7 @@ modestr[i++] = (perms & S_IWOTH) ? 'w' : '-'; modestr[i++] = (perms & S_IXOTH) ? 'x' : '-'; - perms = (mode &= ~S_IFMT); + perms = (mode & ~S_IFMT); if (perms & S_ISUID) modestr[3] = 's'; if (perms & S_ISGID) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/procenv.h new/procenv-0.54/src/procenv.h --- old/procenv-0.53/src/procenv.h 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/procenv.h 2021-03-15 23:11:38.000000000 +0100 @@ -77,6 +77,7 @@ #include <sys/param.h> #include <sys/time.h> #include <sys/resource.h> +#include <sys/sysinfo.h> #include "util.h" #include "string-util.h" @@ -164,8 +165,10 @@ * - Added 'vm' to --misc output. * VERSION 18: * - Added 'ambient' to --capabilities output. + * VERSION 19: + * - Added more details to --memory and new capabilities to --capabilities. **/ -#define PROCENV_FORMAT_VERSION 18 +#define PROCENV_FORMAT_VERSION 19 #if defined (PROCENV_PLATFORM_LINUX) || defined (PROCENV_PLATFORM_HURD) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/procenv-0.53/src/tests/check_all_args.in new/procenv-0.54/src/tests/check_all_args.in --- old/procenv-0.53/src/tests/check_all_args.in 2021-03-01 19:27:30.000000000 +0100 +++ new/procenv-0.54/src/tests/check_all_args.in 2021-03-15 23:11:38.000000000 +0100 @@ -103,7 +103,7 @@ if [ "$expected_outcome" = success ] then [ "$ret" -ne 0 ] && failed=1 - else + else [ "$ret" -eq 0 ] && failed=1 fi @@ -133,7 +133,7 @@ init() { [ -n "$PROCENV_TEST_DISABLE" ] && msg "Tests disabled" && exit 0 - + [ -f "$procenv" ] || die "cannot find binary: $procenv" command -v "$json_checker" >/dev/null 2>&1 && \ @@ -141,7 +141,7 @@ command -v "$xml_checker" >/dev/null 2>&1 && \ xml_tests=1 || warn "no $xml_checker - XML tests disabled" - + env | grep -q "[[:cntrl:]]" && control_chars_in_env=1 # Always test the default locales @@ -736,7 +736,7 @@ # XXX: specifying a non-display option _after_ # specifing a display option used to be a NOP, but # is now disallowed as it is non-sensical and - # the result could be surprising to the user. + # the result could be surprising to the user. # # We select '--meta' as a random display option. msg "Ensure non-display option ('$arg') disallowed after display option ('--meta')"
