aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/ppp/exec.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-231-2/+0
| | | | | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/ Similar commit in main: (cherry picked from commit b3e7694832e8)
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-07-251-1/+1
| | | | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix (cherry picked from commit 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-271-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* When ``ppp -direct'' is invoked by a program that uses pipe(2) toBrian Somers2009-08-241-123/+299
| | | | | | | | | | | | | | | | create stdin and stdout, don't blindly try to use stdin as a bi-directional channel. Instead, detect the pipe and set up a special exec handler that indirects write() calls through stdout. This fixes the problem where ``set device "!ssh -e none host ppp -direct label"'' no longer works with an openssh-5.2 server side as that version of openssh ignores the USE_PIPES config setting and *always* uses pipes (rather than socketpair) for stdin/stdout channels. MFC after: 3 days Notes: svn path=/head/; revision=196514
* Make ppp WARNS=5 cleanBrian Somers2004-09-051-1/+2
| | | | Notes: svn path=/head/; revision=134789
* o Clean up some #includesBrian Somers2002-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | o Bump version number to 3.0.4 o When talking to a RADIUS server, provide a NAS-Port-Type. When the NAS-Port-Type is Ethernet, provide a NAS-Port value equal to the SESSIONID from the environment in direct mode or the NGM_PPPOE_SESSIONID message in other modes. If no SESSIONID is found, default to the interface index in client mode or zero in server mode. When the NAS-Port-Type is ISDN, set the NAS-Port to the minor number of the physical device (ie, the N in /dev/i4brbchN). This makes it easier for the RADIUS server to identify the client WRT accounting data etc. Prompted by: lsz8425 <lsz8425@mail.cd.hn.cn> Notes: svn path=/head/; revision=96582
* Merge the NETGRAPH branch into HEAD. tty devices now use netgraph's lineBrian Somers2002-03-301-0/+1
| | | | | | | | | | | discipline to do the async escaping, but no other benefits are available yet. Change ``ifdef HAVE_DES'' to ``ifndef NODES'' for consistency. Make the Makefile a little more sane WRT RELEASE_CRUNCH. Notes: svn path=/head/; revision=93418
* Handle hardware-imposed MTU/MRU limitations. PPPoE will no longerBrian Somers2001-06-181-0/+1
| | | | | | | | | | | | | | | allow MRU/MTU negotiations to exceed 1492. Add an optional ``max'' specifier to ``set m[rt]u'', ie. set mtu max 1480 Bump the ppp version number. Sponsored by: Monzoon Networks AG and FreeBSD Services Limited Notes: svn path=/head/; revision=78410
* Make -DNOSUID (or -DPPP_NOSUID) possible to build ppp without SUIDBrian Somers2000-08-181-0/+2
| | | | | | | capabilities. Notes: svn path=/head/; revision=64802
* Correct PPPoE in multi-link modeBrian Somers2000-06-221-1/+1
| | | | | | | Submitted by: jason@OpenBSD.org Notes: svn path=/head/; revision=61973
* Remove an unused variableBrian Somers2000-05-261-1/+1
| | | | Notes: svn path=/head/; revision=60946
* Honour ``set speed sync'' and ``set device !program'' whenBrian Somers2000-05-241-13/+32
| | | | | | | | | | | | used together by creating a SOCK_DGRAM socketpair() between the processes. Be polite when closing !program links and send a HUP to the process. This makes ssh tunnels over unreliable media (such as via httptunnel) reconnect properly. Notes: svn path=/head/; revision=60864
* Do some vfork() trickery so that the parent can determineBrian Somers2000-03-221-7/+37
| | | | | | | | | | | | | | | | | | if the childs exec() has succeeded or failed by taking advantage of the fact that both processes share the same memory. FWIW: I tried to implement this by doing a pipe(), setting the write desciptors close-on-exec flag in the child and writing errno to the descriptor if the exec() fails. The parent can then ``if (read()) got errno else exec worked''. This didn't work though - the child could write() to fd[1] on exec failure, but the parent got 0 trying to read() from fd[0] ! Is this a bug in execve() ? Notes: svn path=/head/; revision=58454
* Correct some typos introduced in the descriptor -> fdescriptor change.Brian Somers2000-03-141-1/+1
| | | | Notes: svn path=/head/; revision=58038
* To avoid namespace polution in NetBSD:Brian Somers2000-03-141-1/+1
| | | | | | | ``struct descriptor'' -> ``struct fdescriptor'' Notes: svn path=/head/; revision=58028
* Add a few missing #includesBrian Somers1999-12-301-0/+1
| | | | Notes: svn path=/head/; revision=55253
* Correct usages of getuid() and geteuid()Brian Somers1999-12-301-1/+1
| | | | | | | Pointed out by: billf Notes: svn path=/head/; revision=55252
* Don't allowt '#' as a comment when it's embedded in quotes:Brian Somers1999-12-271-1/+2
| | | | | | | | | | | set something "xxx yyy # zzz" aaa shouldn't be interpreted as set something "xxx yyy" aaa Notes: svn path=/head/; revision=55145
* Don't munge ``set dial|login|logout|hangup'' arguments beforeBrian Somers1999-12-221-1/+1
| | | | | | | ExpandString() has a chance to do its own substitutions. Notes: svn path=/head/; revision=55013
* Notice and warn about unterminated quoted strings in commands.Brian Somers1999-12-201-3/+8
| | | | | | | The entire command is ignored if the syntax is invalid... Notes: svn path=/head/; revision=54914
* Change ``set cd'' so that its default value is device specific. TheBrian Somers1999-11-261-0/+3
| | | | | | | | default is still 1 second for ttys, but is now 6 seconds for i4b (ISDN) devices and 5 seconds for ethernet (PPPoE) devices. Notes: svn path=/head/; revision=53733
* Support PPPoEBrian Somers1999-11-061-1/+4
| | | | | | | | Help (lots) from: julian, archie Facilities from: ahebert@pubnix.net Notes: svn path=/head/; revision=52942
* Back out the bogus #ifdef __NetBSD__ #include <signal.h> lines.Brian Somers1999-09-211-3/+0
| | | | | | | | | | The original report was due to a mis-installation of the NetBS header files :-/ Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51517
* NetBSD has moved ``extern int errno;'' to signal.h :-/Brian Somers1999-09-201-0/+3
| | | | | | | Submitted by: Kazuyoshi Kato <kazk@yyy.or.jp> Notes: svn path=/head/; revision=51449
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50479
* Set the close-on-exec flag for all unused descriptors whenBrian Somers1999-08-171-5/+7
| | | | | | | exec()ing other programs. Notes: svn path=/head/; revision=49976
* Add ISDN support via isdnd & i4b. This requires versionBrian Somers1999-08-061-16/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 0.81.1 of the i4b code - namely support of the I4B_VR_REQ ioctl via the i4brbchX device. Ppp controls the phone number, but idle timers and SYNC/RAW decisions are still made by isdnd (in isdnd.rc). This involves a new datalink state machine phase. The ``wait for carrier'' phase happens after dialing but before logging in. The whole dial state should really be abstracted so that each device type can deal with it in its own way (thinking about PPPoE) - but that'll have to wait. The ``set cd'' symantics remain the same for tty devices, but we now delay until we either get CD or timeout waiting (at which time we drop the link if we require CD). For i4b devices we always insist on carrier. Thanks to hm@ for his help, and especially for pointing out that I *don't* need to re-implement isdnd (that was a huge waste of time !) :-] Notes: svn path=/head/; revision=49472
* Use the correct pid when substituting PROCESSID.Brian Somers1999-06-091-3/+4
| | | | | | | Problem reported by: Amedeo Beck Peccoz <gea@gressoney.it> Notes: svn path=/head/; revision=47849
* Correct the way ppp transfers links on the server side in MPBrian Somers1999-06-051-1/+3
| | | | | | | | | | | | mode by padding out the ``struct device'' to the maximum device size. Bump the ppp version number to indicate the transfer format change. This should make MP over tty and udp devices functional again. Notes: svn path=/head/; revision=47769
* Increase the length of an individual device name to LINE_LEN.Brian Somers1999-06-011-1/+2
| | | | | | | | Adjust the base physical device name correctly after a link transfer (allowing correct multilink callbacks). Notes: svn path=/head/; revision=47682
* Correct the ``ignoring sync/async'' warnings so that they showBrian Somers1999-05-241-3/+5
| | | | | | | | | up with the correct device type. Reassign the correct tcpdevice or execdevice after transfering a link in MP server mode. Notes: svn path=/head/; revision=47461
* Allow ``host:port/udp'' devices and support ``host:port/tcp'' asBrian Somers1999-05-121-20/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | being the same as the previous (still supported) ``host:port'' syntax for tcp socket devices. A udp device uses synchronous ppp rather than async, and avoids the double-retransmit overhead that comes with ppp over tcp (it's usually a bad idea to transport IP over a reliable transport that itself is using an unreliable transport). PPP over UDP provides througput of ** 1.5Mb per second ** with all compression disabled, maxing out a PPro/200 when running ppp twice, back-to-back. This proves that PPPoE is plausable in userland.... This change adds a few more handler functions to struct device and allows derivations of struct device (which may contain their own data etc) to pass themselves through the unix domain socket for MP. ** At last **, struct physical has lost all the tty crud ! iov2physical() is now smart enough to restore the correct stack of layers so that MP servers will work again. The version number has bumped as our MP link transfer contents have changed (they now may contain a `struct device'). Don't extract the protocol twice in MP mode (resulting in protocol rejects for every MP packet). This was broken with my original layering changes. Add ``Physical'' and ``Sync'' log levels for logging the relevent raw packets and add protocol-tracking LogDEBUG stuff in various LayerPush & LayerPull functions. Assign our physical device name for incoming tcp connections by calling getpeername(). Assign our physical device name for incoming udp connections from the address retrieved by the first recvfrom(). Notes: svn path=/head/; revision=47061
* o Redesign the layering mechanism and make the aliasing code part ofBrian Somers1999-05-081-0/+160
the layering. We now ``stack'' layers as soon as we open the device (when we figure out what we're dealing with). A static set of `dispatch' routines are also declared for dealing with incoming packets after they've been `pulled' up through the stacked layers. Physical devices are now assigned handlers based on the device type when they're opened. For the moment there are three device types; ttys, execs and tcps. o Increment version number to 2.2 o Make an entry in [uw]tmp for non-tty -direct invocations (after pap/chap authentication). o Make throughput counters quad_t's o Account for the absolute number of mbuf malloc()s and free()s in ``show mem''. o ``show modem'' becomes ``show physical''. Notes: svn path=/head/; revision=46686