Commit Graph
100 Commits
Author SHA1 Message Date
nhkeni 96a74ccfbf Silence a compiler warning in cross-compile 2024-03-15 14:05:14 -04:00
nhkeni 2980c55f5c report.c: silence some compiler warnings for clang + nhmd4 2024-03-10 19:51:55 -04:00
nhkeni a9494b1385 report.c: silence some compiler warnings for clang + nhmd4 2024-03-10 17:36:51 -04:00
nhkeni 7d2362c98d hack: put back recent make depend output until I can fix whatever I just broke 2024-03-10 12:51:11 -04:00
nhkeni 7ad921ebe7 Merge branch 'keni-pending2' into NetHack-3.7 2024-03-10 10:36:24 -04:00
nhkeni f065cb4ec7 Merge branch 'keni-regex' into NetHack-3.7 2024-03-10 10:22:19 -04:00
nhkeni e316d962a8 Minor regex naming and doc cleanup. 2024-03-09 13:28:15 -05:00
nhkeni 2d864961bf Close /dev/null in child process to keep analyzer happy. 2024-03-08 09:24:36 -05:00
nhkeni ad667216ee Prevent conflicting types for name "body" 2024-03-01 16:19:30 -05:00
nhkeni 5c3fd7b485 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-02-28 14:06:33 -05:00
nhkeni cd1002f84e DEVEL: add directions for a Linux credential helper 2024-02-28 14:05:23 -05:00
nhkeni 5f64dd3f1b Make initoptions() call initoptions_init() if that hasn't already happened. 2024-02-23 20:14:03 -05:00
nhkeni eadebf0132 Use local md4 implementation instead of libcrypto for linux.
NB: "make depend" needs to be rerun
2024-02-23 17:08:49 -05:00
nhkeni 61f4d972bb Add local md4 implementation and drop libcrypto for linux. 2024-02-23 17:05:45 -05:00
nhkeni 7e08ce3e9e Merge branch 'keni-crdumplog' into NetHack-3.7 2024-02-21 16:27:52 -05:00
nhkeni 3f5d1d3a36 split DUMPLOG
DUMPLOG requests the DUMPLOG feature as it does now
DUMPLOG_CORE requests the internal buffering only (used for CRASHREPORT)

This allows CRASHREPORT to access recent messages without performing
any file I/O.
2024-02-20 21:42:05 -05:00
nhkeni 9b238bba09 turn off CRASHREPORT for CI minimal build 2024-02-15 20:43:49 -05:00
nhkeni 72ae3c7282 if makedefs doesn't exist, force NOCRASHREPORT 2024-02-15 20:42:57 -05:00
nhkeni 3a3f5c9923 azure-pipelines.yml: cope with white-space after # 2024-02-15 20:24:41 -05:00
nhkeni c02220499b Add CROSSCOMPILE to mdgrep, then use it to stop CRASHREPORT when cross-compiling 2024-02-15 19:37:43 -05:00
nhkeni e378b782fc Yes, apparently there are configurations that still need the NH_abort() macro 2024-02-15 19:00:08 -05:00
nhkeni a638629e47 unscramble NOCRASHREPORT logic in config.h 2024-02-15 18:53:49 -05:00
nhkeni 727740749e Try to fix linux for installations that don't have openssl includes. 2024-02-15 18:08:58 -05:00
nhkeni 252f70b4b3 Turn off debugging flag in Makefile.mingw32 - that should gix the MinGW build 2024-02-15 17:37:40 -05:00
nhkeni 9c0d2389cb hopefully fix broken MSDOS and MinGW compiles (linux still broken) 2024-02-15 17:07:02 -05:00
nhkeni 3d3ce2369c Merge branch 'keni-wincw2' into NetHack-3.7
Lots of manually resolved conflicts.
2024-02-15 16:25:12 -05:00
nhkeni dbe5c98dca add CRASHREPORT directly to browser
add CRASHREPORT for Windows
add ^P info to report (via DUMPLOG)

new options: crash_email, crash_name, crash_urlmax
new game command: #bugreport
new config option: CRASHREPORT_EXEC_NOSTDERR
new command line option: --bidshow

deleted helper scripts:
    NetHackCrashReport.Javascript
    nhcrashreport.lua

misc:
    update CRASHREPORTURL (will need to be updated before release)
    update bitrot in winchain
    winchain for Windows
    add missing synch_wait for NetHackW --showpaths
    add PANICTRACE (and CRASHREPORT) in mdlib.c:build_opts

missing:
    packaging (Windows needs the pdb file)
    no testing with MSVC command line build

port status:
    linux: working, but glibc's backtrace doesn't show static functions
    Windows VS: working.  pdb file is large - looking into options
    MacOS: working
    msdos: not supported
    VMS: not supported
    MSVC: planned, but not attempted
    MSYS2: working, but libbacktrace not showing symbols (yet?)
2024-02-06 18:33:59 -05:00
nhkeni 6b189fb0e1 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2024-02-04 22:07:58 -05:00
nhkeni aa8aa24d3b git glue memory leaks
- fix stack imbalances
- call panic() instead of nhl_error() if L==0 to prevent immediate crash
- drop unused argument prep in get_nh_lua_variables
- change nhl_pcall_handle to clean up stack after calling impossible()
- don't force full garbage collection runs
- don't collect garbage to do memory usage checking
- remove unnecessary stack resets
2024-02-04 22:07:05 -05:00
nhkeni 23709b3db3 Update comment. 2024-02-04 21:56:09 -05:00
nhkeni 6f47094b8d Add a sanity check to nhl_init() 2024-01-21 12:44:05 -05:00
nhkeni bacfa6ef40 More lua setup cleanup
Stop (poorly) tracking the amount of memory in use and get
 it from Lua instead.
Simplify nhl_alloc.
2024-01-17 15:04:40 -05:00
nhkeni aebc666efa clean up lua error message, catch failed lua_newstate call 2024-01-12 11:06:25 -05:00
nhkeni 2c26176de8 blind attempt to satisfy MS-DOS compile 2024-01-05 18:23:55 -05:00
nhkeni 0745d3fbe5 Free user data when destroying a lua state. 2024-01-05 17:26:18 -05:00
nhkeni 9bcff7b896 Merge branch 'keni-luabits2' into NetHack-3.7 2024-01-04 10:40:27 -05:00
nhkeni c7ab9a0565 Some lua catchup and cleanup
- add nhl_pcall_handle() to wrap all nhl_pcall calls that didn't check
  return value and either panic() or impossible()
- add --loglua (unix only) to dump Lua memory and steps info to livelog
- remove old logging
- set memory and step limits on all Lua VMs
2024-01-04 10:37:38 -05:00
nhkeni 6c8035d1e7 allow --showpath for --showpaths 2023-11-05 10:26:13 -05:00
nhkeni 9472c0b797 Guidebook formatting typo 2023-09-09 15:10:49 -04:00
nhkeni 33d85bfe08 CRASHREPORT cleanup
make deprecation warning suppression unconditional
formatting/whitespace
2023-09-07 20:55:07 -04:00
nhkeni b75bc87662 Improve run fetch-lua required message - it has to be run in top. 2023-09-07 12:17:53 -04:00
nhkeni ee2510eb2f blind attempt to fix Windows build 2023-09-06 13:55:06 -04:00
nhkeni 385d860bef Merge branch 'keni-crashweb3' into NetHack-3.7 2023-09-06 12:39:17 -04:00
nhkeni 8c095b009a Add CRASHREPORT, show contact form on panic/impossible
When calling panic() or impossible(), create the option
of opening a browser window with most of the fields
already populated.  Code for MacOS and linux is included;
other ports are affected by argument change to early_init
which are done but not tested.

To enable, define CRASHREPORT in config.h and set
CRASHREPORTURL in sysconf to (for the moment at least)
http[s]://www.nethack.org/common/contactcr.html

Adds --grep-defined option to makedefs for Makefiles.

Adds "bid" (binary identifier), an MD4 of the main nethack
binary.  This is ONLY for helping (in the future) contact.html
to set the "NetHack from" field automatically for our own
binaries.  This can be faked, but the user can lie so nothing
lost.  There's nothing magic about MD4; other ports can use
anything that prodcues a long apparently random string we can
match against.

- new option --bidshow for us to get the MD4 of a
  released binary so I can add it to the website.
  Only available in wizard mode and not in nethack.6.
- typo macos -> macosx in hints file

No support for packaging builds as I'm not sure what that
would look like.

Adds a javascript helper for MacOS.
Adds a lua helper for linux (and builds and installs
 nhlua).
2023-09-06 12:27:13 -04:00
nhkeni 87434a49ab Merge branch 'keni-luacksum2' into NetHack-3.7 2023-09-06 12:20:02 -04:00
nhkeni 1a2836577b check the checksum for Lua in "make fetch-lua"
Works for MacOS and linux.
2023-09-06 12:15:54 -04:00
nhkeni 9136c75425 nhgitset.pl tid
Older versions of git, when cloning a repo and
the expected source templates directory does not
exist, does not create .git/hooks, which causes
nhgitset.pl to fail.  So do it here.
2023-08-29 21:04:32 -04:00
nhkeni 06a3bd0424 mac: don't fail "make install" if SHELLDIR already exists 2023-08-28 19:18:36 -04:00
nhkeni 068a460d05 fix various typos in NHDT lines 2023-08-28 16:17:41 -04:00
nhkeni 9ba47555c9 Merge remote-tracking branch 'origin/keni-versioncopy' into NetHack-3.7 2023-08-15 09:33:59 -04:00
nhkeni 1663ecf85d Add --version:copy, deprecate --version:paste. 2023-08-03 21:51:25 -04:00
nhkeni c2f7e7a0ac Start using 3 part version numbers. 2023-02-27 10:18:14 -05:00
nhkeni d515538f21 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2023-02-04 09:51:44 -05:00
nhkeni 31d5fecbb2 leave a note on a potential future Lua sandbox issue 2023-02-04 09:50:49 -05:00
keni 3f3c581f65 make the 2 panic declarations fully match 2023-01-10 16:55:35 -05:00
keni d1561f15c1 alloc.c: add missing NORETURN 2023-01-10 15:55:30 -05:00
nhkeni 6c2b02aa8c clarify fixes entry 2022-06-01 14:02:13 -04:00
nhkeni 8a6c3d8de5 5.3.5 is not currently compatible with NHL_SANDBOX, but make it compile
with 5.3.5 and !NHL_SANDBOX
2022-05-18 14:11:00 -04:00
nhkeni c81dcf6713 Don't sanity check LUA_VERSION for sandbox if no sandbox. 2022-05-18 13:24:13 -04:00
nhkeni e5648584b3 update headers on Lua files 2022-05-10 07:44:26 -04:00
nhkeni c6c61a1419 Lua sandbox
Change table format to handle functions never to be included.
Clean up bit masks and tables of functions.
Remove some old comments and out-of-date code.
2022-05-07 17:45:36 -04:00
nhkeni 79e04d3a65 nhlua.c: bugfix - remove the handler after calling lua_pcall() 2022-05-01 21:09:59 -04:00
nhkeni b8ee09b843 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-04-29 21:11:10 -04:00
nhkeni 6bd2172ba7 Lua sandbox
This is enough to prevent abuse by denying access to functions and
    denial of service (RAM and instruction step limits), but not enough
    to allow restricted use of things that require finer control (e.g.
    filesystem access).

    If something goes wrong, the whole thing can be turned off, for
    now, in config.h (see NHL_SANDBOX).

    None of the current functionality requires changes to build systems;
    some of the possible future functionality may require some #defines
    - TBD.  There is lots of dead code (#ifdef notyet) for bits of that
    additional functionality; we can rip it out if we don't want those
    additions or we can complete (parts of) it depending on our needs.

    All current uses of Lua are connected to sandboxes and guarded with
    nhl_pcall (sandbox and lua_pcall wrapper); options and limits can
    be set at the callsites in the passed nhl_sandbox_info.  Some of
    the error handling may be wrong - panic() vs.  impossible() vs
    silence.

    Memory and instruction step limits should be tuned prior to release;
    there's no point tuning them now.
2022-04-29 19:46:33 -04:00
nhkeni 7840ef9554 un-streq followup 2022-03-19 20:49:00 -04:00
nhkeni 64371dc8b3 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-03-18 20:34:59 -04:00
nhkeni b5c5496d17 Replace streq() with str_start_is(), which actually has the intended semantics.
Contributed by Michael Meyer.
2022-03-18 20:33:13 -04:00
nhkeni f32ab9d792 tile2x11.c needs a local copy of FITSuint_ for alloc.o 2022-03-17 20:20:39 -04:00
nhkeni ebe08a8c75 tile2bmp.c needs a local copy of FITSuint_ for alloc.o 2022-03-17 19:27:02 -04:00
nhkeni 3cc0043dfe Fix dlb_main type issues. 2022-03-17 18:12:40 -04:00
nhkeni 7dba4f1236 Add FITSint() and FITSuint(),
which cast long long to int while panicking on overflow
2022-03-17 18:10:38 -04:00
nhkeni e2d5013e01 Typedef getloc_flags_t for struct unpacked_coord.getloc_flags and related. 2022-03-17 17:17:13 -04:00
nhkeni fc5e991b06 Add typedef mmflags_t to assure enough bits for all MM_* flags. 2022-03-17 17:14:12 -04:00
nhkeni f8830e69e2 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-03-17 16:57:31 -04:00
nhkeni e260403f3b Guard variable used only with SYSCF_FILE. 2022-03-17 16:56:59 -04:00
nhkeni 9f3063df01 Make pointer differenace a long. 2022-03-17 16:56:25 -04:00
nhkeni 7a790c2a30 Use lua_Integer when interfacing with lua. 2022-03-17 16:30:16 -04:00
nhkeni 1151d54500 Add and use Strlen(), like strlen() but panics on unreasonably long strings. 2022-03-16 21:42:00 -04:00
nhkeni ff1289e828 Add Strlen(), a strlen(3) that panics if string is stupid long and returns unsigned.
First batch of changes to use it to suppress warnings.
2022-03-16 21:34:21 -04:00
nhkeni 1e31fee0df Don't infringe on POSIX typedef namespace. 2022-03-16 21:31:26 -04:00
nhkeni 3e4ea0a2c3 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-03-16 21:27:22 -04:00
nhkeni b444085d38 ssize_t for Windows 2022-03-16 21:27:06 -04:00
nhkeni 7f484815e5 Add streq() and start finding places it fixes warnings.
Some type fixes from Michael Allison.
2022-03-16 18:50:17 -04:00
nhkeni dc72e07a2b Make readLenType generally available. Fix some warnings around read(2). 2022-03-16 18:41:45 -04:00
nhkeni a64a666f78 Various type and cast bits. 2022-03-16 18:18:52 -04:00
nhkeni e51026aee1 LIMIT_TO_RANGE_INT macro and various casts. 2022-03-16 17:59:23 -04:00
nhkeni 81b014977d Some easy loss-of-precision fixes. 2022-03-16 17:49:29 -04:00
nhkeni 16ea5e7fa6 cmdcount_t
Add a type to force g.{command_count,last_command_count,multi} to have the
same type (because cmd.c: g.multi = g.command_count;) and some resulting
cleanup.
2022-03-16 17:33:44 -04:00
nhkeni ab16cf83b1 Merge branch 'NetHack-3.7' of https://rodney.nethack.org:20040/git/NHsource into NetHack-3.7 2022-03-16 17:22:43 -04:00
nhkeni 3aed0c61bc xcode cleanup:
don't use git (so tarball distribution should work)
 name the build shell scripts
2022-03-16 17:03:54 -04:00
nhkeni 41203982be Fix xcode recover install 2022-03-16 15:06:55 -04:00
nhkeni 0b4fad3cb7 NetHack.xcodeproj: update handling of Lua 2022-03-16 15:05:19 -04:00
nhkeni 3cf1b87914 cmdcount_t
Add a type to force g.{command_count,last_command_count,multi} to have the
same type (because cmd.c: g.multi = g.command_count;) and some resulting
cleanup.
2022-02-27 20:01:49 -05:00
nhkeni ae28e259ab nethack.6 bits
Restore hard-coded author name.
Fix overlong line causing wrapping error.
2022-02-21 11:18:58 -05:00
nhkeni e10dff845f remove more leading zeroes 2022-02-08 11:35:44 -05:00
nhkeni 1d72646e87 dlb.6: remove leading zero from day-of-month 2022-02-08 10:31:43 -05:00
nhkeni 1d210ed722 prevent ..files value from being pull from ..
This was creating extra nethack.ico entries in Files.
2022-02-04 15:11:04 -05:00
nhkeni 1647125f89 rationalize extensions in doc directory
rename text files to have .txt extension, etc
    update references to changed filenames
2022-01-29 16:28:06 -05:00
nhkeni 6feb4f09bc enable NH_DATESUB for all .6 files 2022-01-29 16:09:26 -05:00
Kenneth Lorber 6991800adc Merge branch 'keni-datesub2' into NetHack-3.7 2022-01-11 16:49:21 -05:00