diff --git a/acct-6.3.5-ac.dif b/acct-6.3.5-ac.dif deleted file mode 100644 index 6b86403..0000000 --- a/acct-6.3.5-ac.dif +++ /dev/null @@ -1,60 +0,0 @@ ---- Makefile.am -+++ Makefile.am -@@ -11,7 +11,7 @@ - ## From what sources are those programs built? - - ac_SOURCES = ac.c common.c file_rd.c getopt.c getopt1.c hashtab.c \ -- @MKTIME_C@ utmp_rd.c -+ mktime.c utmp_rd.c - ac_LDADD = @ALLOCA@ - - accton_SOURCES = accton.c common.c getopt.c getopt1.c ---- configure.in -+++ configure.in -@@ -6,7 +6,7 @@ - AM_INIT_AUTOMAKE(acct, 6.3.5, no-define-symbols) - AM_CONFIG_HEADER(config.h) - --AC_ARG_PROGRAM -+dnl AC_ARG_PROGRAM - AC_PROG_CC - if test "x${ac_cv_prog_gcc}" = "xyes"; then - CFLAGS="${CFLAGS} -Wall -Wmissing-prototypes" -@@ -56,7 +56,7 @@ - dnl and whether fields are int/comp_t - dnl - AC_CHECK_HEADER(sys/acct.h, -- AC_DEFINE(HAVE_SYS_ACCT_H) -+ [AC_DEFINE(HAVE_SYS_ACCT_H) - DUMP_ACCT_PROG=dump-acct - ACCTON_PROG=accton - LASTCOMM_PROG=lastcomm -@@ -89,14 +89,14 @@ - AC_HEADER_EGREP(comp_t.*ac_mem, sys/acct.h, - AC_DEFINE(ACMEM_COMPT)) - ) -- AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T)) -- , -+ AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T))] -+ ,[ - dnl - dnl here is the "else" clause for the above AC_CHECK_HEADER - dnl (for older versions of linux, which didn't have a sys/acct.h) - dnl - AC_CHECK_HEADER(linux/acct.h, -- AC_DEFINE(HAVE_LINUX_ACCT_H) -+ [AC_DEFINE(HAVE_LINUX_ACCT_H) - DUMP_ACCT_PROG=dump-acct - ACCTON_PROG=accton - LASTCOMM_PROG=lastcomm -@@ -133,8 +133,8 @@ - AC_DEFINE(ACMEM_COMPT)) - ) - AC_HEADER_EGREP(comp_t, linux/acct.h, AC_DEFINE(HAVE_COMP_T)) -- , ) --) -+ ]) -+]) - dnl - dnl find out where utmp/pacct are stored - dnl diff --git a/acct-6.3.5-acct_v3-fix.diff b/acct-6.3.5-acct_v3-fix.diff deleted file mode 100644 index 9438bfc..0000000 --- a/acct-6.3.5-acct_v3-fix.diff +++ /dev/null @@ -1,93 +0,0 @@ ---- configure.in -+++ configure.in -@@ -55,46 +55,7 @@ - dnl figure out where acct.h lives - dnl and whether fields are int/comp_t - dnl --AC_CHECK_HEADER(sys/acct.h, -- [AC_DEFINE(HAVE_SYS_ACCT_H) -- DUMP_ACCT_PROG=dump-acct -- ACCTON_PROG=accton -- LASTCOMM_PROG=lastcomm -- SA_PROG=sa -- ACCTON_MAN=accton.8 -- LASTCOMM_MAN=lastcomm.1 -- SA_MAN=sa.8 -- AC_HEADER_EGREP(ac_utime, sys/acct.h, -- AC_DEFINE(HAVE_ACUTIME) -- AC_HEADER_EGREP(comp_t.*ac_utime, sys/acct.h, -- AC_DEFINE(ACUTIME_COMPT)) -- ) -- AC_HEADER_EGREP(ac_stime, sys/acct.h, -- AC_DEFINE(HAVE_ACSTIME) -- AC_HEADER_EGREP(comp_t.*ac_stime, sys/acct.h, -- AC_DEFINE(ACSTIME_COMPT)) -- ) -- AC_HEADER_EGREP(ac_etime, sys/acct.h, -- AC_DEFINE(HAVE_ACETIME) -- AC_HEADER_EGREP(comp_t.*ac_etime, sys/acct.h, -- AC_DEFINE(ACETIME_COMPT)) -- ) -- AC_HEADER_EGREP(ac_io, sys/acct.h, -- AC_DEFINE(HAVE_ACIO) -- AC_HEADER_EGREP(comp_t.*ac_io, sys/acct.h, -- AC_DEFINE(ACIO_COMPT)) -- ) -- AC_HEADER_EGREP(ac_mem, sys/acct.h, -- AC_DEFINE(HAVE_ACMEM) -- AC_HEADER_EGREP(comp_t.*ac_mem, sys/acct.h, -- AC_DEFINE(ACMEM_COMPT)) -- ) -- AC_HEADER_EGREP(comp_t, sys/acct.h, AC_DEFINE(HAVE_COMP_T))] -- ,[ -- dnl -- dnl here is the "else" clause for the above AC_CHECK_HEADER -- dnl (for older versions of linux, which didn't have a sys/acct.h) -- dnl -+ - AC_CHECK_HEADER(linux/acct.h, - [AC_DEFINE(HAVE_LINUX_ACCT_H) - DUMP_ACCT_PROG=dump-acct -@@ -134,7 +95,6 @@ - ) - AC_HEADER_EGREP(comp_t, linux/acct.h, AC_DEFINE(HAVE_COMP_T)) - ]) --]) - dnl - dnl find out where utmp/pacct are stored - dnl ---- dump-acct.c -+++ dump-acct.c -@@ -14,7 +14,6 @@ - #include "pacct_rd.h" - #include "getopt.h" - -- - char *program_name; - int debugging_enabled = 0; /* no -- we don't care about bad - records or the file-reading ---- pacct_rd.h -+++ pacct_rd.h -@@ -6,6 +6,10 @@ - - #include "files.h" - -+#ifndef acct -+#define acct acct_v3 -+#endif -+ - /* This looks strange, but it's real ANSI C. */ - - extern struct acct pacct_rd_never_used; ---- sa.c -+++ sa.c -@@ -78,6 +78,9 @@ - #include "hashtab.h" - #include "version.h" - -+#ifndef acct -+#define acct acct_v3 -+#endif - - /* defines, structures, and the like */ - diff --git a/acct-6.3.5-axp.dif b/acct-6.3.5-axp.dif deleted file mode 100644 index 8884bd0..0000000 --- a/acct-6.3.5-axp.dif +++ /dev/null @@ -1,45 +0,0 @@ ---- accton.c -+++ accton.c -@@ -21,6 +21,7 @@ - - #include "config.h" - -+#include - #include - #include - #include ---- sa.c -+++ sa.c -@@ -1158,27 +1158,17 @@ - - if (print_users) - { -- printf ("%-8.8s" -+ printf ("%-8.8s", uid_name (rec->ac_uid)); - #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) -- " %6.2f cpu" -+ printf (" %6.2f cpu", ut + st); - #endif - #if defined(HAVE_ACMEM) -- " %8.0fk mem" -+ printf (" %8.0fk mem", mu); - #endif - #ifdef HAVE_ACIO -- " %6.0f io" --#endif -- " %-*.*s%s\n", -- uid_name (rec->ac_uid), --#if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) -- ut + st, --#endif --#if defined(HAVE_ACMEM) -- mu, --#endif --#ifdef HAVE_ACIO -- di, -+ printf (" %6.0f io", di); - #endif -+ printf (" %-*.*s%s\n", - COMM_LEN, COMM_LEN, rec->ac_comm, - (rec->ac_flag & AFORK) ? "*" : ""); - } diff --git a/acct-6.3.5-info.diff b/acct-6.3.5-info.diff deleted file mode 100644 index 2af42bd..0000000 --- a/acct-6.3.5-info.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- accounting.texi -+++ accounting.texi -@@ -4,6 +4,11 @@ - - @include version.texi - -+@dircategory Miscellaneous -+@direntry -+* acct: (accounting). User specific process accounting. -+@end direntry -+ - @ifinfo - GNU Accounting Utilities - Copyright (C) 1993, 1996, 1997 Free Software Foundation, Inc. diff --git a/acct-6.3.5-time-fix.diff b/acct-6.3.5-time-fix.diff deleted file mode 100644 index 89e750f..0000000 --- a/acct-6.3.5-time-fix.diff +++ /dev/null @@ -1,82 +0,0 @@ ---- al_share.cpp -+++ al_share.cpp -@@ -114,11 +114,13 @@ - { - if (print_file_problems) - { -+ time_t tmp_time; - utmp_print_file_and_line (stddebug); - fprintf (stddebug, ": problem: time warp (%-24.24s", - ctime (&last_time)); -- fprintf (stddebug, " -> %-24.24s)\n", -- ctime ((time_t *) &(rec->ut_time))); -+ tmp_time = rec->ut_time; -+ fprintf (stddebug, " -> %-24.24s)\n", -+ ctime (&tmp_time)); - } - - #ifdef BACKWARDS ---- lastcomm.c -+++ lastcomm.c -@@ -273,6 +273,7 @@ - parse_entries (void) - { - struct acct *rec; /* the current record */ -+ time_t tmp_time; - - /* loop while there are entries to be had */ - -@@ -349,10 +350,11 @@ - #endif - putchar (' '); - -+ tmp_time = rec->ac_btime; - printf (" %-8.8s %-8.8s %6.2f secs %-16.16s\n", - this_uid, this_dev, - ((ut + st) / (double) ahz), -- ctime (&rec->ac_btime)); -+ ctime (&tmp_time)); - } - } - } ---- pacct_rd.c -+++ pacct_rd.c -@@ -61,6 +61,7 @@ - void - print_pacct_record (struct acct *rec, FILE *out) - { -+ time_t tmp_time; - fprintf (stddebug, "%-*.*s|", COMM_LEN, COMM_LEN, rec->ac_comm); - - #define NUM_FORMAT "%6.1f" -@@ -117,7 +118,8 @@ - ); - #endif - -- fprintf (stddebug, "%s", ctime ((time_t *) &(rec->ac_btime))); -+ tmp_time = rec->ac_btime; -+ fprintf (stddebug, "%s", ctime (&tmp_time)); - } - - ---- utmp_rd.c -+++ utmp_rd.c -@@ -67,6 +67,7 @@ - void - print_utmp_record (struct utmp *rec, FILE *out) - { -+ time_t tmp_time; - if (rec) - { - fprintf (out, "%-*.*s|%-*.*s|", -@@ -117,8 +118,8 @@ - #ifdef HAVE_UT_HOST - fprintf (out, "%-*.*s|", HOST_LEN, HOST_LEN, rec->ut_host); - #endif -- -- fputs (ctime ((time_t *) &(rec->ut_time)), out); -+ tmp_time = rec->ut_time; -+ fputs (ctime (&tmp_time), out); - } - } - diff --git a/acct-6.3.5-warning.patch b/acct-6.3.5-warning.patch deleted file mode 100644 index d3a2030..0000000 --- a/acct-6.3.5-warning.patch +++ /dev/null @@ -1,46 +0,0 @@ ---- mktime.c -+++ mktime.c -@@ -124,9 +124,7 @@ - #define localtime_r my_localtime_r - static struct tm *localtime_r __P ((const time_t *, struct tm *)); - static struct tm * --localtime_r (t, tp) -- const time_t *t; -- struct tm *tp; -+localtime_r ( const time_t * t, struct tm * tp) - { - struct tm *l = localtime (t); - if (! l) -@@ -144,9 +142,7 @@ - All values are in range, except possibly YEAR. - If overflow occurs, yield the low order bits of the correct answer. */ - static time_t --ydhms_tm_diff (year, yday, hour, min, sec, tp) -- int year, yday, hour, min, sec; -- const struct tm *tp; -+ydhms_tm_diff (int year, int yday, int hour, int min, int sec, const struct tm *tp) - { - /* Compute intervening leap days correctly even if year is negative. - Take care to avoid int overflow. time_t overflow is OK, since -@@ -173,8 +169,7 @@ - - /* Convert *TP to a time_t value. */ - time_t --mktime (tp) -- struct tm *tp; -+mktime (struct tm *tp) - { - #ifdef _LIBC - /* POSIX.1 8.1.1 requires that whenever mktime() is called, the -@@ -192,10 +187,7 @@ - compared to what the result would be for UTC without leap seconds. - If *OFFSET's guess is correct, only one CONVERT call is needed. */ - time_t --__mktime_internal (tp, convert, offset) -- struct tm *tp; -- struct tm *(*convert) __P ((const time_t *, struct tm *)); -- time_t *offset; -+__mktime_internal (struct tm *tp, struct tm *(*convert) (const time_t *, struct tm *), time_t *offset) - { - time_t t, dt, t0; - struct tm tm; diff --git a/acct-6.3.5.tar.bz2 b/acct-6.3.5.tar.bz2 deleted file mode 100644 index 782ed6a..0000000 --- a/acct-6.3.5.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:cedd1c130f290574eafb98cd8302aaf0fa6aea44dd1ab64b91bef3d00a614f62 -size 125622 diff --git a/acct-6.5.5.tar.gz b/acct-6.5.5.tar.gz new file mode 100644 index 0000000..9c70c86 --- /dev/null +++ b/acct-6.5.5.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4163c87b9e92a73a65eaeadc6c41caa4626da782ff26d6e7a945edcc140a6fd5 +size 747225 diff --git a/acct-ac.patch b/acct-ac.patch new file mode 100644 index 0000000..f07331a --- /dev/null +++ b/acct-ac.patch @@ -0,0 +1,42 @@ +Subject: configure.ac: Change AC_LANG_SOURCE() into AC_LANG_PROGRAM() + +--- + configure.ac | 8 ++------ + 1 files changed, 2 insertions(+), 6 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 743fe29..c150ca3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -162,7 +162,7 @@ AC_CHECK_HEADER(sys/acct.h, + dnl + dnl find out where utmp/pacct are stored + dnl +-AC_RUN_IFELSE([AC_LANG_SOURCE([[ ++AC_RUN_IFELSE([AC_LANG_PROGRAM([[ + #include + #include + #include +@@ -241,9 +241,7 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ + # endif + # endif + #endif +- +-main () +-{ ++]], [[ + FILE *fp; + fp = fopen ("locs", "w"); + fprintf (fp, "WTMP_FILE_LOC=%s\n", WTMP_FILE); +@@ -251,8 +249,6 @@ main () + fprintf (fp, "SAVACCT_FILE_LOC=%s\n", SAVACCT_FILE); + fprintf (fp, "USRACCT_FILE_LOC=%s\n", USRACCT_FILE); + fclose (fp); +- exit(0); +-} + ]])],[. ./locs; rm locs],[echo "Error -- could not locate your wtmp and acct files."; exit 1],[echo "Sorry -- you cannot cross-compile this package (FIXME)."; exit 1 ]) + AC_TYPE_PID_T dnl for sys/acct.h + AC_TYPE_UID_T dnl same as above +-- +1.7.7 + diff --git a/acct-axp.patch b/acct-axp.patch new file mode 100644 index 0000000..4ad1bf0 --- /dev/null +++ b/acct-axp.patch @@ -0,0 +1,21 @@ +Subject: acct-axp.patch + +--- + accton.c | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/accton.c b/accton.c +index eeb503d..4c8e2eb 100644 +--- a/accton.c ++++ b/accton.c +@@ -21,6 +21,7 @@ MA 02139, USA. + + #include "config.h" + ++#include + #include + #include + #include +-- +1.7.7 + diff --git a/acct-6.3.5-hz.patch b/acct-hz.patch similarity index 66% rename from acct-6.3.5-hz.patch rename to acct-hz.patch index 14212e8..faec27f 100644 --- a/acct-6.3.5-hz.patch +++ b/acct-hz.patch @@ -1,6 +1,15 @@ ---- lastcomm.c -+++ lastcomm.c -@@ -48,6 +48,10 @@ +Subject: acct-hz.patch + +--- + lastcomm.c | 14 +++++++++++++- + sa.c | 14 +++++++++++++- + 2 files changed, 26 insertions(+), 2 deletions(-) + +diff --git a/lastcomm.c b/lastcomm.c +index 276f9fa..993118d 100644 +--- a/lastcomm.c ++++ b/lastcomm.c +@@ -49,6 +49,10 @@ MA 02139, USA. */ #include @@ -9,9 +18,9 @@ +#endif + #include "common.h" + #include "files.h" #include "uid_hash.h" - #include "dev_hash.h" -@@ -65,7 +69,7 @@ +@@ -71,7 +75,7 @@ int debugging_enabled = 0; /* Nonzero means print internal int strict_match_flag = 0; /* Nonzero if each record has to match all items on the command line */ int print_controls = 0; /* don't print control characters */ @@ -20,17 +29,9 @@ char *program_name; /* name of the program, for usage & errs */ -@@ -88,7 +92,6 @@ - int get_entry PARAMS((struct acct **)); - int desired_entry PARAMS((char *, char *, char *)); - -- - /* code */ - - void -@@ -288,6 +291,14 @@ - print_pacct_record (rec, stddebug); - } +@@ -328,6 +332,14 @@ void parse_entries(void) + print_pacct_record (rec, stddebug); + } + if (!ahz) // if this is the first cycle run, ahz is not set yet + { @@ -41,11 +42,13 @@ + } + if (desired_entry (this_uid, this_dev, rec->ac_comm)) - { - #ifdef HAVE_COMP_T ---- sa.c -+++ sa.c -@@ -174,7 +174,7 @@ + { + double ut = ACUTIME_2_DOUBLE (rec->ac_utime); +diff --git a/sa.c b/sa.c +index 55b1a23..8891a50 100644 +--- a/sa.c ++++ b/sa.c +@@ -189,7 +189,7 @@ int dont_read_summary_files = 0; int print_users = 0; int percentages = 0; /* include percentages in printout */ int user_summary_flag = 0; /* are we printing a user summary? */ @@ -54,15 +57,7 @@ #if defined(HAVE_ACUTIME) && defined(HAVE_ACSTIME) -@@ -262,7 +262,6 @@ - int ask_if_junkable PARAMS((char *, int)); - - -- - /* code */ - - void -@@ -1116,6 +1115,18 @@ +@@ -1173,6 +1173,18 @@ void parse_acct_entries (void) /* loop while there are entries to be had */ while ((rec = pacct_get_entry ()) != NULL) { @@ -79,5 +74,8 @@ + } + } #ifdef HAVE_ACUTIME - # ifdef ACUTIME_COMPT - double ut = comp_t_2_double (rec->ac_utime) / (double) ahz; + double ut = comp_t_2_double (rec->ac_utime) / (double) hzval; + #endif +-- +1.7.7 + diff --git a/acct-info.patch b/acct-info.patch new file mode 100644 index 0000000..1ba50d6 --- /dev/null +++ b/acct-info.patch @@ -0,0 +1,25 @@ +Subject: Add @dircategory and @direntry + +--- + accounting.texi | 5 +++++ + 1 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/accounting.texi b/accounting.texi +index f580f6f..5c8df0d 100644 +--- a/accounting.texi ++++ b/accounting.texi +@@ -11,6 +11,11 @@ + + @include version.texi + ++@dircategory Miscellaneous ++@direntry ++* acct: (accounting). User specific process accounting. ++@end direntry ++ + @ifinfo + GNU Accounting Utilities + Copyright (C) 1993, 1996, 1997, 1998, 2005, 2008, 2009, 2010 +-- +1.7.7 + diff --git a/acct.changes b/acct.changes index 8ea97ff..010dbbb 100644 --- a/acct.changes +++ b/acct.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Mon Jan 23 08:43:45 UTC 2012 - bart.vanassche@gmail.com + +- switch from acct-6.3.5 to acct-6.5.5. From the upstream acct ChangeLog: + * Fix potential buffer-overflows. + * UNIX 98 pty support. + * Add Linux multiformat support. + * lastcomm.c: integrated patch from Paul Jones which adds + paging and swapping support to lastcomm and sa + ------------------------------------------------------------------- Mon Oct 4 10:37:43 UTC 2011 - uli@suse.com diff --git a/acct.spec b/acct.spec index f6535cc..24bc4a9 100644 --- a/acct.spec +++ b/acct.spec @@ -1,7 +1,7 @@ # # spec file for package acct # -# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2012 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 @@ -21,19 +21,16 @@ Name: acct License: GPL-2.0+ Group: System/Base PreReq: %insserv_prereq %fillup_prereq fileutils %install_info_prereq -Version: 6.3.5 -Release: 829 -Source: %{name}-%{version}.tar.bz2 +Version: 6.5.5 +Release: 830 +Source: %{name}-%{version}.tar.gz Source1: rc.acct Source2: logrotate.acct BuildRequires: libtool -Patch: %{name}-%{version}-axp.dif -Patch1: %{name}-%{version}-ac.dif -Patch2: %{name}-%{version}-info.diff -Patch3: %{name}-%{version}-acct_v3-fix.diff -Patch4: %{name}-%{version}-time-fix.diff -Patch5: %{name}-%{version}-hz.patch -Patch6: %{name}-%{version}-warning.patch +Patch: %{name}-hz.patch +Patch1: %{name}-axp.patch +Patch2: %{name}-info.patch +Patch3: %{name}-ac.patch Url: http://www.gnu.org/directory/acct.html BuildRoot: %{_tmppath}/%{name}-%{version}-build Summary: User-Specific Process Accounting @@ -44,22 +41,16 @@ accounting: sa, accton, and lastcomm. %prep %setup -q -%patch -%patch1 -%patch2 -%patch3 -%patch4 -%patch5 -%patch6 +%patch -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %define prefix /usr %define sysconfdir /etc %{suse_update_config} -libtoolize -f -aclocal -automake -a -autoconf +autoreconf -ivf CFLAGS="$RPM_OPT_FLAGS" CXXFLAGS="$RPM_OPT_FLAGS" ./configure \ --mandir=%{_mandir} \ --prefix=%{prefix} \