ULX

Author Topic: ULX cexec  (Read 11639 times)

0 Members and 1 Guest are viewing this topic.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
ULX cexec
« on: October 05, 2011, 07:56:30 PM »
I've noticed some commands cannot be run on players, like gmod_cleanup, disconnect, and other things.
I looked in the module file and found nothing blocking those commands, yet other lua files can run them anyway.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX cexec
« Reply #1 on: October 05, 2011, 08:12:57 PM »
What exactly are you asking?
ULX blocks no commands.
Gmod server code itself monitors for certain commands using RunConsoleCommand and doesn't allow them to run.
See list of blocked at bottom of page here -
 G.RunConsoleCommand

Cexec uses runconsolecommand on the player, so, doesn't allow those commands.

What specific commands are you saying are allowed by lua, and what files are you mentioning.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: ULX cexec
« Reply #2 on: October 06, 2011, 03:34:14 AM »
gmod_cleanup and disconnect. Both of those work with other lua scripts, but when using !cexec it doesnt have any effect.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX cexec
« Reply #3 on: October 06, 2011, 05:51:38 AM »
What other scripts?
Experiencing God's grace one day at a time.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: ULX cexec
« Reply #4 on: October 06, 2011, 04:19:26 PM »
Just any lua script. If i try to use !cexec to run "disconnect" on a player, it wont work. If I try to run disconnect on a player with another lua script, they will be disconnected.
This is the same for a few other commands. Such as: kill, disconnect, gmod_cleanup, and a few others.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX cexec
« Reply #5 on: October 06, 2011, 04:26:44 PM »
Blackfire, mind posting a sample of said 'any lua script'?
We'd really like to see it.
It's possible we may actually learn something.
If not learn something, then be able to explain how it works.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: ULX cexec
« Reply #6 on: October 06, 2011, 04:40:21 PM »
Oops i just realised something. Could you move this post to the SVN forum.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: ULX cexec
« Reply #7 on: October 06, 2011, 04:43:18 PM »
Also here is an example:

for k,v in pairs(player.GetAll()) do
    v:ConCommand("disconnect")
end

That will make everyone disconnect.
But typeing "!cexec * disconnect" will not work.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX cexec
« Reply #8 on: October 10, 2011, 10:29:31 AM »
I'm not ignoring this! I just haven't had time to get around to it yet. I checked the code, and we're using the same function so there's really no reason why it would work in one script but not ours... at least if you chat execute the command. Using the command in console goes through an additional "garry-check", but chatted commands go directly to the server unmolested.
Experiencing God's grace one day at a time.

Offline blackfire88

  • Jr. Member
  • **
  • Posts: 56
  • Karma: 0
Re: ULX cexec
« Reply #9 on: December 26, 2011, 05:00:35 PM »
So is it fixed?

Offline LuaTenshi

  • Hero Member
  • *****
  • Posts: 545
  • Karma: 47
  • Just your ordinary moon angel!
    • Mirai.Red
Re: ULX cexec
« Reply #10 on: December 26, 2011, 07:11:22 PM »
Garry's Mod blocks the following commands from being run on players.

Code: [Select]
"con_enable"
"sv_cheats",
"_restart",
"exec",
"condump",
"connect",
"bind",
"BindToggle",
"alias",
"ent_fire",
"ent_setname",
"sensitivity",
"name",
"r_aspect",
"quit",
"exit",
"lua_run",
"lua_run_cl",
"lua_open",
"lua_cookieclear",
"lua_showerrors_cl",
"lua_showerrors_sv",
"lua_openscript",
"lua_openscript_cl",
"lua_redownload",
"sent_reload",
"sent_reload_cl",
"swep_reload",
"swep_reload_cl",
"gamemode_reload",
"gamemode_reload_cl",
"con_logfile",
"clear",
"rcon_password",
"test_RandomChance",
"plugin_load",

So the answer to your question is, that it was never broken.
« Last Edit: December 26, 2011, 07:13:15 PM by HeLLFox_15 »
I cry every time I see that I am not a respected member of this community.