summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow multiple (comma seperated) devices on the "set device" line.brian1997-12-211-6/+4
| | | | Submitted by: Derek Inksetter <derek@saidev.com>
* Reset our "ifaddr" to zero if the "set ifaddr" fails inbrian1997-12-191-2/+4
| | | | | -auto mode. This makes ppp correctly exit if you kick it off twice in auto mode with the same label (read: interface).
* Replacebrian1997-12-181-2/+3
| | | | | | | | | | | | | strcpy(a, b); /* a and b are the same size */ with strncpy(a, b, sizeof(a)); a[sizeof(a)-1] = '\0'; Making the code `correct at a glance'. Suggested by: Theo de Raadt <deraadt@cvs.openbsd.org>
* Don't log the actual password when command-loggingbrian1997-12-181-1/+8
| | | | "passwd xxxx".
* o Log ******** instead of the actual password for "set authkey"brian1997-12-171-12/+28
| | | | | | | | | | | | when command logging is switched on. o Display ******** for the authkey for "show auth" o Document how \P should be used, and document the other chat escapes while I'm there. o Make sure the full command is displayed when a compound command fails - ie, "set novar rubbish" should say "set novar: Invalid command" rather than "novar: Invalid command" Problem pointed out by: Theo de Raadt <deraadt@cvs.openbsd.org> (among others)
* Fix a potential overflow where, if the label passed on the commandbrian1997-12-171-2/+3
| | | | | | | | line is > LINE_LEN (512 bytes), we scribble (*blush*). Hinted at by: Theo de Raadt <deraadt@cvs.openbsd.org> Change sprintf(buf, "fixedstring") to strcpy(buf, "fixedstring").
* Use LogWARN for command usage messages and unrecognisedbrian1997-12-151-2/+2
| | | | commands, not LogCOMMAND.
* Allow random IP number allocation to peer.brian1997-12-131-13/+25
| | | | | | | | | | | | | | | | | | | | Validate the peers suggested IP by attempting to make a routing table entry. Give up IPCP negotiation if the peer NAKs us with an unusable IP. Always SIOCDIFADDR then SIOCAIFADDR when configuring the tun device. Using SIOCSIFDSTADDR allows duplicate dst addresses (which we don't want)!!! Allow up to 200 interface names (was 50) (now that ppp can play server properly). Up the version number (1.5 -> 1.6). Cosmetic: Log unexpected CCP packets in the CCP log rather than the ERROR log. Log unexpected Config Reqs in the appropriate LCP/IPCP/CCP log rather than the ERROR log. Log failed route additions and deletions with WARN, not TCPIP. Log the option id and length for unrecognised IPCP options. Change some .Sq to .Ar in the man page.
* Correct usage of `add' and `delete'.brian1997-12-081-2/+2
|
* Only allow one arg to `delete' - the mask & gateway aren't necessary.brian1997-12-071-32/+36
| | | | | | | | | | | | | | Delete AF_LINK routes as well as AF_INET. Allow the word `default' as the arg to `delete' or in place of the first two args (dest & netmask) to `add'. Accept INTERFACE as the third arg to `add'. You can now say `add default interface' to create a default route through the tun interface. It's reported that subsequent bind()s will bind to a broadcast address and not to the address currently assigned to the tun device - this is the first step towards supporting that first connection that was around from before the dynamic IP negotiation....
* Fix the help command (broken when I re-prototypedbrian1997-11-231-20/+33
| | | | all the commands).
* Fix prototypes.brian1997-11-221-261/+286
| | | | | | | | | | | | | | Remove extraneous decls. Add ``const'' to several places. Allow ``make NOALIAS=1'' to remove IP aliasing. Merge with OpenBSD - only the Makefiles vary. We can now survive a compile with -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Winline -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Wchar-subscripts (although the Makefile just contains -Wall).
* Allow zero args to "cvs log".brian1997-11-181-2/+2
|
* Add and use a DropClient() function for closing the diagnostic port.brian1997-11-181-22/+7
| | | | Call DropClient() from Cleanup() too.
* Fix command logging (broken with the "allow" command).brian1997-11-131-8/+24
|
* Return correct value from "set loopback".brian1997-11-121-3/+7
| | | | | | Output "set ?filter deny host|port" rules correctly with show ?filter. Submitted by: Dave Bodenstab <imdave@mcs.net>
* Don't attempt to dial if "dial label" has specifiedbrian1997-11-121-3/+3
| | | | a restricted label.
* Don't warn that we're waiting for the command to complete ifbrian1997-11-121-3/+2
| | | | we've put it in the background (!bg).
* Finish the security improvements:brian1997-11-111-49/+85
| | | | | | | | | | | | | | | | | | | o Add "allow" command: "allow users a b c" gives access to users a, b and c. "allow modes auto" gives those users access to auto mode only. "allow users *" and "allow modes *" are accepted. No users and all modes are allowed by default. UID 0 can do anything. o Set the current label with the "load" and "dial" commands so that the call to ppp.linkdown makes sense. o Up the verison number. o Don't OR MODE_AUTO for -background and -ddial. o Don't OR MODE_INTER when we get a diagnostic connection. o Allow up to 40 args per line (was 20). o "set ifaddr" only changes the interface in AUTO mode (with other modes, it happens after IPCP negotiation). o Sort command descriptions in the man page. o Support -dedicated mode where we just talk ppp forever (no login etc).
* Don't Cleanup() in background mode whenbrian1997-11-091-3/+1
| | | | | we get a "close", the LcpClose() will eventually do it when we get to PHASE_DEAD.
* Initialize VarAltPhone.brian1997-11-091-1/+2
| | | | PR: 4993
* Don't create a diagnostic socket by default.brian1997-11-091-23/+65
| | | | | | Allow a password spec on the "set server" command line. Use SIGUSR2 to close the diagnostic socket. Some man page corrections.
* Don't ask for a password if it's specified as empty.brian1997-11-091-2/+3
|
* Add the "!include" syntax.brian1997-11-091-39/+34
| | | | Return 0 from "show" commands.
* Introduce ID0 logging.brian1997-11-091-13/+2
| | | | | | | | Stay as the invoking uid as much as possible. Execution as a normal user is still forbidden for now, so these changes are pretty ineffective. The next commit will implement the modifications suggested on -hackers a number of days ago.
* Don't pass global vars as args.brian1997-11-081-3/+3
| | | | Remove local/global conflicts.
* Introduce [local] to "set log [local] ...". This spitsbrian1997-11-041-12/+32
| | | | | logging out to the screen in terminal mode - should be good for installation problem diagnosis.
* Cosmetic:brian1997-10-261-1/+2
| | | | Move prototypes into the correct headers.
* Cosmetic (no functional changes):brian1997-10-261-69/+45
| | | | | | | | | | | | | | | o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes
* sleep => nointr_sleepbrian1997-10-241-2/+2
| | | | | | usleep => nointr_usleep (not just a #define) Already done by: ache
* Cosmetic: Mention that ppp is suspending beforebrian1997-10-121-2/+7
| | | | executing a "shell" command.
* Allow Microsoft CHAP authentication.brian1997-09-251-4/+10
| | | | | This is a combination of MD4 & DES. Submitted by: Gabor Kincses <gabor@acm.org>
* Correct the way the uucp lock file and the ttyXX.if lockbrian1997-09-221-17/+11
| | | | | | | file get created. We don't create lock files over non-tty connections, but we *do* create lock files in -direct mode. This leaves us capable of adding utmp/wtmp support for successful pap & chap logins (coming soon).
* Typo policebrian1997-09-211-3/+3
| | | | Submitted by: Mark Cammidge <mark@gmtunx.ee.uct.ac.za>
* Support CHAP using MD4brian1997-09-171-2/+9
| | | | Suggested by: jordan
* o Fix two unlikely descriptor leaks.brian1997-09-161-6/+4
| | | | | | | | | o Output the correct device for "show modem" while in -direct mode. o Cosmetic: Moan a bit more when we can't open the [modem] device. o Call OpenModem() in a more "natural" way. o Add some LogDEBUG in OpenModem().
* Allow dial to work in non-interactive mode.brian1997-09-091-3/+1
|
* Print errors correctly (don't adjustbrian1997-09-091-2/+2
| | | | argc/argv for commands).
* Don't start an interactive shell from abrian1997-09-091-1/+5
| | | | telnet prompt.
* Install as group ``network''brian1997-09-041-5/+5
| | | | | | | | | | | Insist that uid == 0 for client ppp Disallow client sockets if no password is specified Don't exit on failure to open client socket for listening Allow specification of null local password Use reasonable size (smaller) ``vector''s in auth.c Fix "passwd ..." usage message Insist on "all" as arg to "quit" (if any) Drop client socket connection before Cleanup() when "quit all"
* Cosmetic: Make LogPrintf() calls consistent.brian1997-08-311-2/+2
|
* Make the code format more in line with style(9).brian1997-08-251-601/+512
| | | | | Update loadalias to use the new libalias api. Update to version 1.1.
* Allow the use of HISADDR & MYADDR in ppp.conf.brian1997-08-211-1/+5
|
* Add "set loopback on|off", defaulting to "on".brian1997-08-211-1/+25
| | | | | | | | | This tells ppp to loopback packets addressed to the ppp interface IP coming *from* the tun device. This means that you can ping the tun interface IP from inside :-)
* Correct online usage message for "set ? stopped"brian1997-08-211-2/+2
|
* Expand the "set stopped" command so that it canbrian1997-08-201-6/+33
| | | | | | | | idependently time out any of the FSMs. Split LCP logging into LCP, IPCP and CCP logging, and make room in "struct fsm" for the log level that the state machine should use.
* Correct the forth arg to "set ifaddr". If specified,brian1997-08-191-7/+8
| | | | | it gives the IP number that should be used for initial IPCP config requests, irrespective of MYADDR.
* Introduce the "bg" command. It's prettybrian1997-08-181-12/+40
| | | | | much the same as "shell", but it's in the background.
* Allow the use of a "stopped" timeout via thebrian1997-08-171-1/+29
| | | | | | | | | | | "set stopped" directive. If the timeout occurs it will cause a "Down" event, hanging up the line if it's still up. This *isn't* part of the FSM diagram, but I consider it ok as a "higher level implementation specific timeout" as specified in the rfc ;-} Discussed briefly with: joerg
* Allow a "hangup" capability.brian1997-07-141-1/+8
| | | | | | You can now "ATZ" your modem when it's closed. Submitted by: peter@citylink.dinoex.sub.org (Peter Much)
OpenPOWER on IntegriCloud