1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-11 23:43:19 +00:00

687 Commits

Author SHA1 Message Date
Nick Briggs
2828555194 Merge branch 'no-DOS' of github.com:Interlisp/maiko into no-DOS 2021-04-12 12:08:10 -07:00
Nick Briggs
ea6f46bf42 Fix dependencies for ether.o 2021-04-08 17:05:51 -07:00
Nick Briggs
aacd8a9335 Fix comment on removed #endif 2021-04-08 17:05:51 -07:00
Nick Briggs
2c03560e7d Remove DOS specific assembler files for startup and display setup 2021-04-08 17:05:51 -07:00
Nick Briggs
74828c9829 Remove a few leftover defined(DOS) that remained in logical expressions, update endif comments 2021-04-08 17:05:51 -07:00
Nick Briggs
f75adf79d3 Remove DOS makefile 2021-04-08 17:05:51 -07:00
Nick Briggs
de42faba72 Remove source and include files that are only used for DOS
... and remove references to them from CMakeList.txt and makefile-tail
2021-04-08 17:05:51 -07:00
Nick Briggs
52ceef026e Start by removing all the ifdef'd DOS code in source and include files 2021-04-08 17:05:51 -07:00
Nick Briggs
a5410ef93d
Cleanup USE_DPLI usage (#378)
Until now, the only differentiation between using DLPI and using NIT for
the ethernet interface was expressed as a function of USE_DLPI.

This commit makes explicit when code is for the DLPI interface or the NIT
interface, with USE_DLPI and USE_NIT.  This is setup for using the BPF
interface to the ethernet as an alternative.
2021-04-07 20:51:28 -07:00
Abe Jellinek
5ce292ed32
Command line: fix potential buffer overruns in argument/env variable handling (#375)
* Fix buffer overrun vulnerability: use strncpy

read_Xoption uses a char buffer defined in main.c with length
MAXPATHLEN, aka PATH_MAX in POSIX. Unfortunately it was using strcpy to
copy from the command-line arguments (via argv) and the environment (via
getenv) without any bounds checking whatsoever. This could very easily
cause an overflow.

It's unlikely that a user will want to provide a path longer than
PATH_MAX-1 (a generous 1023 bytes on my machine). If they try, we should
stop them from causing any damage.

* Use strlcpy instead of strncpy

Thanks to Nick Briggs for the suggestion. It would be best to use
sizeof(sysout_name) instead of hardcoding a reference to the PATH_MAX
constant, but unfortunately sysout_name is an extern in xrdopt.c and so
the compiler doesn't know its size. I don't want to mess with that
coupling in this commit, because I assume there was a reason for doing
it that way rather than putting sysout_name in a header; I'll keep the
scope of the changes here small.

* Revert "Use strlcpy instead of strncpy"

Ah. This is not great. Turns out strlcpy is a nonstandard BSD extension
with its own set of problems
[https://en.wikibooks.org/wiki/C_Programming/C_Reference/nonstandard/strlcpy]
that we may be best served by avoiding. On Linux, it's only accessible
through libbsd, and we have no other reason (as far as I can tell) to
require that. Unless we want to provide our own strlcpy implementation,
we should stick with strncpy. It's far safer than what was there before
and doesn't present any edge cases in this scenario that are apparent to
me.
2021-04-05 14:43:37 -07:00
Nick Briggs
85d9104b56 Fix dependencies for ether.o 2021-03-29 16:21:17 -07:00
Nick Briggs
1be29b57d6 Fix comment on removed #endif 2021-03-29 15:34:28 -07:00
Nick Briggs
d8a615eff9 Remove DOS specific assembler files for startup and display setup 2021-03-29 15:17:59 -07:00
Nick Briggs
b10c48af8e Remove a few leftover defined(DOS) that remained in logical expressions, update endif comments 2021-03-29 15:17:59 -07:00
Nick Briggs
fde861edc7 Remove DOS makefile 2021-03-29 15:16:01 -07:00
Nick Briggs
9cd78c3228 Remove source and include files that are only used for DOS
... and remove references to them from CMakeList.txt and makefile-tail
2021-03-29 15:16:01 -07:00
Nick Briggs
1b869932d8 Start by removing all the ifdef'd DOS code in source and include files 2021-03-29 15:12:45 -07:00
Nick Briggs
081e2288ff
Enable X mouse buttons 6 and 7 for horizontal scrolling. (#367) 2021-03-29 14:03:14 -07:00
Nick Briggs
c4873d0ff8
Improvements to package/atom access in the sysout from maiko C code (#372)
* Display atom name in error message if get_package_atom() fails

* Various fixes to package/atom handling in testtool.c

Remove S_TOPVAL and S_MAKEATOM which only existed to deal with an old issue
with dbx where you supposedly couldn't enter a string with "\" in it.

Remove countchar(), which is functionally identical to  strlen(), and adjust
code that used it.

Adjust return type of MAKEATOM() to be the LispPTR that it should be, instead of int.

Limit find_package_from_name() to examining only the number of entries that are
present in the *PACKAGE-FROM-INDEX* array, instead of walking off the end.

MakeAtom68k() now drops into uraid() if asked to look up an atom that does not exist
(Make... is a misnomer, it will never *make* the atom, only lookup an existing
one)
2021-03-29 14:01:10 -07:00
Nick Briggs
01a8948a7d
Rename _curXXX structures to curXXX to avoid leading underscore (#376) 2021-03-29 12:34:32 -07:00
Nick Briggs
36ccd9a5f5
warning: macro argument should be enclosed in parentheses [bugprone-macro-parentheses] (#374)
Except where the expansion would be syntactically invalid,
for example "goto macroarg;" detection of which is a bug in clang-tidy,
so warn it off with a NOLINT...(bugprone-macro-parentheses)
2021-03-20 16:31:23 -07:00
Larry Masinter
f6da80f8b3
add makefile-init-linux.x86_64 (#373) 2021-03-18 15:45:02 -07:00
Nick Briggs
be4d4c771e
Fix printf format warnings in testtool.c (#369)
Conversion of PC output from octal to hexadecimal will be handled separately as there are multiple places that this change needs to take place.
2021-03-18 15:40:02 -07:00
Nick Briggs
d025ff0101
Add makefile fragment for INIT processing for macOS on x86_64 (#371) 2021-03-15 20:52:45 -07:00
Larry Masinter
22ae23552c
Update README.md for simplified Mac instructions (#370)
* Update README.md

* update (new M1)
2021-03-03 17:17:04 -08:00
Nick Briggs
082bd15542
Add makefile fragment for armv7l systems that self-identify as aarch64 instead (#368)
Closes #361
2021-02-24 19:24:19 -08:00
Nick Briggs
c6a74b2516
XrmParseCommand and XrmMergeDatabases depend on destination database being initialized. (#366) 2021-02-23 01:45:43 +00:00
Bruce Mitchener
d8e063bf02
tidy: Remove last caddr_t. (#365)
This cast isn't needed here and `caddr_t` is obsolete / not POSIX.
2021-02-22 09:45:07 -08:00
Bruce Mitchener
0129b50127
tidy: xrdopt. (#364)
* Remove unused `print_lispusage()`.
* Make some globals into function locals.
* Make the options table into a `static`. It can't be `const`
  because `XrmParseCommand` wants a mutable pointer.
* Remove unused `homeDB`.
* Stop using `caddr_t`, use `XPointer`. `caddr_t` is not POSIX
  and never made it past old obsolete BSD code.
2021-02-22 09:44:43 -08:00
Bruce Mitchener
a64a06466c
tidy: initdsp: Remove some unused globals. (#363) 2021-02-22 09:44:21 -08:00
Nick Briggs
12ef73a794
Merge pull request #362 from waywardmonkeys/cleanup-find-available-pty
tidy: FindAvailablePty.
2021-02-21 22:35:12 -08:00
Bruce Mitchener
ddb1c9f717 tidy: FindAvailablePty.
* Remove unused `Master` argument.
* Update documentation.
* Remove unused `MasterFD` variable in caller.
* Remove `slot` variable in caller and use `Master` in each case.
* Make `FindAvailablePty` a static function.
2021-02-22 11:54:51 +07:00
Nick Briggs
923f472a8f
Merge pull request #360 from Interlisp/fixups-for-INIT-handling
Improve process for building ldeinit
2021-02-18 20:29:58 -08:00
Nick Briggs
aa32c8347b Improve process of building ldeinit to allow for different options on different OSs 2021-02-18 11:12:14 -08:00
Nick Briggs
966a0bd7e0 Move default target out of makefile-tail to more specific makefile fragments
The default targets differ depending on the display type and whether networking
is configured in or not, so it's more appropriate in the individual fragments
2021-02-18 10:33:30 -08:00
Nick Briggs
e317c37f03 Move OSARCHDIR defn from makefile-tail to makefile-header 2021-02-18 09:17:56 -08:00
Nick Briggs
31927cd255
Clean up missing include file when compiling for INIT (#359)
* Compiling for INIT requires an extra include file vs normal.

* Compiling for INIT often includes tracing which also requires additional includes
2021-02-17 11:35:33 -08:00
Nick Briggs
747b8e468e
Merge pull request #357 from Interlisp/update-makefile-tail-dependencies
Update dependencies in makefile-tail
2021-02-15 18:57:45 -08:00
Nick Briggs
ef7149e8e4 Cleanup whitespace issues 2021-02-15 16:47:14 -08:00
Nick Briggs
64c04b5e2d Update dependencies in makefile-tail
Dependencies for all object files created during default compilation are updated
based on compiler generated, non-system, headers used.
2021-02-15 16:25:40 -08:00
Nick Briggs
1043a80d1f
Remove unnecessary (re)definitions of TRUE/FALSE (#356) 2021-02-14 16:47:04 -08:00
Nick Briggs
c60b522012
Files should explicitly include the definitions they directly depend on (#355)
... start by fixing the include files and the fallout in C source from
removing includes not directly needed by headers that previously included
them.
2021-02-13 21:41:31 -08:00
Nick Briggs
f019d3ddc2
Compiling with ethernet support requires etherdefs.h in certain places (#354) 2021-02-13 17:22:27 -08:00
Bruce Mitchener
64957b508d
Fix some unused variable warnings. (#352)
Also removes a prototype that wasn't needed.
2021-02-13 09:14:12 -08:00
Nick Briggs
1116ee7b60
Fix missing includes in ldeether.c (#351) 2021-02-13 09:07:21 -08:00
Nick Briggs
3a55f1d132
Missing include of sys/select.h in tty.c (closes Interlisp/medley#186) (#353)
(fix confirmed by original issue reporter)
2021-02-13 16:41:20 +00:00
Nick Briggs
f2ac050e8e
Prevent duplicate printing of info lines in response to -info option (#349)
The X options parser printed the info lines as well as the main options handler.
Add mention of the -info option in the -help usage information.

Fixes Interlisp/medley#41
2021-02-12 08:06:43 -08:00
Nick Briggs
6fe94fd655
Merge pull request #350 from Interlisp/ldsout-heap-fptovp
Allocate fptovp temporary table in heap
2021-02-12 08:05:20 -08:00
Nick Briggs
0d7dcc24bd Minor formatting revisions. 2021-02-11 23:35:38 -08:00
Nick Briggs
2a71f330b5 Allocate fptovp table from heap and release it when done 2021-02-11 23:24:25 -08:00