Hello community, here is the log from the commit of package nfacct for openSUSE:Factory checked in at 2013-03-08 13:25:29 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/nfacct (Old) and /work/SRC/openSUSE:Factory/.nfacct.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "nfacct", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/nfacct/nfacct.changes 2012-12-14 09:52:18.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.nfacct.new/nfacct.changes 2013-03-08 13:25:31.000000000 +0100 @@ -1,0 +2,7 @@ +Mon Mar 4 14:00:43 UTC 2013 - [email protected] + +- Update to new upstream release 1.0.1 +* fix parsing of command line arguments when both the "xml" and + "reset" options are used + +------------------------------------------------------------------- Old: ---- nfacct-1.0.0.tar.bz2 nfacct-1.0.0.tar.bz2.sig New: ---- nfacct-1.0.1.tar.bz2 nfacct-1.0.1.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nfacct.spec ++++++ --- /var/tmp/diff_new_pack.JHshcZ/_old 2013-03-08 13:25:32.000000000 +0100 +++ /var/tmp/diff_new_pack.JHshcZ/_new 2013-03-08 13:25:32.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package nfacct # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,15 +17,17 @@ Name: nfacct -Version: 1.0.0 +Version: 1.0.1 Release: 0 Summary: Netfilter Extended Accounting utility License: GPL-2.0+ Group: Productivity/Networking/Security Url: http://netfilter.org/ +#Freecode-URL: http://freecode.com/projects/nfacct/ #Git-Web: http://git.netfilter.org/ #Git-Clone: git://git.netfilter.org/nfacct +#DL-URL: http://netfilter.org/projects/nfacct/files/ Source: http://netfilter.org/projects/nfacct/files/%name-%version.tar.bz2 Source2: http://netfilter.org/projects/nfacct/files/%name-%version.tar.bz2.sig Source3: %name.keyring @@ -34,10 +36,10 @@ BuildRequires: pkgconfig >= 0.21 %if 0%{?suse_version} >= 1140 || 0%{?fedora_version} BuildRequires: pkgconfig(libmnl) >= 1.0.0 -BuildRequires: pkgconfig(libnetfilter_acct) >= 1.0.0 +BuildRequires: pkgconfig(libnetfilter_acct) >= 1.0.2 %else BuildRequires: libmnl-devel >= 1.0.0 -BuildRequires: libnetfilter_acct-devel >= 1.0.0 +BuildRequires: libnetfilter_acct-devel >= 1.0.2 %endif %if 0%{?suse_version} >= 1230 BuildRequires: gpg-offline ++++++ nfacct-1.0.0.tar.bz2 -> nfacct-1.0.1.tar.bz2 ++++++ ++++ 5208 lines of diff (skipped) ++++ retrying with extended exclude list diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nfacct-1.0.0/configure.ac new/nfacct-1.0.1/configure.ac --- old/nfacct-1.0.0/configure.ac 2012-03-27 11:43:18.000000000 +0200 +++ new/nfacct-1.0.1/configure.ac 2013-03-03 22:03:05.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT(nfacct, 1.0.0, [email protected]) +AC_INIT(nfacct, 1.0.1, [email protected]) AC_CANONICAL_HOST @@ -20,7 +20,7 @@ esac PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.0]) -PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.0]) +PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.2]) AC_CONFIG_FILES([Makefile src/Makefile include/Makefile include/linux/Makefile include/linux/netfilter/Makefile]) AC_OUTPUT diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nfacct-1.0.0/m4/libtool.m4 new/nfacct-1.0.1/m4/libtool.m4 --- old/nfacct-1.0.0/m4/libtool.m4 2012-03-27 13:15:03.000000000 +0200 +++ new/nfacct-1.0.1/m4/libtool.m4 2013-03-03 22:07:12.000000000 +0100 @@ -2512,17 +2512,6 @@ esac ;; -gnu*) - version_type=linux # correct to gnu/linux during the next big refactor - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no @@ -2639,7 +2628,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no @@ -3255,10 +3244,6 @@ fi ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - haiku*) lt_cv_deplibs_check_method=pass_all ;; @@ -3297,7 +3282,7 @@ ;; # This must be glibc/ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) +linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; @@ -4049,7 +4034,7 @@ ;; esac ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler @@ -4348,7 +4333,7 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) @@ -6241,9 +6226,6 @@ _LT_TAGVAR(ld_shlibs, $1)=yes ;; - gnu*) - ;; - haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes @@ -6405,7 +6387,7 @@ _LT_TAGVAR(inherit_rpath, $1)=yes ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) + linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nfacct-1.0.0/missing new/nfacct-1.0.1/missing --- old/nfacct-1.0.0/missing 2012-03-27 13:15:06.000000000 +0200 +++ new/nfacct-1.0.1/missing 2013-03-03 22:07:15.000000000 +0100 @@ -1,10 +1,10 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -scriptversion=2009-04-28.21; # UTC +scriptversion=2012-01-06.13; # UTC # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. +# 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. # Originally by Fran,cois Pinard <[email protected]>, 1996. # This program is free software; you can redistribute it and/or modify @@ -84,7 +84,6 @@ help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and @@ -122,15 +121,6 @@ # Not GNU programs, they don't have --version. ;; - tar*) - if test -n "$run"; then - echo 1>&2 "ERROR: \`tar' requires --run" - exit 1 - elif test "x$2" = "x--version" || test "x$2" = "x--help"; then - exit 1 - fi - ;; - *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. @@ -226,7 +216,7 @@ \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` @@ -256,7 +246,7 @@ \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then - eval LASTARG="\${$#}" + eval LASTARG=\${$#} case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` @@ -318,41 +308,6 @@ touch $file ;; - tar*) - shift - - # We have already tried tar in the generic part. - # Look for gnutar/gtar before invocation to avoid ugly error - # messages. - if (gnutar --version > /dev/null 2>&1); then - gnutar "$@" && exit 0 - fi - if (gtar --version > /dev/null 2>&1); then - gtar "$@" && exit 0 - fi - firstarg="$1" - if shift; then - case $firstarg in - *o*) - firstarg=`echo "$firstarg" | sed s/o//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - case $firstarg in - *h*) - firstarg=`echo "$firstarg" | sed s/h//` - tar "$firstarg" "$@" && exit 0 - ;; - esac - fi - - echo 1>&2 "\ -WARNING: I can't seem to be able to run \`tar' with the given arguments. - You may want to install GNU tar or Free paxutils, or check the - command line arguments." - exit 1 - ;; - *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nfacct-1.0.0/nfacct.8 new/nfacct-1.0.1/nfacct.8 --- old/nfacct-1.0.0/nfacct.8 2012-03-27 11:22:12.000000000 +0200 +++ new/nfacct-1.0.1/nfacct.8 2013-03-03 22:02:50.000000000 +0100 @@ -17,6 +17,10 @@ .BI "list " List the existing accounting object in table. .TP +.BI "restore " +Restore accounting object table by reading from stdin. Input format is the one used +as output by the list command. +.TP .BI "add " Add new accounting object. .TP diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/nfacct-1.0.0/src/nfacct.c new/nfacct-1.0.1/src/nfacct.c --- old/nfacct-1.0.0/src/nfacct.c 2012-03-27 11:11:28.000000000 +0200 +++ new/nfacct-1.0.1/src/nfacct.c 2013-03-03 22:02:50.000000000 +0100 @@ -31,6 +31,7 @@ NFACCT_CMD_FLUSH, NFACCT_CMD_VERSION, NFACCT_CMD_HELP, + NFACCT_CMD_RESTORE, }; static int nfacct_cmd_list(int argc, char *argv[]); @@ -40,6 +41,7 @@ static int nfacct_cmd_flush(int argc, char *argv[]); static int nfacct_cmd_version(int argc, char *argv[]); static int nfacct_cmd_help(int argc, char *argv[]); +static int nfacct_cmd_restore(int argc, char *argv[]); static void usage(char *argv[]) { @@ -79,6 +81,8 @@ cmd = NFACCT_CMD_VERSION; else if (strncmp(argv[1], "help", strlen(argv[1])) == 0) cmd = NFACCT_CMD_HELP; + else if (strncmp(argv[1], "restore", strlen(argv[1])) == 0) + cmd = NFACCT_CMD_RESTORE; else { fprintf(stderr, "nfacct v%s: Unknown command: %s\n", VERSION, argv[1]); @@ -108,6 +112,9 @@ case NFACCT_CMD_HELP: ret = nfacct_cmd_help(argc, argv); break; + case NFACCT_CMD_RESTORE: + ret = nfacct_cmd_restore(argc, argv); + break; } return ret < 0 ? EXIT_FAILURE : EXIT_SUCCESS; } @@ -159,9 +166,9 @@ int ret, i; for (i=2; i<argc; i++) { - if (strncmp(argv[i], "reset", strlen(argv[2])) == 0) { + if (strncmp(argv[i], "reset", strlen(argv[i])) == 0) { zeroctr = true; - } else if (strncmp(argv[i], "xml", strlen(argv[2])) == 0) { + } else if (strncmp(argv[i], "xml", strlen(argv[i])) == 0) { xml = true; } else { nfacct_perror("unknown argument"); @@ -211,7 +218,7 @@ return 0; } -static int nfacct_cmd_add(int argc, char *argv[]) +static int _nfacct_cmd_add(char *name, int pkts, int bytes) { struct mnl_socket *nl; char buf[MNL_SOCKET_BUFFER_SIZE]; @@ -220,21 +227,16 @@ struct nfacct *nfacct; int ret; - if (argc < 3) { - nfacct_perror("missing object name"); - return -1; - } else if (argc > 3) { - nfacct_perror("too many arguments"); - return -1; - } - nfacct = nfacct_alloc(); if (nfacct == NULL) { nfacct_perror("OOM"); return -1; } - nfacct_attr_set(nfacct, NFACCT_ATTR_NAME, argv[2]); + nfacct_attr_set(nfacct, NFACCT_ATTR_NAME, name); + + nfacct_attr_set_u64(nfacct, NFACCT_ATTR_PKTS, pkts); + nfacct_attr_set_u64(nfacct, NFACCT_ATTR_BYTES, bytes); seq = time(NULL); nlh = nfacct_nlmsg_build_hdr(buf, NFNL_MSG_ACCT_NEW, @@ -276,6 +278,21 @@ return 0; } + + +static int nfacct_cmd_add(int argc, char *argv[]) +{ + if (argc < 3) { + nfacct_perror("missing object name"); + return -1; + } else if (argc > 3) { + nfacct_perror("too many arguments"); + return -1; + } + + return _nfacct_cmd_add(argv[2], 0, 0); +} + static int nfacct_cmd_delete(int argc, char *argv[]) { struct mnl_socket *nl; @@ -357,9 +374,9 @@ return -1; } for (i=3; i<argc; i++) { - if (strncmp(argv[i], "reset", strlen(argv[2])) == 0) { + if (strncmp(argv[i], "reset", strlen(argv[i])) == 0) { zeroctr = true; - } else if (strncmp(argv[i], "xml", strlen(argv[2])) == 0) { + } else if (strncmp(argv[i], "xml", strlen(argv[i])) == 0) { xml = true; } else { nfacct_perror("unknown argument"); @@ -496,6 +513,7 @@ " delete object-name\tDelete existing accounting object\n" " get object-name\tGet existing accounting object\n" " flush\t\t\tFlush accounting object table\n" + " restore\t\tRestore accounting object table reading 'list' output from stdin\n" " version\t\tDisplay version and disclaimer\n" " help\t\t\tDisplay this help message\n"; @@ -504,3 +522,29 @@ printf(help_msg, VERSION, argv[0]); return 0; } + +static int nfacct_cmd_restore(int argc, char *argv[]) +{ + uint64_t pkts, bytes; + char name[512]; + char buffer[512]; + int ret; + while (fgets(buffer, sizeof(buffer), stdin)) { + char *semicolon = strchr(buffer, ';'); + if (semicolon == NULL) { + nfacct_perror("invalid line"); + return -1; + } + *semicolon = 0; + ret = sscanf(buffer, "{ pkts = %lu, bytes = %lu } = %s", + &pkts, &bytes, name); + if (ret != 3) { + nfacct_perror("error reading input"); + return -1; + } + if ((ret = _nfacct_cmd_add(name, pkts, bytes)) != 0) + return ret; + + } + return 0; +} -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
