mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-15 23:50:44 +00:00
f9c4cd9156
to connect to a remote NT server, making it behave as if it were on the same LAN.
44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
RCS file: /home/jdp/f5/pptp/cvs/pptp/pptp.c,v
|
|
retrieving revision 1.1.1.1
|
|
retrieving revision 1.3
|
|
diff -u -r1.1.1.1 -r1.3
|
|
--- pptp.c 1999/04/28 19:36:57 1.1.1.1
|
|
+++ pptp.c 1999/04/29 17:05:59 1.3
|
|
@@ -18,6 +18,7 @@
|
|
#include <signal.h>
|
|
#include <setjmp.h>
|
|
#include <errno.h>
|
|
+#include <fcntl.h>
|
|
#include <sys/wait.h>
|
|
#include "pptp_callmgr.h"
|
|
#include "pptp_gre.h"
|
|
@@ -235,13 +236,23 @@
|
|
void launch_pppd(char *ttydev, int argc, char **argv) {
|
|
char *new_argv[argc+4]; /* XXX if not using GCC, hard code a limit here. */
|
|
int i;
|
|
+ int newi = 0;
|
|
|
|
- new_argv[0] = PPPD_BINARY;
|
|
- new_argv[1] = ttydev;
|
|
- new_argv[2] = "38400";
|
|
+ new_argv[newi++] = PPPD_BINARY;
|
|
+#ifdef USER_PPP
|
|
+ new_argv[newi++] = "-direct";
|
|
+ if ((i = open(ttydev, O_RDWR)) == -1)
|
|
+ fatal("Cannot open %s: %s", ttydev, strerror(errno));
|
|
+ if (dup2(i, 0) == -1)
|
|
+ fatal("dup2 failed: %s", strerror(errno));
|
|
+ close(i);
|
|
+#else
|
|
+ new_argv[newi++] = ttydev;
|
|
+ new_argv[newi++] = "38400";
|
|
+#endif
|
|
for (i=0; i<argc; i++)
|
|
- new_argv[i+3] = argv[i];
|
|
- new_argv[i+3] = NULL;
|
|
+ new_argv[newi++] = argv[i];
|
|
+ new_argv[newi] = NULL;
|
|
execvp(new_argv[0], new_argv);
|
|
}
|
|
|