Your message dated 
with message-id <[email protected]>
and subject line log2mail removed from Debian unstable
has caused the Debian Bug report #387892,
regarding log2mail does not detach from terminal
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 [email protected]
immediately.)


-- 
387892: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=387892
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: log2mail
Version: 0.3.0
Severity: normal
Tags: patch


[email protected] discovered a bug in log2mail which does not
detach from the terminal it was started in.  Attached is a fix to solve
that problem.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-1-k7
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Gemeinsame Unterverzeichnisse: log2mail-0.3.0-vanilla/debian und log2mail-0.3.0/debian.
diff -u log2mail-0.3.0-vanilla/main.cc log2mail-0.3.0/main.cc
--- log2mail-0.3.0-vanilla/main.cc	2004-10-04 22:44:48.000000000 +0200
+++ log2mail-0.3.0/main.cc	2006-09-17 12:08:15.067656500 +0200
@@ -20,6 +20,8 @@
 #include <stdarg.h>
 #include <syslog.h>
 #include <signal.h>
+#include <fcntl.h>
+#include <sys/ioctl.h>
 
 void usage (char *name) {
   printf("usage: %s [-f config file] [-l] [-N] [-V] [-v] [-h|?]\n", name);
@@ -167,6 +169,17 @@
     openlog("log2mail", LOG_PID, LOG_DAEMON);
   }
 
+
+  /* detach from terminal */
+  int fdtty = open("/dev/tty", O_RDWR, 0);
+  if (fdtty != -1) {
+    ioctl(fdtty, (int) TIOCNOTTY, (char *)0);
+    close(fdtty);
+  }
+
+  /* close fds */
+  for (int i=0;i<3;i++) close(i);
+
   /* install signal handler */
   if (SIG_ERR == signal(SIGTERM, sigHandler)) {
     printlog(LOG_ERR, "signal handler for SIGTERM not installed: %m");

--- End Message ---
--- Begin Message ---
Version: 0.3.0-2.1+rm

log2mail has been removed from Debian unstable: http://bugs.debian.org/623246

Closing its bugs with a Version higher than the last unstable upload.

More information about this script at:
  
http://git.debian.org/?p=users/morph/mass-bugs-close.git;a=blob_plain;f=README;hb=HEAD


--- End Message ---

Reply via email to