[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#280629: marked as done (ttylog: CRLF will cause two lines to be outputted)



Your message dated Sun, 27 Jul 2008 07:17:06 +0000
with message-id <E1KN0V8-0003cA-IQ@ries.debian.org>
and subject line Bug#280629: fixed in ttylog 0.1.c-1
has caused the Debian Bug report #280629,
regarding ttylog: CRLF will cause two lines to be outputted
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
280629: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=280629
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: ttylog
Version: 0.1.b-3
Severity: normal
Tags: patch

When the CRLF combination is recieved, ttylog ouputs 2 lines instead of
one. This is caused by the ICRNL option used to setup the connection. 

The attatched patch fixes this problem, and all other outstanding
bugreports for this package. It also includes a new option to timestamp
the serial output. Lastly I have moved the binary from /usr/sbin to
/usr/bin, since normal users can have access to the serialports.

It also bumps the version number to 0.1.c.


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-rc4
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages ttylog depends on:
ii  libc6                       2.3.2.ds1-18 GNU C Library: Shared libraries an

-- no debconf information
diff -ur ttylog-0.1.b/debian/changelog ttylog-0.1.c/debian/changelog
--- ttylog-0.1.b/debian/changelog	2002-11-04 16:20:12.000000000 +0100
+++ ttylog-0.1.c/debian/changelog	2004-11-10 16:42:09.000000000 +0100
@@ -1,3 +1,15 @@
+ttylog (0.1.c-1) unstable; urgency=low
+
+  * Added support for 4800 baud-rate - Closes: bug#203356
+  * -f no longer causes the program to output "flushed." - Closes: bug#267872
+  * Changed ICRNL to IGNCR, so \r\n don't become two lines. Allows the
+    removal of del1013, which fixes a memory-leak - Closes: bug#271098
+  * Added -t option which will add a timestamp at the beginning of each line
+  * Moved the binary from /usr/sbin to /usr/bin, so normal users can start the
+    program.
+
+ -- Klaus S. Madsen <ksm@hjernemadsen.org>  Wed, 10 Nov 2004 16:24:24 +0100
+
 ttylog (0.1.b-3) unstable; urgency=low
 
   * Using optional output flush - Closes: bug#164778
diff -ur ttylog-0.1.b/Makefile ttylog-0.1.c/Makefile
--- ttylog-0.1.b/Makefile	2002-01-12 20:27:52.000000000 +0100
+++ ttylog-0.1.c/Makefile	2004-11-10 17:13:57.000000000 +0100
@@ -15,5 +15,6 @@
 		rm -f *.o ttylog core *~
 
 install: ttylog
-	$(INS) -o root -g root -m 0755 -s ttylog $(DESTDIR)/usr/sbin
-	$(INS) -o root -g root -m 0444 ttylog.8 $(DESTDIR)/usr/share/man/man8
+	$(INS) -o root -g root -m 0755 -d $(DESTDIR)/usr/bin
+	$(INS) -o root -g root -m 0755 -s ttylog $(DESTDIR)/usr/bin/ttylog
+	$(INS) -o root -g root -m 0444 ttylog.8 $(DESTDIR)/usr/share/man/man8/ttylog.8
diff -ur ttylog-0.1.b/ttylog.8 ttylog-0.1.c/ttylog.8
--- ttylog-0.1.b/ttylog.8	1999-06-04 00:00:00.000000000 +0200
+++ ttylog-0.1.c/ttylog.8	2004-11-10 16:47:38.000000000 +0100
@@ -1,4 +1,4 @@
-.TH TTYLOG 8 "04 Jun 1999" "" ""
+.TH TTYLOG 8 "10 Nov 2004" "" ""
 .SH NAME
 ttylog \- serial device logger
 .SH DESCRIPTION
@@ -16,12 +16,15 @@
 .TP
 .B -b, --baud
 Baud rate of the device. Available baud rates:
-300, 1200, 2400, 9600, 19200, 38400, 57600 and 115200
+300, 1200, 2400, 4800, 9600, 19200, 38400, 57600 and 115200
 .TP
-.B -d --device
+.B -d, --device 
 The serial device. For example /dev/ttyS1
+.TP
+.B -t, --timestamp
+Put a timestamp in front of each recieved line.
 .SH AUTHOR
 This manual page was written by Tibor Koleszar <t.koleszar@somogy.hu>,
 for the Debian GNU/Linux system.
-Last modify: Fri Jun  4 10:36:45 1999
+Last modify: Wed Nov 10 16:47:23 2004
 
diff -ur ttylog-0.1.b/ttylog.c ttylog-0.1.c/ttylog.c
--- ttylog-0.1.b/ttylog.c	2002-11-04 16:25:46.000000000 +0100
+++ ttylog-0.1.c/ttylog.c	2004-11-10 16:57:16.000000000 +0100
@@ -9,32 +9,17 @@
 #include <sys/types.h>
 #include <fcntl.h>
 
-#define VERSION "0.1.a"
-#define BAUDN 8
+#define VERSION "0.1.c"
+#define BAUDN 9
 
 char flush = 0;
+char timestamp = 0;
 
 char *BAUD_T[] =
-{"300", "1200", "2400", "9600", "19200", "38400", "57600", "115200"};
+{"300", "1200", "2400", "4800", "9600", "19200", "38400", "57600", "115200"};
 
 int BAUD_B[] =
-{B300, B1200, B2400, B9600, B19200, B38400, B57600, B115200};
-
-
-char *
-del1013 (char *str)
-{
-  short i;
-  char *dummy;
-
-  dummy = (char *) malloc (1024);
-  dummy[0] = 0;
-  for (i = 0; i < strlen (str); i++)
-    if (str[i] != 10 && str[i] != 13)
-      sprintf (dummy, "%s%c", dummy, str[i]);
-
-  return dummy;
-}
+{B300, B1200, B2400, B4800, B9600, B19200, B38400, B57600, B115200};
 
 int
 main (int argc, char *argv[])
@@ -45,7 +30,7 @@
   int fd;
   char line[1024], modem_device[512];
   time_t logdate;
-  struct tm *logdate_s;
+  char *logdate_s;
   struct termios oldtio, newtio;
 
 
@@ -65,6 +50,8 @@
 	  printf ("ttylog version %s. Programmed by Tibor Koleszar <oldw@debian.org>\n", VERSION);
 	  printf ("Usage: \n -h, --help	This help\n -v, --version	Version number\n");
 	  printf (" -b, --baud	Baud rate\n -d, --device	Serial device (eg. /dev/ttyS1)\n -f, --flush	Flush output\n");
+	  printf (" -t, --time	Time-stamp the output\n");
+
 	  exit (0);
 	}
 
@@ -105,7 +92,10 @@
 	    {
 	    }
 	}
-
+      if (!strcmp (argv[i], "-t") || !strcmp (argv[i], "--timestamp"))
+	{
+	  timestamp = 1;
+	}
 
     }
 
@@ -128,7 +118,7 @@
   bzero (&newtio, sizeof (newtio));	/* clear struct for new port settings */
 
   newtio.c_cflag = BAUD_B[baud] | CRTSCTS | CS8 | CLOCAL | CREAD;
-  newtio.c_iflag = IGNPAR | ICRNL;
+  newtio.c_iflag = IGNPAR | IGNCR;
   newtio.c_oflag = 0;
   newtio.c_lflag = ICANON;
 
@@ -148,11 +138,20 @@
       if (retval)
 	{
 	  fgets (line, 1024, logfile);
-	  strcpy (line, del1013 (line));
-	  logdate = time (NULL);
-	  logdate_s = localtime (&logdate);
-	  printf ("%s\n", line);
-	  if (flush) { fflush(stdout); printf("flushed.");}
+	  if (timestamp)
+	    {
+	      char* tmp;
+	      logdate = time (NULL);
+	      logdate_s = ctime(&logdate);
+	      tmp = logdate_s;
+	      while (*tmp != '\0' && *tmp != '\n')
+		tmp++;
+
+	      *tmp = ':';
+	      printf("%s ", logdate_s);
+	    }
+	  printf ("%s", line);
+	  if (flush) { fflush(stdout); }
 	}
     }
 

--- End Message ---
--- Begin Message ---
Source: ttylog
Source-Version: 0.1.c-1

We believe that the bug you reported is fixed in the latest version of
ttylog, which is due to be installed in the Debian FTP archive:

ttylog_0.1.c-1.diff.gz
  to pool/main/t/ttylog/ttylog_0.1.c-1.diff.gz
ttylog_0.1.c-1.dsc
  to pool/main/t/ttylog/ttylog_0.1.c-1.dsc
ttylog_0.1.c-1_amd64.deb
  to pool/main/t/ttylog/ttylog_0.1.c-1_amd64.deb
ttylog_0.1.c.orig.tar.gz
  to pool/main/t/ttylog/ttylog_0.1.c.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 280629@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Robert James Clay <jame@rocasa.org> (supplier of updated ttylog package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 26 Jul 2008 20:56:58 -0400
Source: ttylog
Binary: ttylog
Architecture: source amd64
Version: 0.1.c-1
Distribution: unstable
Urgency: low
Maintainer: Robert James Clay <jame@rocasa.org>
Changed-By: Robert James Clay <jame@rocasa.org>
Description: 
 ttylog     - serial port logger
Closes: 203356 267872 271098 280629 358515 438226
Changes: 
 ttylog (0.1.c-1) unstable; urgency=low
 .
   * New Maintainer (closes: #358515)
   * New upstream release:
     - Added support for 4800 baud (Closes: #203356)
     - Remove unneeded printf for flushed option. (Closes: #267872)
     - Change ICRNL to IGNCR for connection setup. (Closes: #280629)
     - Remove del1013() and other unused code (Closes: #271098)
     - Fix nostrip build issue. (Closes: #438226)
   * Set debhelper compatibility level to 5
   * Set Standards Version to 3.8.0
   * Reword description and add Homepage to debian/control.
   * Add debian/watch file.
Checksums-Sha1: 
 ef080d3692106e8cb9ec94aa37ed987b8d2f2fd1 964 ttylog_0.1.c-1.dsc
 6adcad4788b33b3842d638afb02b448360b1ebcc 8153 ttylog_0.1.c.orig.tar.gz
 2b554d80b716f1eea29160bf87af21c0874c34a6 2367 ttylog_0.1.c-1.diff.gz
 517a22b0dd89f0014ae7c47221cbe355db50e643 6322 ttylog_0.1.c-1_amd64.deb
Checksums-Sha256: 
 16d3aaad4b7223f8188c55c8d40da44a808cc59e8062f3c4d052e188acfce83c 964 ttylog_0.1.c-1.dsc
 9a4efe148760c8b260ac9b6ed9ad8aed1283ef14a686de28d27540da20ba8aec 8153 ttylog_0.1.c.orig.tar.gz
 20ff5fba444bde5ca8cee2482b459fe1d0120a259291693e01dbd9772a2d6925 2367 ttylog_0.1.c-1.diff.gz
 855bc16d6f0952670ee4d82f0c06c8645ef4cdefc3dd809d9d3706aa493cc008 6322 ttylog_0.1.c-1_amd64.deb
Files: 
 320bec9a61854772ca4a66b7fe879eb1 964 utils extra ttylog_0.1.c-1.dsc
 6fce229fa9a262c84dc6279fb0b47b3f 8153 utils extra ttylog_0.1.c.orig.tar.gz
 cfe4cd3b7db242aa3e2394fb9185cf68 2367 utils extra ttylog_0.1.c-1.diff.gz
 876fd746e4009c82697dc46ae35c02b3 6322 utils extra ttylog_0.1.c-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkiMIFkACgkQKFvXofIqeU7fPwCdGS51CAPL1wmUyZ1o3WJlvYxr
J2cAni7K4IDK65v9b0WZeuz+H2JqFI5A
=B3PY
-----END PGP SIGNATURE-----



--- End Message ---

Reply to: