git repos / oastat

commit 4fe29602

sago007 · 2011-01-15 21:03
4fe296022b9c5622ed932706d8f684bdd68e10ac patch · browse files
parent 71ef0911ff1e58d862bfff4fa94434c5bad769c4

Some changes... but most important is secuiry update that I should have discovered earlier, this allowd people with access to the database to read the unhashed guids. 


git-svn-id: http://oastat.googlecode.com/svn/trunk@16 a36be8df-c75f-1e49-46ad-4f0ee64bdc62

Changed files

M src/Makefile before
M src/oastat.cpp before
M src/oss2db/Award2Db.cpp before
M src/oss2db/Award2Db.h before
M src/oss2db/Ctf1f2Db.cpp before
M src/oss2db/Ctf1f2Db.hpp before
M src/oss2db/Ctf2Db.cpp before
M src/oss2db/Ctf2Db.hpp before
M src/oss2db/Disconnect2Db.cpp before
M src/oss2db/Disconnect2Db.h before
M src/oss2db/Elimination2Db.cpp before
M src/oss2db/Elimination2Db.hpp before
M src/oss2db/Point2Db.cpp before
M src/oss2db/Point2Db.hpp before
M src/oss2db/init2db.cpp before
M src/oss2db/init2db.h before
M src/oss2db/shutdown2db.cpp before
M src/oss2db/shutdown2db.h before
M src/oss2db/userinfo2db.cpp before
M src/oss2db/userinfo2db.h before
diff --git a/src/Makefile b/src/Makefile index 02bd6e0..91f53ba 100644 --- a/src/Makefile +++ b/src/Makefile
@@ -6,7 +6,7 @@ USESTDOUT=0
BASE_LIBS=-lgcrypt
BASE_CFLAGS=-c -g
-O_FILES=build/oastat.o build/oastatstruct.o build/kill2db.o build/init2db.o build/shutdown2db.o build/userinfo2db.o build/disconnect2db.o build/award2db.o build/ctf2db.o build/point2db.o build/ctf1f2db.o
+O_FILES=build/oastat.o build/oastatstruct.o build/kill2db.o build/init2db.o build/shutdown2db.o build/userinfo2db.o build/disconnect2db.o build/award2db.o build/ctf2db.o build/point2db.o build/ctf1f2db.o build/elimination2db.o
ifeq ($(USESTDOUT),1)
O_FILES+= build/db2stdout.o
@@ -73,6 +73,9 @@ build/ctf2db.o: oss2db/Ctf2Db.cpp
build/ctf1f2db.o: oss2db/Ctf1f2Db.cpp
g++ $(BASE_CFLAGS) oss2db/Ctf1f2Db.cpp -o build/ctf1f2db.o
+build/elimination2db.o: oss2db/Elimination2Db.cpp
+ g++ $(BASE_CFLAGS) oss2db/Elimination2Db.cpp -o build/elimination2db.o
+
build/point2db.o: oss2db/Point2Db.cpp oss2db/Point2Db.hpp
g++ $(BASE_CFLAGS) oss2db/Point2Db.cpp -o build/point2db.o
diff --git a/src/oastat.cpp b/src/oastat.cpp index d2daee7..8805094 100644 --- a/src/oastat.cpp +++ b/src/oastat.cpp
@@ -52,6 +52,7 @@ using namespace std;
#include "oss2db/Ctf2Db.hpp"
#include "oss2db/Ctf1f2Db.hpp"
#include "oss2db/Point2Db.hpp"
+#include "oss2db/Elimination2Db.hpp"
string clientIdMap[MAX_ID];
@@ -77,6 +78,7 @@ void addCommands()
commands.push_back(new Ctf2Db());
commands.push_back(new Point2Db());
commands.push_back(new Ctf1f2Db());
+ commands.push_back(new Elimination2Db());
//Add more commands just above here
for(int i=0;i<commands.size();i++) {
@@ -152,8 +154,8 @@ static int processStdIn() {
} catch (exception &e)
{
cerr << "oastat: Sql_error at line: \"" << line << "\"" << endl <<
- "oastat: Error is: " << e.what() <<
- "oastat: Last error will be ignored" << endl;
+ "oastat: Error is: " << e.what() <<
+ "oastat: Last error will be ignored" << endl;
}
}
}
@@ -163,8 +165,8 @@ static int processStdIn() {
/*
If there is an error write it in the log and try again continue
*/
- cerr << "oastat: Crashed at line: \"" << line << "\"" << endl <<
- "oastat: Error is: " << e2.what();
+ cerr << "oastat: Crashed (NEAR FATAL EXCEPTION) at line: \"" << line << "\"" << endl <<
+ "oastat: Error is: " << e2.what();
done = false;
}
if (!done)
@@ -191,6 +193,8 @@ string getHashedId(string unhashedID) {
snprintf ( p, 3, "%02x", hash_binary[i] );
}
+ unhashedID = hash_hex;
+
//free(out);
return unhashedID; //Replace with md5 at some point
}
diff --git a/src/oss2db/Award2Db.cpp b/src/oss2db/Award2Db.cpp index 62fa6fe..897c3be 100644 --- a/src/oss2db/Award2Db.cpp +++ b/src/oss2db/Award2Db.cpp
@@ -7,15 +7,6 @@
#include "Award2Db.h"
-Award2Db::Award2Db() {
-}
-
-Award2Db::Award2Db(const Award2Db& orig) {
-}
-
-Award2Db::~Award2Db() {
-}
-
string Award2Db::getCommand() {
diff --git a/src/oss2db/Award2Db.h b/src/oss2db/Award2Db.h index 53e2aae..b061df9 100644 --- a/src/oss2db/Award2Db.h +++ b/src/oss2db/Award2Db.h
@@ -13,9 +13,6 @@
class Award2Db : public Struct2Db {
public:
- Award2Db();
- Award2Db(const Award2Db& orig);
- virtual ~Award2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/Ctf1f2Db.cpp b/src/oss2db/Ctf1f2Db.cpp index 9693a78..0b5c100 100644 --- a/src/oss2db/Ctf1f2Db.cpp +++ b/src/oss2db/Ctf1f2Db.cpp
@@ -7,14 +7,6 @@
#include "Ctf1f2Db.hpp"
-Ctf1f2Db::Ctf1f2Db() {
-}
-
-Ctf1f2Db::Ctf1f2Db(const Ctf1f2Db& orig) {
-}
-
-Ctf1f2Db::~Ctf1f2Db() {
-}
string Ctf1f2Db::getCommand() {
return "1FCTF";
diff --git a/src/oss2db/Ctf1f2Db.hpp b/src/oss2db/Ctf1f2Db.hpp index 74aa1fb..3d2b752 100644 --- a/src/oss2db/Ctf1f2Db.hpp +++ b/src/oss2db/Ctf1f2Db.hpp
@@ -13,9 +13,6 @@
class Ctf1f2Db : public Struct2Db {
public:
- Ctf1f2Db();
- Ctf1f2Db(const Ctf1f2Db& orig);
- virtual ~Ctf1f2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/Ctf2Db.cpp b/src/oss2db/Ctf2Db.cpp index d3dff60..01e907f 100644 --- a/src/oss2db/Ctf2Db.cpp +++ b/src/oss2db/Ctf2Db.cpp
@@ -7,15 +7,6 @@
#include "Ctf2Db.hpp"
-Ctf2Db::Ctf2Db() {
-}
-
-Ctf2Db::Ctf2Db(const Ctf2Db& orig) {
-}
-
-Ctf2Db::~Ctf2Db() {
-}
-
string Ctf2Db::getCommand() {
return "CTF";
diff --git a/src/oss2db/Ctf2Db.hpp b/src/oss2db/Ctf2Db.hpp index 62cf73e..982768c 100644 --- a/src/oss2db/Ctf2Db.hpp +++ b/src/oss2db/Ctf2Db.hpp
@@ -13,9 +13,6 @@
class Ctf2Db : public Struct2Db {
public:
- Ctf2Db();
- Ctf2Db(const Ctf2Db& orig);
- virtual ~Ctf2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/Disconnect2Db.cpp b/src/oss2db/Disconnect2Db.cpp index 2947c64..e328007 100644 --- a/src/oss2db/Disconnect2Db.cpp +++ b/src/oss2db/Disconnect2Db.cpp
@@ -21,14 +21,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
#include "Disconnect2Db.h"
-Disconnect2Db::Disconnect2Db() {
-}
-
-Disconnect2Db::Disconnect2Db(const Disconnect2Db& orig) {
-}
-
-Disconnect2Db::~Disconnect2Db() {
-}
string Disconnect2Db::getCommand() {
return "ClientDisconnect";
diff --git a/src/oss2db/Disconnect2Db.h b/src/oss2db/Disconnect2Db.h index 4ddded0..0cd78c9 100644 --- a/src/oss2db/Disconnect2Db.h +++ b/src/oss2db/Disconnect2Db.h
@@ -27,9 +27,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
class Disconnect2Db : public Struct2Db {
public:
- Disconnect2Db();
- Disconnect2Db(const Disconnect2Db& orig);
- virtual ~Disconnect2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/Elimination2Db.cpp b/src/oss2db/Elimination2Db.cpp index e0abf80..1439fba 100644 --- a/src/oss2db/Elimination2Db.cpp +++ b/src/oss2db/Elimination2Db.cpp
@@ -7,14 +7,6 @@
#include "Elimination2Db.hpp"
-Elimination2Db::Elimination2Db() {
-}
-
-Elimination2Db::Elimination2Db(const Elimination2Db& orig) {
-}
-
-Elimination2Db::~Elimination2Db() {
-}
string Elimination2Db::getCommand() {
return "ELIMINATION";
diff --git a/src/oss2db/Elimination2Db.hpp b/src/oss2db/Elimination2Db.hpp index 795ecaa..2a8cb02 100644 --- a/src/oss2db/Elimination2Db.hpp +++ b/src/oss2db/Elimination2Db.hpp
@@ -13,10 +13,6 @@
class Elimination2Db : public Struct2Db {
public:
- Elimination2Db();
- Elimination2Db(const Elimination2Db& orig);
- virtual ~Elimination2Db();
-
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/Point2Db.cpp b/src/oss2db/Point2Db.cpp index 2e6d893..48c6f4d 100644 --- a/src/oss2db/Point2Db.cpp +++ b/src/oss2db/Point2Db.cpp
@@ -7,14 +7,6 @@
#include "Point2Db.hpp"
-Point2Db::Point2Db() {
-}
-
-Point2Db::Point2Db(const Point2Db& orig) {
-}
-
-Point2Db::~Point2Db() {
-}
string Point2Db::getCommand() {
return "PlayerScore";
diff --git a/src/oss2db/Point2Db.hpp b/src/oss2db/Point2Db.hpp index 05f30e3..6afc673 100644 --- a/src/oss2db/Point2Db.hpp +++ b/src/oss2db/Point2Db.hpp
@@ -13,10 +13,6 @@
class Point2Db : public Struct2Db {
public:
- Point2Db();
- Point2Db(const Point2Db& orig);
- virtual ~Point2Db();
-
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/init2db.cpp b/src/oss2db/init2db.cpp index 310f44e..bdba243 100644 --- a/src/oss2db/init2db.cpp +++ b/src/oss2db/init2db.cpp
@@ -22,14 +22,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
#include "init2db.h"
#include <stdlib.h>
-Init2Db::Init2Db() {
-}
-
-Init2Db::Init2Db(const Init2Db& orig) {
-}
-
-Init2Db::~Init2Db() {
-}
string Init2Db::getCommand() {
return "InitGame";
diff --git a/src/oss2db/init2db.h b/src/oss2db/init2db.h index 921e21a..cb46bf4 100644 --- a/src/oss2db/init2db.h +++ b/src/oss2db/init2db.h
@@ -27,9 +27,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
class Init2Db : public Struct2Db {
public:
- Init2Db();
- Init2Db(const Init2Db& orig);
- virtual ~Init2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/shutdown2db.cpp b/src/oss2db/shutdown2db.cpp index 14ba7ea..bd54194 100644 --- a/src/oss2db/shutdown2db.cpp +++ b/src/oss2db/shutdown2db.cpp
@@ -22,14 +22,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
#include "shutdown2db.h"
-Shutdown2Db::Shutdown2Db() {
-}
-
-Shutdown2Db::Shutdown2Db(const Shutdown2Db& orig) {
-}
-
-Shutdown2Db::~Shutdown2Db() {
-}
string Shutdown2Db::getCommand() {
return "ShutdownGame";
diff --git a/src/oss2db/shutdown2db.h b/src/oss2db/shutdown2db.h index 5b03e2d..fff518b 100644 --- a/src/oss2db/shutdown2db.h +++ b/src/oss2db/shutdown2db.h
@@ -27,9 +27,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
class Shutdown2Db : public Struct2Db{
public:
- Shutdown2Db();
- Shutdown2Db(const Shutdown2Db& orig);
- virtual ~Shutdown2Db();
string getCommand();
bool canProcess(OaStatStruct oss);
diff --git a/src/oss2db/userinfo2db.cpp b/src/oss2db/userinfo2db.cpp index f1dca63..a865451 100644 --- a/src/oss2db/userinfo2db.cpp +++ b/src/oss2db/userinfo2db.cpp
@@ -22,14 +22,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
#include "userinfo2db.h"
#include <stdlib.h>
-Userinfo2Db::Userinfo2Db() {
-}
-
-Userinfo2Db::Userinfo2Db(const Userinfo2Db& orig) {
-}
-
-Userinfo2Db::~Userinfo2Db() {
-}
string Userinfo2Db::getCommand() {
return "ClientUserinfoChanged";
diff --git a/src/oss2db/userinfo2db.h b/src/oss2db/userinfo2db.h index 91f1d97..65ecd11 100644 --- a/src/oss2db/userinfo2db.h +++ b/src/oss2db/userinfo2db.h
@@ -27,9 +27,6 @@ Copyright (C) 2010 Poul Sander (oastat@poulsander.com)
class Userinfo2Db : public Struct2Db{
public:
- Userinfo2Db();
- Userinfo2Db(const Userinfo2Db& orig);
- virtual ~Userinfo2Db();
string getCommand();