X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fmain.c;h=2141879090fc378c770119c08e03c41700ef3b20;hp=dbeaeac0ce400338301c9e9cd968541be41fc00b;hb=ef6f6d62459620b334457a58cb17e40f450814dc;hpb=bfa20ccde2a70b1252dbb614132f1a4cbee815d4 diff --git a/pppd/main.c b/pppd/main.c index dbeaeac..2141879 100644 --- a/pppd/main.c +++ b/pppd/main.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: main.c,v 1.51 1998/11/07 06:59:28 paulus Exp $"; +static char rcsid[] = "$Id: main.c,v 1.54 1999/03/02 05:36:42 paulus Exp $"; #endif #include @@ -827,8 +827,12 @@ close_tty() restore_tty(ttyfd); - if (tty_mode != (mode_t) -1) - chmod(devnam, tty_mode); + if (tty_mode != (mode_t) -1) { + if (fchmod(ttyfd, tty_mode) != 0) { + /* XXX if devnam is a symlink, this will change the link */ + chmod(devnam, tty_mode); + } + } close(ttyfd); ttyfd = -1; @@ -1374,10 +1378,12 @@ format_packet(p, len, printer, arg) } } - for (; len > 0; --len) { + for (i = 0; i < len && i < 32; ++i) { GETCHAR(x, p); printer(arg, " %.2x", x); } + if (i < len) + printer(arg, " ..."); } static void