Team Spartan Cookies & Milk Forums
  • Issue Tracker
  • Donations
  • Search
  • Member List
  • Help

Register

Team Spartan Cookies & Milk Forums Garry's Mod Starfall v
« Previous 1 … 6 7 8 9 10 … 18 Next »
Global Functions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Pages (2): 1 2 Next »
Threaded Mode
Global Functions
10-08-2017, 09:59 PM,
#1
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
Global Functions
Not that i'm one to complain when something is changed, this one kinda ruins the whole vanilla lua experience, blocking the ability to override any of the global functions basically ruins a lot of my scripts, I'm personally fine with functions like error, and steamid. Blocking all functions is kinda excessive.

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
10-08-2017, 10:02 PM, (This post was last modified: 10-08-2017, 10:05 PM by Obi.)
#2
Obi Offline
Zek'ke ah'rk naós ili kas zei'a
****
Posts: 143
Threads: 11
Joined: Oct 2013
RE: Global Functions
00:01 - тѕсм.Red T-he Blue Color™: just agree with me lol
00:02 - тѕсм.Obi-Swag Kenobi: oh ok

on a serious note, I have no clue why i'm here and Red dragged me here
Ignore my bullshittery on this thread

[Image: aYUxfU5.gif?1]
ᴚǝ ᴉʌ ǝʞuᴉlɟ ås etevleh i neaf!
Find
Reply
10-08-2017, 10:08 PM,
#3
Salira Offline
Valued donator and member
****
Posts: 196
Threads: 78
Joined: May 2015
RE: Global Functions
I don't do anything as advanced as red so I don't have any need to override global functions, but I agree that it's kind of excessive to block everything.
Find
Reply
10-08-2017, 10:08 PM,
#4
Skeleton Offline
Cheating Donating Member ( ͡° ͜ʖ ͡°)
****
Posts: 199
Threads: 30
Joined: Nov 2014
RE: Global Functions
I was the one that reported the issue because it seemed like a security breach to me, and I have to say that I agree with Red on the point that it is exagerrated to block every modification on vanilla functions. I personally think that they are some better way to fix this problem without handicap some people and their creations.

For exemple, this fix would have been great if it was applied only to libs and files that has been called through require().
Even better if there was a little checkbox to allow people or not to require()/include() this file.
Or maybe just block modifications on some important functions like ConfusedteamID(), ents.owner() or even error(). (and some other that gives us the path of the main file)

[Image: giphy.gif]
Find
Reply
10-08-2017, 10:08 PM,
#5
4N0NYM Offline
absens
****
Posts: 561
Threads: 211
Joined: Dec 2014
RE: Global Functions
Agreed and i m not saying it because is threat me.
Find
Reply
10-08-2017, 10:15 PM,
#6
TheOneAndOnlyTee Offline
GMod Admin
Posts: 755
Threads: 47
Joined: Oct 2013
RE: Global Functions
It was implemented to stop loading execute files as libs and then using the overridden globals to exploit the code, my suggestion is to protect starfall.getMainFile() and make the method known to all.

Steam Profile
My Discord Server
Need help with E2 or SF? , just ask me and i'll try to help.
[Image: 98Dkcoz.gif]
Find
Reply
10-08-2017, 10:17 PM,
#7
Red The Blue Color Offline
TSCM Super Donating Member
****
Posts: 422
Threads: 34
Joined: Feb 2015
RE: Global Functions
(10-08-2017, 10:15 PM)T-19 Wrote: It was implemented to stop loading execute files as libs and then using the overridden globals to exploit the code, my suggestion is to protect starfall.getMainFile() and make the method known to all.

It seems like the best solution i can't think of anyone who would have an actual code need to override starfall.getMainFile

"with it's superior software, i have no doubt it will succeed in finding fuck all" - T-17, 2016

[Super Member] [ENCOM] т-ѕсм.Red The Blue Color™: server do you support Hitler?
[Server] srcds_linux: The probabilty is about 99.99%, so interpret that how you want to.
Find
Reply
10-08-2017, 10:24 PM,
#8
Skeleton Offline
Cheating Donating Member ( ͡° ͜ʖ ͡°)
****
Posts: 199
Threads: 30
Joined: Nov 2014
RE: Global Functions
Plus a simple check on a starfall with starfall.getMainFile() allows us to stop any further modifications. Seems like the best option to me.

[Image: giphy.gif]
Find
Reply
11-08-2017, 04:32 PM,
#9
Kosmos Offline
GMod Admin
Posts: 180
Threads: 3
Joined: Dec 2013
RE: Global Functions
I think making _G unmodifiable does more harm than good, especially given that you can deny certain people access to your scripts using access privileges.
Not to mention that there were numerous ways to detect when the environment has been modified in a non-subtle way.

EDIT: I'd say making a function isMainFile() which resides in the global namespace would be more practical to use. Or even worse, make it a pre-processor directive.
EDIT2: Actually, the latter might be a nice extension to the @class directive, after the type you can specify that this file must be the main file.
Find
Reply
11-08-2017, 05:45 PM,
#10
Person8880 Offline
gpj.ecafllorT
*******
Posts: 2,407
Threads: 45
Joined: Sep 2013
RE: Global Functions
You should not have a need to ever modify the behaviour of default functions. While it is possible in Lua by default, it is generally discouraged. A developer should never have to worry that a standard function may act differently.

If you have behaviour you want to use then you create your own functions. This is still possible.

Making the environment only protect certain functions is even worse as it's even less obvious to a developer which ones they can and can't change (even though they shouldn't be changing any at all).

What are the use-cases that people have for overriding default functions?
Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


  • View a Printable Version
Forum Jump:


Users browsing this thread: 1 Guest(s)
Contact UsTeam Spartan Cookies & MilkReturn to TopLite (Archive) ModeMark all forums readRSS Syndication

Powered By MyBB, © 2002-2026 MyBB Group.