Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Metin2 > Metin2 Private Server > Metin2 PServer Guides & Strategies
You last visited: Today at 14:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Madein : Alpha (FIX- SQL Injection) and MakeGuild New Bug

Discussion on Madein : Alpha (FIX- SQL Injection) and MakeGuild New Bug within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2015
Posts: 3
Received Thanks: 0
Madein : Alpha (FIX- SQL Injection) and MakeGuild New Bug

Hi,

When i add the code to CGuildManager::CreateGuild which fixes sql injection players can create 2 guilds with the same name, are there any fix about it?



Bug screen;

xcorper is offline  
Old 12/26/2015, 16:09   #2
 
DasSchwarzeT's Avatar
 
elite*gold: 399
Join Date: Sep 2011
Posts: 5,323
Received Thanks: 3,937
Just remove the "MakeGuild" Fix. It's not necessary.
DasSchwarzeT is offline  
Thanks
2 Users
Old 12/26/2015, 16:14   #3
 
elite*gold: 0
Join Date: Dec 2015
Posts: 3
Received Thanks: 0
Quote:
Originally Posted by DasSchwarzeT View Post
Just remove the "MakeGuild" Fix. It's not necessary.
Why remove?
xcorper is offline  
Old 12/26/2015, 16:26   #4
 
DasSchwarzeT's Avatar
 
elite*gold: 399
Join Date: Sep 2011
Posts: 5,323
Received Thanks: 3,937
Quote:
Originally Posted by xcorper View Post
Why remove?
As I already said the "fix" isn't necessary and causes the bug of duplicated guilds.
DasSchwarzeT is offline  
Old 12/26/2015, 17:25   #5
 
Ken™'s Avatar
 
elite*gold: 0
Join Date: Aug 2015
Posts: 10
Received Thanks: 45
Quote:
Originally Posted by DasSchwarzeT View Post
Just remove the "MakeGuild" Fix. It's not necessary.
You don't have to remove the codes in the source files.

I really don't know how many times I should say this. You don't have to implement the second fix in your source files. The system is already checking the alpha characters 2 times. Just use the original codes.

Code:
DWORD CGuildManager::CreateGuild(TGuildCreateParameter& gcp)
{
	if (!gcp.master)
		return 0;

	if (!check_name(gcp.name))
	{
		gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드 이름이 적합하지 않습니다."));
		return 0;
	}

	std::auto_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM guild%s WHERE name = '%s'",
				get_table_postfix(), gcp.name));

	if (pmsg->Get()->uiNumRows > 0)
	{
		MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);

		if (!(row[0] && row[0][0] == '0'))
		{
			gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 이미 같은 이름의 길드가 있습니다."));
			return 0;
		}
	}
	else
	{
		gcp.master->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드를 생성할 수 없습니다."));
		return 0;
	}

	// new CGuild(gcp) queries guild tables and tell dbcache to notice other game servers.
	// other game server calls CGuildManager::LoadGuild to load guild.
	CGuild * pg = M2_NEW CGuild(gcp);
	m_mapGuild.insert(std::make_pair(pg->GetID(), pg));
	return pg->GetID();
}
Kind Regards ~ Ken
Ken™ is offline  
Thanks
3 Users
Old 12/26/2015, 18:17   #6
 
elite*gold: 0
Join Date: Dec 2015
Posts: 3
Received Thanks: 0
Thank you.
xcorper is offline  
Reply




All times are GMT +1. The time now is 14:35.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.