summaryrefslogtreecommitdiff
path: root/chat
Commit message (Collapse)AuthorAgeFilesLines
* chat: Fix loop condition to avoid possible 1-byte buffer overrunPaul Mackerras2023-03-181-1/+1
| | | | Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Fixing a few more memory leaks in chat.cRobert Bartel2023-03-171-2/+8
| | | | | | | | Running Valgrind memcheck tool on chat.c while communicating with a modem found additional memory leaks. These fixes plumb those. Signed-off-by: Robert Bartel <r.bartel@gmx.net> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Fixing buffer overflow issue in chat.cRobert Bartel2023-03-171-3/+5
| | | | | | | | | | | | There were two issues here, the report_buffer is too small to hold the value, and accessing the memory outside its bounds. The following fixes was made: - Expand the size of report_buffer to 4096 from 256, this is to account for handling of really long GSM USSD report strings - Make sure to not to access memory outside the bounds of the buffer Signed-off-by: Robert Bartel <r.bartel@gmx.net> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Fix several issues uncovered by Coverity (#397)Eivind Næss2023-03-171-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix for coverity issue 436265, we should cap copy to size of destination buffer Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fix for coverity issue 436262, llv6_ntoa() returns a pointer to a buffer that can be up to 64 bytes long; likely not a problem, but this will quiet coverity Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fix for coverity issue 436251, not freeing path in the normal flow of the code Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436258, Digest maybe uninitialized in some paths of this code Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fix for coverity issue 436254, forgot to free 's' before returning from the function? Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436251, memory leak in put_string() function Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue 436215, should copy at most sizeof(devname) bytes Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436203, if no authentication (or no accounting) server was found, we still need to free the allocated local instance Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436171, use of uninitialized variable Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Use of signed vs unsigned variable in printf for MD4Update Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436182, fixing possible buffer overrun in handling of PW_CLASS attribute Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Fixing coverity issue #436156 Signed-off-by: Eivind Næss <eivnaes@yahoo.com> * Compile errors Signed-off-by: Eivind Næss <eivnaes@yahoo.com> [paulus@ozlabs.org - Squashed to avoid breaking bisection] Signed-off-by: Eivind Næss <eivnaes@yahoo.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* chat: Improve signal handlingPaul Mackerras2022-11-261-48/+53
| | | | | | | | | | | | | | | | | | | | | | | This improves the way that signals are handled in chat. First, signal handlers should not be calling functions which are not async-signal-safe; doing so incurs the possibility of deadlock. Thus we can't call fatal() in signal handlers; instead we set 'fatalsig', which functions both as a flag and as an indication of which signal occurred, and check that at various points (basically after any operation which might block) using the new function checksigs(). Secondly, using sigaction rather than signal() means that we can control whether calls such as read() get restarted after a signal, and whether the signal disposition gets reset when the signal is delivered. That simplifies sigalrm(); we no longer need to re-register the handler, and we don't need the kludge of setting stdin to non-blocking mode in order to get the read() in get_char() to return. This also removes a #ifdef ultrix since ultrix is no longer supported. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Fixing GCC -Wunused-result warning in chat.c resolving comments from Paul ↵Eivind Næss2021-09-231-17/+27
| | | | | | Mackerras Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Remove obsolete Makefile(s) and configure scriptsEivind Næss2021-07-202-53/+0
| | | | Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Incorporating review feedback from David Seifert.Eivind Næss2021-07-201-6/+2
| | | | Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* Use autoconf/automake to configure and make pppEivind Næss2021-07-201-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change brings in autoconf/automake scripts to configure the ppp project. Current change doesn't eliminate the previous build system, but the new script autogen.sh will overwrite configure, and generate the basic Makefile.in and Makefile files. Features can now be enabled by command line: * Microsoft Extensions, - MSCHAP - MPPE - MS LAN Manager support * IPXCP protocol * CBCP protocol * PAM support * EAP-TLS support * EAP-SRP support * Max session lifetime by byte count * Plugins * Packet activity filter support * Multilink * IPv6 support Control linkage with * OpenSSL (-lssl -lcrypto) * systemd (-lsystemd) * libatm (-latm) * libsrp (-lsrp) * pam (-lpam) Also, the configure script is made sensitive to features of OpenSSL. Like the presence or absence of DES, SHA, MD4 and MD5 crypto support. In the cases where either of these are missing, the support will be directly compiled into pppd and plugins. In addition, package maintainers can now control the installation paths with standard --prefix=, or --localstatedir=, or --sysconfdir= to configure. On top of that, they can now control the following directories: * runtime directory w/--with-runtime-dir * logfile directory w/--with-logfile-dir * plugin directory w/--with-plugin-dir In the case where automake isn't the right solution, namely: SunOS kernel module build, the original Makefile infrastructure is preserved and reused. Care was taken to only cosmetically touchup the source files in this change. This means: * Insert HAVE_CONFIG_H and include config.h in all .c files. * Change HAS_SHADOW to HAVE_SHADOW_H * Change HAVE_LOGWTMP to HAVE_UTMP_H * Introduce HAVE_CRYPT_H into the source code where appropriate * Added ifdef MPPE where appropriate * USE_SRP required a few changes as it didn't compile * Touchup some compile warning in pppstats directory on SunOS Introduced a new pppdconf.h file that exports the appropriate defines to a module that wants to provide a module that pppd can dynamically load. This will define/undef features like MPPE, CHAPMS such that the project doesn't have to guess what features pppd is compiled with. Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
* chat: Clean up usage of clean() functionPaul Mackerras2021-07-191-12/+8
| | | | | | | | | | | | | | | | | | | | | In a couple of places, we were calling clean(), which does environment variable substitution among other things, but then using the original string not the "cleaned" string when logging a message about what we're doing. Also, this removes a couple of checks that the "cleaned" string is not longer than the original string, which date back to the first version of the code checked into CVS. Those checks were appropriate before environment variable substitution was added in commit eaca954c2d4a ("add -E option to use environment variables, from Andreas Arens") and dynamic reallocation of the result buffer was added in commit 86dd2eec100d ("clean(): Fix buffer overflow.") but are no longer necessary. These changes were prompted by github issue #294 and redhat bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1650539 Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Add pkgconfig support to PPP project (#270)Eivind Næss2021-04-241-1/+2
| | | | | | | | | | | | | | | | | | | This adds pppd.pc into $(INSTROOT)/$(LIBDIR)/pkgconfig. On some distributions this would be /lib/pkgconfig, or /usr/lib/pkgconfig, but other distributions may consider specifying --libdir=/usr/lib/x86_x64-linux-gnu/ and the pkgconfig directory would be under that. Allowing --libdir to be specified at configure time fixes #223, providing pkgconfig support fixes #19 and allows third party packages pickup the plugin directory. Manually cherry picking parts of two commits by @lkundrak from: https://github.com/NetworkManager/ppp/tree/lr/pkgconfig Mainly, the difference between the original commit is not to replace DESTDIR with "prefix". Leave DESTDIR alone, and add needed pkgconfig (pppd.pc.in) as a part of the linux distribution (previously in pppd/plugin directory). This fixes GitHub issues: #19 #47 and #223 Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
* Add cross-compilation support on LinuxPaul Mackerras2021-01-011-2/+3
| | | | | | | | | | | | | | | This adds three new command-line options to the configure script: --cross_compile=<prefix> (default "") --cc=<compiler> (default cc) --cflags=<compile flags> (default -g -O2 -pipe) These get propagated to the Makefiles in the subdirectories. The cross-compile prefix is prepended to the CC value, so for example if you do "./configure --cross_compile=powerpc64le-linux-" then everything gets compiled and linked using powerpc64le-linux-cc. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Do not strip installed binaries (#186)Samuel Thibault2020-12-311-1/+1
| | | | | | This should be done by the packaging system, to be able to separate out debugging symbols into separate packages. Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
* Convert to ANSI CPaul Mackerras2020-12-291-135/+70
| | | | | | | | | | | | | | | This gets rid of the __P and __V macros that were used so that the code was in theory compilable by a K&R C compiler, and converts the function definitions to ANSI C style. In fact there were already quite a few function definitions in the ANSI C style, so it would not have been compilable by a K&R C compiler in fact. The Solaris and BSD kernel code modules have had __P removed but the function definitions have not been converted. There are some other minor changes here to remove warnings. Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
* Various fixes for errors found by coverity static analysis (#109)Jaroslav Škarvada2019-05-061-0/+2
| | | | | Fixes #108 Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
* Honor LDFLAGSJaroslav Škarvada2018-05-281-1/+1
| | | | | | | | | | This makes the makefiles include $(LDFLAGS) as a parameter when linking executables. Distros use this as a way of applying linker flags across all the executables they build. [paulus@ozlabs.org - supplied the patch description] Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
* chat, pppd: Use \e instead of \\ in man pagesPaul Mackerras2013-06-101-33/+33
| | | | | | | | This avoids the need to double up the backslashes in some places, and eliminates some errors reported by doclifter. Reported-by: Eric S. Raymond <esr@thyrsus.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
* chat: Fix some text that was intended to be literalPaul Mackerras2013-06-091-1/+2
| | | | | | | | | This escapes a \c and adds a .br so that the "$ \c" comes out in the nroff output, instead of the \c being interpreted as a line continuation. This seems to be what was intended and makes sense as part of the chat script fragment. Signed-off-by: Paul Mackerras <paulus@samba.org>
* chat: Fix *roff errors in the man pagePaul Mackerras2013-02-031-6/+4
| | | | | | | | | | | | | Fixes these errors: $ nroff -man -ww chat/chat.8 chat/chat.8:227: warning: number register `"' not defined chat/chat.8:291: warning: macro `'' not defined chat/chat.8:368: warning: macro `PR' not defined Patch partly from Debian BTS by Bjarni Ingi Gislason. Signed-off-by: Paul Mackerras <paulus@samba.org>
* chat: Correct spelling errors in the man pagePaul Mackerras2013-02-031-4/+4
| | | | | | From Fedora patch. Signed-off-by: Paul Mackerras <paulus@samba.org>
* chat: Allow TIMEOUT value to come from environment variableAshok Rao2010-09-111-0/+1
| | | | | | | This allows the TIMEOUT value to be obtained from the environment using the $ENVVAR syntax. Signed-off-by: Paul Mackerras <paulus@samba.org>
* Remove various warnings, fix pppol2tp installPaul Mackerras2008-08-191-1/+1
| | | | | | | | | | This fixes a collection of minor things that were resulting in harmless warnings (accidental trigraphs, missing prototypes, signed/unsigned char being used interchangeably) and corrects an error in the pppol2tp makefile, which meant that it wasn't installing anything. Signed-off-by: Paul Mackerras <paulus@samba.org>
* Remove files that don't go into releasesPaul Mackerras2008-07-278-147/+0
| | | | | | | This mainly removes files specific to platforms that we no longer support, and removes a few other outdated files. Signed-off-by: Paul Mackerras <paulus@samba.org>
* Get the repository a bit closer to what will be releasedPaul Mackerras2008-07-272-3/+1
| | | | | | | * Remove .cvsignore files and create .gitignore files where needed * Add files that were in the last release but not in CVS Signed-off-by: Paul Mackerras <paulus@samba.org>
* Add $(INSTDIR) to installation paths in Linux makefiles.Paul Mackerras2006-06-041-2/+2
| | | | | | | | | | | | | | | | Patch from Robert Vogelgesang. This patch re-introduces the possibility for package maintainers to install into a different filesystem tree. This is done by adding $(INSTROOT) at various places; the package maintainers can then issue a make install INSTROOT=/some/where/else when they package pppd for their distribution. In previous versions of the ppp package this was possible using the variable DESTDIR, but this variable is now used for a different purpose and cannot be changed via additional parameters of the make command.
* Make MANDIR directory if not present.Paul Mackerras2006-05-221-2/+2
| | | | Patch from Robert Vogelgesang.
* Correctly escape or unescape hypens in the man pages.Paul Mackerras2004-11-131-31/+31
| | | | | Without this patch "-" is rendered as the endash in unicode consoles and then bad things happen. From Marco d'Itri.
* remove duplicate $(CDEFS)Paul Mackerras2004-11-031-2/+2
|
* Put man pages in /usr/share/man under Linux.Paul Mackerras2004-10-311-3/+3
|
* Add --prefix and --sysconfdir options to configure, and putPaul Mackerras2004-10-291-1/+5
| | | | | @DESTDIR@ and @SYSCONF@ tags in various Makefile.linux files. These tags get expanded by configure.
* Fixed compilation failure on Solaris due to new CHAP (missing chap-md5.oJames Carlson2004-01-171-31/+31
| | | | | | | | | | in makefile). Updated ppp_mod so that it will work with Solaris 10 and beyond (identify entry point is now obsolete). Fixed warnings in chat, bsd-comp, deflate, vjcompress, chap-new, sys-solaris, tty, pppdump, ppp_comp.
* Change some Makefile.linux files to use COPTS and CFLAGS the same wayPaul Mackerras2004-01-131-2/+3
| | | | that pppd/Makefile.linux does.
* clean(): Fix buffer overflow.Frank Cusack2003-03-041-43/+73
|
* styleFrank Cusack2003-02-261-4/+5
|
* Added ability to detect and use either gcc or Sun WorkShop C compilerJames Carlson2002-09-071-1/+1
| | | | | | | on Solaris. Added support for Solaris 10. Quieted down warning in ppp_comp.c due to bad preprocessor usage. Quieted WorkShop warnings in options.c (casting of void * to function) and pppd.h (constant too large). Tested in 32 and 64 bit modes with gcc and WorkShop.
* Enlarged the report buffer to 256 bytes.Russell Coker2002-01-111-2/+2
|
* Fixed some minor syntax errors.Russell Coker2002-01-111-5/+5
|
* 1) Created a subdirectory called 'solaris'. Currently it contains a replicaAdi Masputra2000-04-181-1/+1
| | | | | | | | | | | | of the 'svr4' directory. However, over time, files in this directory will contain the same code as the kernel-portion of pppd in future releases of Solaris, hence they most probably will change in contents and/or sub-structure. 2) Changed the 'configure' script to not create symbolic link Makefiles when the OS is SunOS 4.x. Under 'SunOS' category, only SunOS 5.x (or Solaris 2.x) is currently enabled. 3) Changed the rest of the utilities + pppd daemon Makefile.sol2 to point to the solaris/Makedefs instead of the one in svr4 directory.
* update from debian maintainerPaul Mackerras1999-12-231-2/+3
|
* add -E option to use environment variables, from Andreas ArensPaul Mackerras1999-09-062-12/+60
|
* Fix the rcsid's for non-ansi compilersPaul Mackerras1999-08-131-2/+5
|
* fix problem with REPORTing last linePaul Mackerras1999-08-132-19/+19
|
* use $(INSTALL) not installPaul Mackerras1999-08-121-3/+5
|
* get rid of warningPaul Mackerras1999-08-121-1/+1
|
* Add @filename syntax for the send stringPaul Mackerras1999-05-122-2/+54
|
* don't recurse in terminate()Paul Mackerras1999-03-311-1/+6
|
* moved libposix under NeXTPaul Mackerras1998-03-251-2/+2
|
* Kludge to handle solaris 2.6 having usleep; NeXT mods from Steve PerkinsPaul Mackerras1998-03-243-5/+16
|
* minor fixes, for SunOS and micro-getoptPaul Mackerras1998-02-042-10/+12
|
* include Makedefs filePaul Mackerras1998-02-043-13/+4
|