diff --git a/ChangeLog b/ChangeLog index 0b840c10..bb1ecdba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,19 @@ -$Id: ChangeLog 24 2010-02-11 20:24:49Z bostjanskufca $ +------------------------------------------------------------------------------- + SnoopyLogger changelog +------------------------------------------------------------------------------- + + + +2010-09-24 - Version 1.7.2 +--------------------------- +o Logs current tty + 2010-02-11 - Version 1.6.1 --------------------------- o Logs current working directory + 2010-02-09 - Version 1.6.0 --------------------------- o Uses autotools now @@ -14,26 +24,31 @@ o Program name and argument lengths limited to 4096 bytes o Many thanks to otheus for supplying a patch on SourceForge one and a half years ago, it helped tremendously. + 2010-02-09 - Version 1.5.0 --------------------------- o Updated to compile and work without segfaults on 32bit and 64bit platforms o Project maintenance taken over by Bostjan Skufca + Sun December 10 - Version 1.3 ------------------------------ o Altered logging mechanism for performance o Added new way of logging (can choose) o Added an integrity check (optional) + Wed October 25 - Version 1.2a ----------------------------- o ROOT_ONLY behavior now works again, thanks to adrian.head@bytecomm.com.au for notifying us! + Thu October 10 - Version 1.2 ----------------------------- o Fixed small bug with rather adverse side effects. + Thu August 17 - Version 1.1 ---------------------------- o Added support for execv(). Although execv() calls execve() @@ -42,6 +57,7 @@ o Added support for execv(). Although execv() calls execve() o Made logging code modular, as to accomodate for the extra overload that execv() brought. + Thu August 3 - Version 1.00 ---------------------------- o Cleaned up the codebase a bit diff --git a/configure.ac b/configure.ac index 54417c8e..e13a4f5d 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([Snoopy Logger], [1.6.1], [http://sourceforge.net/projects/snoopylogger/], [snoopy]) +AC_INIT([Snoopy Logger], [1.7.2], [http://sourceforge.net/projects/snoopylogger/], [snoopy]) AC_DEFINE(PACKAGE_URL, "http://sourceforge.net/projects/snoopylogger/") AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) diff --git a/configure.ac.generated b/configure.ac.generated index 02f6c218..e13a4f5d 100644 --- a/configure.ac.generated +++ b/configure.ac.generated @@ -2,7 +2,8 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.63]) -AC_INIT([FULL-PACKAGE-NAME], [VERSION], [BUG-REPORT-ADDRESS]) +AC_INIT([Snoopy Logger], [1.7.2], [http://sourceforge.net/projects/snoopylogger/], [snoopy]) +AC_DEFINE(PACKAGE_URL, "http://sourceforge.net/projects/snoopylogger/") AC_CONFIG_SRCDIR([config.h.in]) AC_CONFIG_HEADERS([config.h]) @@ -26,4 +27,27 @@ AC_FUNC_MALLOC AC_CHECK_FUNCS([getcwd]) AC_CONFIG_FILES([Makefile]) + + + +dnl ============================================================================ +AC_ARG_ENABLE(cwd-logging, + [AC_HELP_STRING([--enable-cwd-logging], + [enable logging of Current Working Directory [default=yes]] + )], + [ + if test "$enableval" == "yes"; then + enable_cwd_logging=yes + fi + ], + [enable_cwd_logging=yes] +) + +AS_IF([test "x$enable_cwd_logging" == "xyes"], [ + AC_DEFINE(SNOOPY_CWD_LOGGING, 1, [Enable logging of Current Working Directory]) +]) + + + +dnl ============================================================================ AC_OUTPUT diff --git a/snoopy.c b/snoopy.c index b02e8562..7c0910e2 100644 --- a/snoopy.c +++ b/snoopy.c @@ -48,6 +48,7 @@ static inline void snoopy_log(const char *filename, char *const argv[]) size_t logStringLength = 0; char cwd[PATH_MAX+1]; char *getCwdRet = NULL; + char *ttyPath = NULL; int i = 0; int argc = 0; @@ -61,19 +62,26 @@ static inline void snoopy_log(const char *filename, char *const argv[]) } #endif - // Count number of arguments + /* Count number of arguments */ for (argc=0 ; *(argv+argc) != '\0' ; argc++); - // Allocate memory for logString + /* Get ttyname */ + ttyPath = ttyname(0); + if (ttyPath == NULL) { + ttyPath = malloc(sizeof(int)*1); + ttyPath = "\0"; + } + + /* Allocate memory for logString */ logStringLength = 0; for (i=0 ; i