Your message dated Tue, 20 Feb 2007 06:32:03 +0000
with message-id <[EMAIL PROTECTED]>
and subject line Bug#409944: fixed in l2tpd 0.70-pre20031121-2.2
has caused the attached Bug report 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 I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: l2tpd
Severity: grave
Tags: patch

The l2tpd binary still uses the legacy PTY method for getting
PTYs. The configuration option for this in the kernel is going to be
disabled in Debian 2.6.20 kernels for all architectures and has
already been removed for some architectures (powerpc, mipsel?).

The patch to fix this is included. It is not the cleanest possible
patch, but is based upon the work already found on the internet,
mainly here:

  http://www.jacco2.dds.nl/networking/freeswan-l2tp.html#L2TPconfigLinux

(Work by Jacco de Leeuw)

I have tested this and it seems to work properly.

-- Naked
Index: l2tpd-0.70-pre20031121/l2tpd.c
===================================================================
--- l2tpd-0.70-pre20031121.orig/l2tpd.c	2007-02-06 16:40:46.000000000 +0200
+++ l2tpd-0.70-pre20031121/l2tpd.c	2007-02-06 16:57:53.000000000 +0200
@@ -15,7 +15,9 @@
  *
  */
 
+#define _XOPEN_SOURCE
 #include <stdlib.h>
+#include <sys/types.h>
 #include <sys/utsname.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
@@ -274,8 +276,8 @@
 
 int start_pppd (struct call *c, struct ppp_opts *opts)
 {
-    char a, b;
-    char tty[80];
+    /* char a, b; */
+    char *tty;
     char *stropt[80];
     struct ppp_opts *p;
 #ifdef USE_KERNEL
@@ -324,29 +326,63 @@
     else
     {
 #endif
-        if ((c->fd = getPtyMaster (&a, &b)) < 0)
+	c->fd = open("/dev/ptmx", O_RDWR | O_NONBLOCK);
+	if (c->fd == -1)
+	{
+		log (LOG_WARN, "%s: unable to open /dev/ptmx to allocate pty\n",
+				__FUNCTION__);
+		return -EINVAL;
+	} else
+	{
+	    if (grantpt(c->fd))
+	    {
+		log (LOG_WARN, "%s: unable to grantpt() on pty\n",
+				__FUNCTION__);
+		close(c->fd);
+		return -EINVAL;
+	    }
+	    if (unlockpt(c->fd))
+	    {
+		log (LOG_WARN, "%s: unable to unlockpt() on pty\n",
+			__FUNCTION__);
+		close(c->fd);
+		return -EINVAL;
+	    }
+	    tty = ptsname(c->fd);
+	    if (tty == NULL)
+	    {
+		log (LOG_WARN, "%s: unable to obtain name of slave tty\n",
+			__FUNCTION__);
+		close(c->fd);
+		return -EINVAL;
+	    }
+	}
+ 
+ 
+ /*	if ((c->fd = getPtyMaster (&a, &b)) < 0)
         {
             log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n",
                  __FUNCTION__);
             return -EINVAL;
-        }
+        } */
 
         /* set fd opened above to not echo so we don't see read our own packets
            back of the file descriptor that we just wrote them to */
         tcgetattr (c->fd, &ptyconf);
         *(c->oldptyconf) = ptyconf;
         ptyconf.c_cflag &= ~(ICANON | ECHO);
-		ptyconf.c_lflag &= ~ECHO;
+               ptyconf.c_lflag &= ~ECHO;
         tcsetattr (c->fd, TCSANOW, &ptyconf);
 
-        snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b);
-        fd2 = open (tty, O_RDWR);
-		if(!fd2)
-			log(LOG_WARN, "unable to open tty %s", tty);
 
-		/* XXX JEF: CHECK ME */
-		stropt[pos++] = strdup(tty);
-		stropt[pos] = NULL;
+        /* snprintf (tty, sizeof (tty), "/dev/tty%c%c", a, b); */
+        fd2 = open (tty, O_RDWR);
+        if (fd2 == -1)
+        {
+                log (LOG_WARN, "%s: unable to open slave tty %s\n", __FUNCTION__, tty);
+                close(c->fd);
+                return -EINVAL;
+        }
 
 #ifdef USE_KERNEL
     }

--- End Message ---
--- Begin Message ---
Source: l2tpd
Source-Version: 0.70-pre20031121-2.2

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

l2tpd_0.70-pre20031121-2.2.diff.gz
  to pool/main/l/l2tpd/l2tpd_0.70-pre20031121-2.2.diff.gz
l2tpd_0.70-pre20031121-2.2.dsc
  to pool/main/l/l2tpd/l2tpd_0.70-pre20031121-2.2.dsc
l2tpd_0.70-pre20031121-2.2_i386.deb
  to pool/main/l/l2tpd/l2tpd_0.70-pre20031121-2.2_i386.deb



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 [EMAIL PROTECTED],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Ben Hutchings <[EMAIL PROTECTED]> (supplier of updated l2tpd 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 [EMAIL PROTECTED])


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

Format: 1.7
Date: Tue, 20 Feb 2007 06:20:44 +0000
Source: l2tpd
Binary: l2tpd
Architecture: source i386
Version: 0.70-pre20031121-2.2
Distribution: unstable
Urgency: low
Maintainer: Jean-Francois Dive <[EMAIL PROTECTED]>
Changed-By: Ben Hutchings <[EMAIL PROTECTED]>
Description: 
 l2tpd      - a layer 2 tunneling protocol implementation
Closes: 265732 276746 298716 300003 351870 395905 409944
Changes: 
 l2tpd (0.70-pre20031121-2.2) unstable; urgency=low
 .
   * Non-maintainer upload.
   * Applied upstream change to remove reliance on BSD pseudo-terminals
     (Closes: #276746, #409944).
   * Corrected AVP numbers for challenge-response and cause code
     (Closes: #265732).
   * Implemented alignment fix-up for AVPs (Closes: #351870).
   * Updated no-detach option to pppd (Closes: #298716).
   * Added dependency on ppp (Closes: #395905).
   * Updated copyright to mention newer web site and path to GPL text.
   * Improved package description (Closes: #300003).
Files: 
 e8f7a0a1bfc82e9c40334b2004caba78 593 net optional 
l2tpd_0.70-pre20031121-2.2.dsc
 46612527fce6b39bd16e3d8d057f394e 23130 net optional 
l2tpd_0.70-pre20031121-2.2.diff.gz
 cb7b35e5083491c5faa97a1a2757de21 92480 net optional 
l2tpd_0.70-pre20031121-2.2_i386.deb

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

iD8DBQFF2pVv79ZNCRIGYgcRAkN2AJ0cmTRF+0Az7cr3L9F3ZCpGig215gCfUzk6
HQdBkVgq+/ky8aTFuiBoN2o=
=N9Fx
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to