Commit Graph

66 Commits (e98d421aff046a2d9a9b87516779603dc170b209)

Author SHA1 Message Date
MoNTE48 e98d421aff Merge remote-tracking branch 'upstream/stable-0.4' into sync 2019-04-01 20:18:54 +02:00
sfan5 2f2a775590 Add minetest.safe_write_file() to script API 2018-06-03 17:32:00 +02:00
Rob Blanckaert c9e758408d Add sha1 to lua utils. (#6563) 2018-06-03 17:32:00 +02:00
Maksim Gamarnik 35770f4abb Merge Minetest 0.4.16 2017-06-06 23:03:34 +03:00
ShadowNinja dfb4074a5a Use a settings object for the main settings
This unifies the settings APIs.

This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
2017-05-06 15:33:19 -04:00
Loic Blot cff2797dd4 [CSM] storage + fixes 2017-03-13 23:56:05 +01:00
Loïc Blot 04680f648a [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)
* squashed: CSM: Implement register_globalstep
  * Re-use fatal error mechanism from server to disconnect client on CSM error
  * Little client functions cleanups

* squashed: CSM: add core.after function
  * core.after is shared code between client & server
  * ModApiUtil get_us_time feature enabled for client
2017-03-13 23:56:05 +01:00
red-001 4fea6c30de [CSM] Add method that display chat to client-sided lua. (#5089) (#5091)
* squashed: [Client-sided scripting] Don't register functions that don't work. (#5091)
2017-03-13 23:56:05 +01:00
Maksim Gamarnik e05f7db82f Updated to Minetest ver. 0.4.15 2017-01-30 00:44:07 +02:00
adrido a0d2cea433 Dont compare short with bool (#4963)
Fixes a compiler warning on MSVC
2016-12-28 21:22:01 +01:00
ShadowNinja 79c3da8546 Mod security: Allow read-only access to all mod paths 2016-12-20 06:34:04 +00:00
ShadowNinja c9100740e4 Add version API 2016-10-31 21:53:00 -07:00
Loic Blot 17bad192fe Replace various std::map with UNORDERED_MAP + various cleanups
This is part 2 for 5f084cd98d7b3326b51320455364337539710efd

Other improvements:

* Use the defined ItemGroupList when used
* make Client::checkPrivilege const
* inline some trivial functions
* Add ActiveObjectMap typedef
* Add SettingsEntries typedef
2016-10-05 10:53:19 +02:00
Rogier-5 b6d641a75f Fixes for compiling with a newer (system) jsoncpp (#4429)
* Move included json code to jsoncpp subdirectory

This is needed to avoid having to specify the minetest src directory
as a system include when fixing the json includes.

* Fix json includes

They used "", so that the compiler searches the project's directory
first. The result was that when compiling with a system jsoncpp,
the project's own version of json.h was still included, instead of
the system version.

The includes now use <>, so a system location, or one specified with
'-Ilocation' is searched only.

* Fix for jsoncpp deprecated function warning

When compiling with a newer version of jsoncpp (and
ENABLE_SYSTEM_JSONCPP=true), jsoncpp emits a warning
about a deprecated function that minetest uses.
2016-08-10 12:10:00 +02:00
Dorian Wouters 9898a86bd7 Fix l_request_insecure_environment not ignoring all whitespace (#4395)
l_request_insecure_environment didn't ignore all whitespace in the
secure.trusted_mods config option.

Replaces std::remove with std::remove_if and the isspace function.
2016-08-04 00:41:54 +02:00
est31 9f3636a238 Add minetest.check_password_entry callback
Gives a convenient way to check a player's password.

This entirely bypasses the SRP protocol, so should be used
with great care.

This function is not intended to be used
in-game, but solely by external protocols, where no
authentication of the minetest engine is provided, and
also only for protocols, in which the user already gives the
server the plaintext password.

Examples for good use are the classical http form, or irc,
an example for a bad use is a password change dialog inside
formspec.

Users should be aware that they lose the advantages of the SRP
protocol if they enter their passwords for servers outside the
normal entry box, like in in-game formspec menus,
or through irc /msg s,

This patch also fixes an auth.h mistake which has mixed up the
order of params inside the decode_srp_verifier_and_salt function.

Zeno-: Added errorstream message for invalid format when I committed
2016-05-30 23:28:08 +10:00
red-001 1e4b9eb2d9 Add base64 encoding and decoding to the lua api. (#3919) 2016-05-27 23:37:28 -04:00
Maksim Gamarnik f56e578960 Merge remote-tracking branch 'upstream1/master' 2016-03-21 01:45:56 +02:00
est31 a60976e0cf Much better API for auth.{cpp, h}
* No function overloading
* Adhere coding style and with method names following
  lowercase_underscore_style
* Use std::string in external API, handling these is
  much more fun
2016-03-15 05:55:49 +01:00
Maksim Gamarnik 8f6ddcc57c Merge branch 'upstream/master' 2016-03-14 11:44:17 +02:00
ShadowNinja 9070fd90d5 Move AreaStore to util 2016-03-07 16:33:20 -05:00
ShadowNinja a4ec25f8b7 Use LuaErrors in security check macros
Throwing a LuaError calls destructors as it propagates up the stack,
wheres lua_error just executes a longjmp.
2016-03-07 13:37:15 -05:00
Maksim Gamarnik 00b6a43c2e Merge 2016-03-04 16:30:16 +02:00
ShadowNinja be664095d9 Fix main menu being unable to set secure settings 2016-03-03 00:57:19 -05:00
Maksim Gamarnik 7f8e94c093 Merge remote-tracking branch 'upstream/master' 2016-02-27 21:08:56 +02:00
Jeija f72736997e Fix minetest.request_insecure_environment() always returning nil
Fixes #3765
2016-02-26 06:36:48 +01:00
Maksim Gamarnik be288f1c52 Merge 2016-02-23 00:40:02 +02:00
Jeija 194c9518ee Ignore spaces in secure.trusted_mods setting 2016-02-19 18:50:42 -05:00
ShadowNinja 6cf6c8f25d Require request_insecure_environment to be called from the mod's main scope
Previously you could steal a secure environment from a trusted mod by wrapping
request_insecure_environment with some code like this:

local rie_cp = minetest.request_insecure_environment
local stolen_ie
function minetest.request_insecure_environment()
	local ie = rie_cp()
	stolen_ie = stolen_ie or ie
	return ie
end
2016-02-19 14:52:10 +00:00
Maksim Gamarnik 2520ca3ed1 Merge branch 'master' of https://github.com/minetest/minetest 2016-01-31 20:57:03 +02:00
est31 ee4d440094 Don't print whole json data buffer to errorstream on error
`errorstream` must not be overly verbose as clientside it is directly printed
onto the ingame chat window. These days, the serverlist can contain > 200k bytes,
so better print it to warningstream if the data buffer is too long.
2016-01-28 23:53:58 +01:00
Maksim Gamarnik 919be490f9 Update
Sync all Minetest commits
2015-11-10 13:49:24 +02:00
kwolekr be8cc00f50 SAPI: Move core.get_us_time() to Util module 2015-10-26 03:46:36 -04:00
kwolekr 47189162aa SAPI: Mark all Lua API functions requiring envlock 2015-10-25 23:06:48 -04:00
est31 92a2249160 Correct comment in l_util.cpp
Remove outdated loglevel list from a l_util.cpp comment,
and rather point to the updated code.
2015-10-26 00:32:48 +01:00
ShadowNinja 677ab7463d Refactor logging
- Add warning log level
- Change debug_log_level setting to enumeration string
- Map Irrlicht log events to MT log events
- Encapsulate log_* functions and global variables into a class, Logger
- Unify dstream with standard logging mechanism
- Unify core.debug() with standard core.log() script API
2015-10-14 01:03:54 -04:00
Kahrl 236844f409 Use numeric indices and raw table access with LUA_REGISTRYINDEX 2015-08-27 01:56:06 +02:00
Maksim Gamarnik 9247f32e0e LGPL 2.1 to 3.0 on all files 2015-08-14 01:26:28 +03:00
est31 d4a7cfcd71 Add AreaStore data structure 2015-07-27 06:42:56 +02:00
ShadowNinja fc80cc0daf Add core.get_dir_list
Conflicts:
	builtin/mainmenu/tab_texturepacks.lua
2015-05-31 23:20:28 +10:00
ShadowNinja f52eb6a064 Add core.request_insecure_environment() 2015-05-31 23:17:52 +10:00
ShadowNinja f683d0066d Add core.mkdir 2015-05-31 23:17:48 +10:00
ShadowNinja 3a97d94aa9 Add mod security
Due to compatibility concerns, this is temporarily disabled.
2015-05-31 23:17:44 +10:00
est31 69bda0a70f Make early protocol auth mechanism generic, and add SRP
Adds everything needed for SRP (and everything works too),
but still deactivated, as protocol v25 init packets aren't final yet.
Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25
inside networkprotocol.h.
2015-05-31 23:14:05 +10:00
ShadowNinja d85feedccc Add core.get_dir_list 2015-05-16 18:33:22 -04:00
ShadowNinja 2dd64f03da Add core.request_insecure_environment() 2015-05-16 18:33:19 -04:00
ShadowNinja 310295c511 Add core.mkdir 2015-05-16 18:32:37 -04:00
ShadowNinja 1008aefa8c Add mod security
Due to compatibility concerns, this is temporarily disabled.
2015-05-16 18:32:31 -04:00
est31 4769d4fe1d Make early protocol auth mechanism generic, and add SRP
Adds everything needed for SRP (and everything works too),
but still deactivated, as protocol v25 init packets aren't final yet.
Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25
inside networkprotocol.h.
2015-05-11 18:40:27 +02:00
est31 0094943204 Refactor around translatePassword
Change types for passed password from wstring to string, which removes converting
back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary,
closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for
translatePassword passed as const reference.
2015-04-17 06:10:30 +02:00