AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Connect to DB with kv (https://forums.alliedmods.net/showthread.php?t=284676)

noxuu 07-01-2016 17:47

Connect to DB with kv
 
Hi !
I need to connect to DB with KeyValues and create tables, i have a code:

Spoiler


I do not know where the error is.. Can someone help me ? Thanks.
PS. I want to use custom connect, no config.

asherkin 07-02-2016 02:50

Re: Connect to DB with kv
 
SourceMod plugins are trivially decompilable, and you are required by law to include the source code when distributing binaries - this isn't providing you any advantage, just use the config (and build a web api for untrusted users).

Potato Uno 07-02-2016 04:19

Re: Connect to DB with kv
 
Asherkin, that is irrelevant if the OP has zero intention of sharing the plugin (i.e. Fully private to himself).

hlstriker 07-02-2016 04:22

Re: Connect to DB with kv
 
Quote:

Originally Posted by Potato Uno (Post 2432691)
Asherkin, that is irrelevant if the OP has zero intention of sharing the plugin (i.e. Fully private to himself).

Regardless, why would you opt to hardcode such data instead of using a config?

asherkin 07-02-2016 04:37

Re: Connect to DB with kv
 
Quote:

Originally Posted by Potato Uno (Post 2432691)
Asherkin, that is irrelevant if the OP has zero intention of sharing the plugin (i.e. Fully private to himself).

Then there is no reason not to use the config.

noxuu 07-02-2016 07:11

Re: Connect to DB with kv
 
If there is a function CustomConnect this means that it is permitted.
I clearly written.. "I want to use custom connect, no config."..
Plugin is private, I do not understand why I should share my DB pass on ftp...

asherkin 07-02-2016 07:19

Re: Connect to DB with kv
 
Quote:

Originally Posted by noxuu (Post 2432719)
Plugin is private, I do not understand why I should share my DB pass on ftp...

If someone can get the SMX, they can get the DB credentials - they're no more secure in the plugin than they are in databases.cfg.

If you want to see, compile a trivial plugin with a secret string in it, and upload it to http://mrderp.xyz/lysis/.

noxuu 07-02-2016 07:45

Re: Connect to DB with kv
 
Hardly anyone knows what is decompiler, Any idiot can pull data from Databases.cfg.
Can someone help me ? Whether we will continue to talk about config.

Potato Uno 07-02-2016 14:29

Re: Connect to DB with kv
 
Quote:

Originally Posted by hlstriker (Post 2432692)
Regardless, why would you opt to hardcode such data instead of using a config?

Because I don't want to modify database.cfg 12 times for 12 servers?

Just because you don't see a use for it doesn't mean the rest of the world doesn't.

fakuivan 07-02-2016 18:53

Re: Connect to DB with kv
 
Close the db handle or return it if you want to use it later. Other than that, I don't see any problems with that function. Post the output if you want help, you need to be more specific about those "errors".

If you want to talk about security, if someone has access to your server files, it's game over. Hardcoding credentials is not a reliable solution because you can't be shure that only trusted entities have them.


All times are GMT -4. The time now is 01:23.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.