Raised This Month: $12 Target: $400
 3% 

Connect to DB with kv


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
noxuu
Member
Join Date: Dec 2015
Old 07-01-2016 , 17:47   Connect to DB with kv
Reply With Quote #1

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.
noxuu is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-02-2016 , 02:50   Re: Connect to DB with kv
Reply With Quote #2

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).
__________________
asherkin is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-02-2016 , 04:19   Re: Connect to DB with kv
Reply With Quote #3

Asherkin, that is irrelevant if the OP has zero intention of sharing the plugin (i.e. Fully private to himself).
Potato Uno is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 07-02-2016 , 04:22   Re: Connect to DB with kv
Reply With Quote #4

Quote:
Originally Posted by Potato Uno View Post
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?
hlstriker is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-02-2016 , 04:37   Re: Connect to DB with kv
Reply With Quote #5

Quote:
Originally Posted by Potato Uno View Post
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.
__________________
asherkin is offline
noxuu
Member
Join Date: Dec 2015
Old 07-02-2016 , 07:11   Re: Connect to DB with kv
Reply With Quote #6

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...
noxuu is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 07-02-2016 , 07:19   Re: Connect to DB with kv
Reply With Quote #7

Quote:
Originally Posted by noxuu View Post
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/.
__________________
asherkin is offline
noxuu
Member
Join Date: Dec 2015
Old 07-02-2016 , 07:45   Re: Connect to DB with kv
Reply With Quote #8

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.
noxuu is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 07-02-2016 , 14:29   Re: Connect to DB with kv
Reply With Quote #9

Quote:
Originally Posted by hlstriker View Post
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.
Potato Uno is offline
fakuivan
Senior Member
Join Date: Nov 2015
Old 07-02-2016 , 18:53   Re: Connect to DB with kv
Reply With Quote #10

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.
fakuivan is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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