tags 276746 +patch
Thankyou Mr Bug Control Robot.

Package: l2tpd
Version: 0.70-pre20031121-2
Followup-For: Bug #276746

I'm sure this has been done before, but l2tpd.org is absent,
and google didn't actually come up with any patches so I wrote
my own. I'm hoping this will prompt a new upload with this patch,
as I was unable to locate another L2TP LAC in Debian.

diff -u l2tpd-0.70-pre20031121/Makefile l2tpd-0.70-pre20031121/Makefile
--- l2tpd-0.70-pre20031121/Makefile
+++ l2tpd-0.70-pre20031121/Makefile
@@ -33,8 +33,9 @@
 #
 # Uncomment the next line for Linux
 #
-OSFLAGS= -DLINUX 
+#OSFLAGS= -DLINUX 
 #OSFLAGS= -DLINUX -I/usr/include
+OSFLAGS= -DLINUX -DUNIX98PTYS -D_GNU_SOURCE
 #
 # Uncomment the following to use the kernel interface under Linux
 #
diff -u l2tpd-0.70-pre20031121/l2tpd.c l2tpd-0.70-pre20031121/l2tpd.c
--- l2tpd-0.70-pre20031121/l2tpd.c
+++ l2tpd-0.70-pre20031121/l2tpd.c
@@ -274,7 +274,9 @@
 
 int start_pppd (struct call *c, struct ppp_opts *opts)
 {
+#ifndef UNIX98PTYS
     char a, b;
+#endif
     char tty[80];
     char *stropt[80];
     struct ppp_opts *p;
@@ -324,6 +326,30 @@
     else
     {
 #endif
+#ifdef UNIX98PTYS
+/*             if ((c->fd = posix_openpt(O_RDRW|O_NOCTTY)) <0)*/
+               if ((c->fd = getpt()) <0)
+               {
+                       logput(LOG_WARN, "%s: unable to allocate pty: '%s', 
abandoning!\n",
+                                       __FUNCTION__, strerror(errno));
+                       return -EINVAL;
+               }
+               grantpt(c->fd);
+               unlockpt(c->fd);
+        tcgetattr (c->fd, &ptyconf);
+        *(c->oldptyconf) = ptyconf;
+        ptyconf.c_cflag &= ~(ICANON | ECHO);
+               ptyconf.c_lflag &= ~ECHO;
+        tcsetattr (c->fd, TCSANOW, &ptyconf);
+               snprintf (tty, sizeof (tty), "%s", ptsname(c->fd));
+        fd2 = open (tty, O_RDWR);
+               if(!fd2)
+                       logput(LOG_WARN, "unable to open tty %s", tty);
+
+               /* XXX JEF: CHECK ME: This should be safe, we just snprintf'd 
it. */
+               stropt[pos++] = strdup(tty);
+               stropt[pos] = NULL;
+#else
         if ((c->fd = getPtyMaster (&a, &b)) < 0)
         {
             log (LOG_WARN, "%s: unable to allocate pty, abandoning!\n",
@@ -347,7 +373,7 @@
                /* XXX JEF: CHECK ME */
                stropt[pos++] = strdup(tty);
                stropt[pos] = NULL;
-
+#endif /* UNIX98PTY */
 #ifdef USE_KERNEL
     }
 #endif

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.10
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)

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

-- no debconf information

-- 
Paul "TBBle" Hampson, [EMAIL PROTECTED]
7th year CompSci/Asian Studies student, ANU

Shorter .sig for a more eco-friendly paperless office.

Attachment: signature.asc
Description: Digital signature

Reply via email to