From: Paul Mackerras Date: Sat, 13 Nov 2004 12:07:29 +0000 (+0000) Subject: Exit with an error if both demand and notty are given. X-Git-Tag: ppp-2.4.7~178 X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=b1eca80e96acb988380b74d5a2f2afcb284d52fd Exit with an error if both demand and notty are given. Don't require a connect script with demand if we are using the pty or socket options. Enforce the connect_delay if we are using the socket option. --- diff --git a/pppd/tty.c b/pppd/tty.c index 85a8032..a911fde 100644 --- a/pppd/tty.c +++ b/pppd/tty.c @@ -68,7 +68,7 @@ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define RCSID "$Id: tty.c,v 1.21 2004/11/13 12:05:48 paulus Exp $" +#define RCSID "$Id: tty.c,v 1.22 2004/11/13 12:07:29 paulus Exp $" #include #include @@ -445,7 +445,12 @@ tty_check_options() struct stat statbuf; int fdflags; - if (demand && connect_script == 0) { + if (demand && notty) { + option_error("demand-dialling is incompatible with notty"); + exit(EXIT_OPTION_ERROR); + } + if (demand && connect_script == 0 && ptycommand == NULL + && pty_socket == NULL) { option_error("connect script is required for demand-dialling\n"); exit(EXIT_OPTION_ERROR); } @@ -740,7 +745,7 @@ int connect_tty() * time for something from the peer. This can avoid bouncing * our packets off his tty before he has it set up. */ - if (connector != NULL || ptycommand != NULL) + if (connector != NULL || ptycommand != NULL || pty_socket != NULL) listen_time = connect_delay; return ttyfd;