From 7c8a134b082e1224a6ece26cefdf939753088e2c Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 29 Apr 2009 19:57:50 +0200 Subject: Core in Server umbenannt --- .../DaemonCommandRequestHandler.cpp | 84 ---- .../RequestHandlers/DaemonCommandRequestHandler.h | 47 -- .../RequestHandlers/DaemonFSInfoRequestHandler.cpp | 83 ---- .../RequestHandlers/DaemonFSInfoRequestHandler.h | 47 -- .../RequestHandlers/DaemonListRequestHandler.cpp | 65 --- .../RequestHandlers/DaemonListRequestHandler.h | 42 -- .../RequestHandlers/DaemonStatusRequestHandler.cpp | 85 ---- .../RequestHandlers/DaemonStatusRequestHandler.h | 47 -- .../RequestHandlers/GSSAPIAuthRequestHandler.cpp | 134 ----- .../RequestHandlers/GSSAPIAuthRequestHandler.h | 48 -- .../RequestHandlers/IdentifyRequestHandler.cpp | 67 --- src/Core/RequestHandlers/IdentifyRequestHandler.h | 42 -- src/Core/RequestHandlers/LogRequestHandler.cpp | 63 --- src/Core/RequestHandlers/LogRequestHandler.h | 42 -- src/Core/RequestHandlers/Makefile.am | 6 - src/Core/RequestHandlers/Makefile.in | 542 --------------------- .../RequestHandlers/UserInfoRequestHandler.cpp | 70 --- src/Core/RequestHandlers/UserInfoRequestHandler.h | 48 -- .../RequestHandlers/UserListRequestHandler.cpp | 76 --- src/Core/RequestHandlers/UserListRequestHandler.h | 48 -- 20 files changed, 1686 deletions(-) delete mode 100644 src/Core/RequestHandlers/DaemonCommandRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/DaemonCommandRequestHandler.h delete mode 100644 src/Core/RequestHandlers/DaemonFSInfoRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/DaemonFSInfoRequestHandler.h delete mode 100644 src/Core/RequestHandlers/DaemonListRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/DaemonListRequestHandler.h delete mode 100644 src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/DaemonStatusRequestHandler.h delete mode 100644 src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/GSSAPIAuthRequestHandler.h delete mode 100644 src/Core/RequestHandlers/IdentifyRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/IdentifyRequestHandler.h delete mode 100644 src/Core/RequestHandlers/LogRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/LogRequestHandler.h delete mode 100644 src/Core/RequestHandlers/Makefile.am delete mode 100644 src/Core/RequestHandlers/Makefile.in delete mode 100644 src/Core/RequestHandlers/UserInfoRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/UserInfoRequestHandler.h delete mode 100644 src/Core/RequestHandlers/UserListRequestHandler.cpp delete mode 100644 src/Core/RequestHandlers/UserListRequestHandler.h (limited to 'src/Core/RequestHandlers') diff --git a/src/Core/RequestHandlers/DaemonCommandRequestHandler.cpp b/src/Core/RequestHandlers/DaemonCommandRequestHandler.cpp deleted file mode 100644 index 0e316bc..0000000 --- a/src/Core/RequestHandlers/DaemonCommandRequestHandler.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - * DaemonCommandRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "DaemonCommandRequestHandler.h" -#include "../ConnectionManager.h" -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void DaemonCommandRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "DaemonCommand") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - std::string command = packet["command"]; - - try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); - Common::RequestManager::get()->sendRequest(daemonCon, - sigc::mem_fun(this, &DaemonCommandRequestHandler::requestFinished), command == "reboot"); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } -} - -void DaemonCommandRequestHandler::requestFinished(const Common::Request &request) { - try { - sendPacket(request.getResult()); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/DaemonCommandRequestHandler.h b/src/Core/RequestHandlers/DaemonCommandRequestHandler.h deleted file mode 100644 index aab9539..0000000 --- a/src/Core/RequestHandlers/DaemonCommandRequestHandler.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * DaemonCommandRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_DAEMONCOMMANDREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_DAEMONCOMMANDREQUESTHANDLER_H_ - -#include -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class DaemonCommandRequestHandler : public Common::RequestHandler { - private: - void requestFinished(const Common::Request &request); - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - DaemonCommandRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_DAEMONCOMMANDREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.cpp b/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.cpp deleted file mode 100644 index 547611c..0000000 --- a/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * DaemonFSInfoRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "DaemonFSInfoRequestHandler.h" -#include "../ConnectionManager.h" -#include -#include - - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void DaemonFSInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "DaemonFSInfo") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(packet["daemon"]); - Common::RequestManager::get()->sendRequest(daemonCon, - sigc::mem_fun(this, &DaemonFSInfoRequestHandler::requestFinished)); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } -} - -void DaemonFSInfoRequestHandler::requestFinished(const Common::Request &request) { - try { - sendPacket(request.getResult()); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.h b/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.h deleted file mode 100644 index 66800d8..0000000 --- a/src/Core/RequestHandlers/DaemonFSInfoRequestHandler.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * DaemonFSInfoRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_DAEMONFSINFOREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_DAEMONFSINFOREQUESTHANDLER_H_ - -#include -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class DaemonFSInfoRequestHandler : public Common::RequestHandler { - private: - void requestFinished(const Common::Request &request); - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - DaemonFSInfoRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_DAEMONFSINFOREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp b/src/Core/RequestHandlers/DaemonListRequestHandler.cpp deleted file mode 100644 index 84d3207..0000000 --- a/src/Core/RequestHandlers/DaemonListRequestHandler.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * DaemonListRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "DaemonListRequestHandler.h" -#include "../ConnectionManager.h" -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void DaemonListRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "ListHosts") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - Common::XmlPacket ret; - ret.setType("OK"); - ret.addList("hosts"); - - std::vector daemons = ConnectionManager::get()->getDaemonList(); - - for(std::vector::iterator daemon = daemons.begin(); daemon != daemons.end(); ++daemon) { - ret["hosts"].addEntry(); - - ret["hosts"].back().add("name", daemon->getName()); - ret["hosts"].back().add("address", daemon->getIP()); - ret["hosts"].back().add("state", daemon->getState()); - } - - sendPacket(ret); - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/DaemonListRequestHandler.h b/src/Core/RequestHandlers/DaemonListRequestHandler.h deleted file mode 100644 index a469603..0000000 --- a/src/Core/RequestHandlers/DaemonListRequestHandler.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * DaemonListRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_DAEMONLISTREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_DAEMONLISTREQUESTHANDLER_H_ - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class DaemonListRequestHandler : public Common::RequestHandler { - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - DaemonListRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_DAEMONLISTREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp b/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp deleted file mode 100644 index a84307b..0000000 --- a/src/Core/RequestHandlers/DaemonStatusRequestHandler.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * DaemonStatusRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "DaemonStatusRequestHandler.h" -#include "../ConnectionManager.h" -#include -#include - - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void DaemonStatusRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "GetDaemonStatus") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - std::string daemonName = packet["daemonName"]; - - try { - Common::Connection *daemonCon = ConnectionManager::get()->getDaemonConnection(daemonName); - Common::RequestManager::get()->sendRequest(daemonCon, - sigc::mem_fun(this, &DaemonStatusRequestHandler::requestFinished)); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } -} - -void DaemonStatusRequestHandler::requestFinished(const Common::Request &request) { - try { - sendPacket(request.getResult()); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/DaemonStatusRequestHandler.h b/src/Core/RequestHandlers/DaemonStatusRequestHandler.h deleted file mode 100644 index 5ef6089..0000000 --- a/src/Core/RequestHandlers/DaemonStatusRequestHandler.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * DaemonStatusRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_DAEMONSTATUSREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_DAEMONSTATUSREQUESTHANDLER_H_ - -#include -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class DaemonStatusRequestHandler : public Common::RequestHandler { - private: - void requestFinished(const Common::Request &request); - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - DaemonStatusRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_DAEMONSTATUSREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp b/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp deleted file mode 100644 index 7c2b482..0000000 --- a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - * GSSAPIAuthRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "GSSAPIAuthRequestHandler.h" -#include -#include -#include - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -// TODO Error handling - -void GSSAPIAuthRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "AuthGSSAPI") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - OM_uint32 majStat, minStat; - gss_buffer_desc recvBuffer, sendBuffer; - - // Needs error handling! - - if(gssContinue) { - const void *pkgData; - packet["authToken"].getBinaryData(&pkgData, &recvBuffer.length); - - recvBuffer.value = std::malloc(recvBuffer.length); - std::memcpy(recvBuffer.value, pkgData, recvBuffer.length); - - majStat = gss_accept_sec_context(&minStat, &gssContext, GSS_C_NO_CREDENTIAL, &recvBuffer, GSS_C_NO_CHANNEL_BINDINGS, 0, 0, &sendBuffer, 0, 0, 0); - - std::free(recvBuffer.value); - - if(majStat == GSS_S_COMPLETE) { - Common::Logger::log(Common::Logger::VERBOSE, "GSS context established."); - gssContinue = false; - } - else if(majStat != GSS_S_CONTINUE_NEEDED) { - gss_release_buffer(&minStat, &sendBuffer); - return; - } - - Common::XmlPacket ret; - ret.setType("AuthGSSAPI"); - ret.addBinary("authToken", sendBuffer.value, sendBuffer.length); - - if(!sendPacket(ret)) { - gss_release_buffer(&minStat, &sendBuffer); - return; - } - - gss_release_buffer(&minStat, &sendBuffer); - } - else if(!sentSignature) { - if(!packet["binary"].isEmpty()) - return; - - /*const gnutls_datum_t *cert = getConnection()->getCertificate(); - - recvBuffer.length = cert->size; - recvBuffer.value = cert->data;*/ - - recvBuffer.value = getConnection()->getCertificate(&recvBuffer.length); - - majStat = gss_get_mic(&minStat, gssContext, GSS_C_QOP_DEFAULT, &recvBuffer, &sendBuffer); - - if(majStat != GSS_S_COMPLETE) { - gss_release_buffer(&minStat, &sendBuffer); - return; - } - - Common::XmlPacket ret; - ret.setType("AuthGSSAPI"); - ret.addBinary("certMic", sendBuffer.value, sendBuffer.length); - - if(!sendPacket(ret)) { - gss_release_buffer(&minStat, &sendBuffer); - return; - } - - gss_release_buffer(&minStat, &sendBuffer); - - sentSignature = true; - } - else { - const void *pkgData; - packet["authToken"].getBinaryData(&pkgData, &recvBuffer.length); - - recvBuffer.value = std::malloc(recvBuffer.length); - std::memcpy(recvBuffer.value, pkgData, recvBuffer.length); - - majStat = gss_process_context_token(&minStat, gssContext, &recvBuffer); - - std::free(recvBuffer.value); - - if(majStat != GSS_S_COMPLETE) - return; - - signalFinished().emit(); - } -} - -} -} -} diff --git a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.h b/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.h deleted file mode 100644 index dd4d564..0000000 --- a/src/Core/RequestHandlers/GSSAPIAuthRequestHandler.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * GSSAPIAuthRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_GSSAPIAUTHREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_GSSAPIAUTHREQUESTHANDLER_H_ - -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class GSSAPIAuthRequestHandler : public Common::RequestHandler { - private: - gss_ctx_id_t gssContext; - - bool gssContinue, sentSignature; - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - GSSAPIAuthRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId), gssContext(GSS_C_NO_CONTEXT), gssContinue(true), sentSignature(false) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_GSSAPIAUTHREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/IdentifyRequestHandler.cpp b/src/Core/RequestHandlers/IdentifyRequestHandler.cpp deleted file mode 100644 index 235569c..0000000 --- a/src/Core/RequestHandlers/IdentifyRequestHandler.cpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - * IdentifyRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "IdentifyRequestHandler.h" -#include "../ConnectionManager.h" -#include - - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void IdentifyRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "Identify") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - try { - ConnectionManager::get()->identifyDaemonConnection(getConnection(), packet["hostname"]); - - Common::XmlPacket ret; - ret.setType("OK"); - sendPacket(ret); - } - catch(Common::Exception &e) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", e.getErrorCode()); - ret.add("SubCode", e.getSubCode()); - ret.add("SubSubCode", e.getSubSubCode()); - ret.add("Where", e.getWhere()); - - sendPacket(ret); - } - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/IdentifyRequestHandler.h b/src/Core/RequestHandlers/IdentifyRequestHandler.h deleted file mode 100644 index 016f777..0000000 --- a/src/Core/RequestHandlers/IdentifyRequestHandler.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * IdentifyRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_ - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class IdentifyRequestHandler : public Common::RequestHandler { - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - IdentifyRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_IDENTIFYREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/LogRequestHandler.cpp b/src/Core/RequestHandlers/LogRequestHandler.cpp deleted file mode 100644 index aeec7da..0000000 --- a/src/Core/RequestHandlers/LogRequestHandler.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - * LogRequestHandler.cpp - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "LogRequestHandler.h" -#include -#include -#include "../ConnectionManager.h" - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void LogRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "Log") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - try { - Common::LogManager::get()->log(packet["category"], packet["level"], packet["timestamp"], packet["message"], - ConnectionManager::get()->getDaemonName(getConnection())); - } - catch(Common::Exception &e) { - Common::Logger::logf(Common::Logger::ERROR, "Can't determine daemon name: %s", e.strerror().c_str()); - } - - Common::XmlPacket ret; - ret.setType("OK"); - - sendPacket(ret); - - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/LogRequestHandler.h b/src/Core/RequestHandlers/LogRequestHandler.h deleted file mode 100644 index c391346..0000000 --- a/src/Core/RequestHandlers/LogRequestHandler.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * LogRequestHandler.h - * - * Copyright (C) 2008 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_LOGREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_LOGREQUESTHANDLER_H_ - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class LogRequestHandler : public Common::RequestHandler { - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - LogRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_LOGREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/Makefile.am b/src/Core/RequestHandlers/Makefile.am deleted file mode 100644 index 036f936..0000000 --- a/src/Core/RequestHandlers/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -noinst_LTLIBRARIES = librequesthandlers.la -librequesthandlers_la_SOURCES = DaemonCommandRequestHandler.cpp DaemonFSInfoRequestHandler.cpp DaemonListRequestHandler.cpp DaemonStatusRequestHandler.cpp \ - GSSAPIAuthRequestHandler.cpp IdentifyRequestHandler.cpp LogRequestHandler.cpp UserInfoRequestHandler.cpp UserListRequestHandler.cpp - -noinst_HEADERS = DaemonCommandRequestHandler.h DaemonFSInfoRequestHandler.h DaemonListRequestHandler.h DaemonStatusRequestHandler.h \ - GSSAPIAuthRequestHandler.h IdentifyRequestHandler.h LogRequestHandler.h UserInfoRequestHandler.h UserListRequestHandler.h diff --git a/src/Core/RequestHandlers/Makefile.in b/src/Core/RequestHandlers/Makefile.in deleted file mode 100644 index c8ecb9c..0000000 --- a/src/Core/RequestHandlers/Makefile.in +++ /dev/null @@ -1,542 +0,0 @@ -# Makefile.in generated by automake 1.10.2 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -pkgdatadir = $(datadir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = src/Core/RequestHandlers -DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \ - $(top_srcdir)/m4/argz.m4 $(top_srcdir)/m4/ax_lib_mysql.m4 \ - $(top_srcdir)/m4/base64.m4 $(top_srcdir)/m4/cond.m4 \ - $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/extensions.m4 \ - $(top_srcdir)/m4/gettimeofday.m4 \ - $(top_srcdir)/m4/gnulib-common.m4 \ - $(top_srcdir)/m4/gnulib-comp.m4 \ - $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/lib-ld.m4 \ - $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/lock.m4 \ - $(top_srcdir)/m4/ltdl.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/sys_time_h.m4 \ - $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \ - $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -librequesthandlers_la_LIBADD = -am_librequesthandlers_la_OBJECTS = DaemonCommandRequestHandler.lo \ - DaemonFSInfoRequestHandler.lo DaemonListRequestHandler.lo \ - DaemonStatusRequestHandler.lo GSSAPIAuthRequestHandler.lo \ - IdentifyRequestHandler.lo LogRequestHandler.lo \ - UserInfoRequestHandler.lo UserListRequestHandler.lo -librequesthandlers_la_OBJECTS = $(am_librequesthandlers_la_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) -depcomp = $(SHELL) $(top_srcdir)/config/depcomp -am__depfiles_maybe = depfiles -CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(librequesthandlers_la_SOURCES) -DIST_SOURCES = $(librequesthandlers_la_SOURCES) -HEADERS = $(noinst_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -AMTAR = @AMTAR@ -AR = @AR@ -ARGZ_H = @ARGZ_H@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -CC = @CC@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DSYMUTIL = @DSYMUTIL@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@ -EMULTIHOP_VALUE = @EMULTIHOP_VALUE@ -ENOLINK_HIDDEN = @ENOLINK_HIDDEN@ -ENOLINK_VALUE = @ENOLINK_VALUE@ -EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@ -EOVERFLOW_VALUE = @EOVERFLOW_VALUE@ -ERRNO_H = @ERRNO_H@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -GREP = @GREP@ -GSSAPI_LIBS = @GSSAPI_LIBS@ -GnuTLS_CFLAGS = @GnuTLS_CFLAGS@ -GnuTLS_LIBS = @GnuTLS_LIBS@ -HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@ -HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@ -HAVE__BOOL = @HAVE__BOOL@ -INCLTDL = @INCLTDL@ -INCLUDE_NEXT = @INCLUDE_NEXT@ -INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LIBADD_DL = @LIBADD_DL@ -LIBADD_DLD_LINK = @LIBADD_DLD_LINK@ -LIBADD_DLOPEN = @LIBADD_DLOPEN@ -LIBADD_SHL_LOAD = @LIBADD_SHL_LOAD@ -LIBLTDL = @LIBLTDL@ -LIBMULTITHREAD = @LIBMULTITHREAD@ -LIBOBJS = @LIBOBJS@ -LIBPTH = @LIBPTH@ -LIBPTH_PREFIX = @LIBPTH_PREFIX@ -LIBS = @LIBS@ -LIBTHREAD = @LIBTHREAD@ -LIBTOOL = @LIBTOOL@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTDLDEPS = @LTDLDEPS@ -LTDLINCL = @LTDLINCL@ -LTDLOPEN = @LTDLOPEN@ -LTLIBMULTITHREAD = @LTLIBMULTITHREAD@ -LTLIBOBJS = @LTLIBOBJS@ -LTLIBPTH = @LTLIBPTH@ -LTLIBTHREAD = @LTLIBTHREAD@ -LT_CONFIG_H = @LT_CONFIG_H@ -LT_DLLOADERS = @LT_DLLOADERS@ -LT_DLPREOPEN = @LT_DLPREOPEN@ -MAINT = @MAINT@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MYSQL_CFLAGS = @MYSQL_CFLAGS@ -MYSQL_CONFIG = @MYSQL_CONFIG@ -MYSQL_LDFLAGS = @MYSQL_LDFLAGS@ -MYSQL_VERSION = @MYSQL_VERSION@ -NEXT_ERRNO_H = @NEXT_ERRNO_H@ -NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@ -NEXT_TIME_H = @NEXT_TIME_H@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PKG_CONFIG = @PKG_CONFIG@ -PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@ -RANLIB = @RANLIB@ -READLINE_LIBS = @READLINE_LIBS@ -REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@ -REPLACE_LOCALTIME_R = @REPLACE_LOCALTIME_R@ -REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@ -REPLACE_STRPTIME = @REPLACE_STRPTIME@ -REPLACE_TIMEGM = @REPLACE_TIMEGM@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STDBOOL_H = @STDBOOL_H@ -STRIP = @STRIP@ -SYS_TIME_H = @SYS_TIME_H@ -SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@ -TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -gl_LIBOBJS = @gl_LIBOBJS@ -gl_LTLIBOBJS = @gl_LTLIBOBJS@ -gltests_LIBOBJS = @gltests_LIBOBJS@ -gltests_LTLIBOBJS = @gltests_LTLIBOBJS@ -have_df = @have_df@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -libxml2_CFLAGS = @libxml2_CFLAGS@ -libxml2_LIBS = @libxml2_LIBS@ -localedir = @localedir@ -localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ -ltdl_LIBOBJS = @ltdl_LIBOBJS@ -ltdl_LTLIBOBJS = @ltdl_LTLIBOBJS@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -oldincludedir = @oldincludedir@ -pcrecpp_CFLAGS = @pcrecpp_CFLAGS@ -pcrecpp_LIBS = @pcrecpp_LIBS@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sharedstatedir = @sharedstatedir@ -sigc_CFLAGS = @sigc_CFLAGS@ -sigc_LIBS = @sigc_LIBS@ -srcdir = @srcdir@ -sys_symbol_underscore = @sys_symbol_underscore@ -sysconfdir = @sysconfdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = librequesthandlers.la -librequesthandlers_la_SOURCES = DaemonCommandRequestHandler.cpp DaemonFSInfoRequestHandler.cpp DaemonListRequestHandler.cpp DaemonStatusRequestHandler.cpp \ - GSSAPIAuthRequestHandler.cpp IdentifyRequestHandler.cpp LogRequestHandler.cpp UserInfoRequestHandler.cpp UserListRequestHandler.cpp - -noinst_HEADERS = DaemonCommandRequestHandler.h DaemonFSInfoRequestHandler.h DaemonListRequestHandler.h DaemonStatusRequestHandler.h \ - GSSAPIAuthRequestHandler.h IdentifyRequestHandler.h LogRequestHandler.h UserInfoRequestHandler.h UserListRequestHandler.h - -all: all-am - -.SUFFIXES: -.SUFFIXES: .cpp .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Core/RequestHandlers/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/Core/RequestHandlers/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ - dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ - test "$$dir" != "$$p" || dir=.; \ - echo "rm -f \"$${dir}/so_locations\""; \ - rm -f "$${dir}/so_locations"; \ - done -librequesthandlers.la: $(librequesthandlers_la_OBJECTS) $(librequesthandlers_la_DEPENDENCIES) - $(CXXLINK) $(librequesthandlers_la_OBJECTS) $(librequesthandlers_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DaemonCommandRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DaemonFSInfoRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DaemonListRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/DaemonStatusRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/GSSAPIAuthRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IdentifyRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/LogRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UserInfoRequestHandler.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/UserListRequestHandler.Plo@am__quote@ - -.cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< - -.cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` - -.cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$tags $$unique; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - tags=; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$tags$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$tags $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && cd $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) $$here - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ - fi; \ - cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ - else \ - test -f $(distdir)/$$file \ - || cp -p $$d/$$file $(distdir)/$$file \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-exec-am: - -install-html: install-html-am - -install-info: install-info-am - -install-man: - -install-pdf: install-pdf-am - -install-ps: install-ps-am - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/src/Core/RequestHandlers/UserInfoRequestHandler.cpp b/src/Core/RequestHandlers/UserInfoRequestHandler.cpp deleted file mode 100644 index 68356f8..0000000 --- a/src/Core/RequestHandlers/UserInfoRequestHandler.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * UserInfoRequestHandler.cpp - * - * Copyright (C) 2009 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "UserInfoRequestHandler.h" -#include "../UserManager.h" -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void UserInfoRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "GetUserInfo") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - if(!UserManager::get()->getUserInfo(packet["uid"], sigc::mem_fun(this, &UserInfoRequestHandler::userInfoHandler))) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::NOT_IMPLEMENTED); - - sendPacket(ret); - signalFinished().emit(); - } -} - -void UserInfoRequestHandler::userInfoHandler(const Common::UserInfo &info) { - Common::XmlPacket ret; - ret.setType("OK"); - - ret.add("uid", info.getUid()); - ret.add("gid", info.getGid()); - ret.add("username", info.getUsername()); - ret.add("fullName", info.getFullName()); - - sendPacket(ret); - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/UserInfoRequestHandler.h b/src/Core/RequestHandlers/UserInfoRequestHandler.h deleted file mode 100644 index b3103d4..0000000 --- a/src/Core/RequestHandlers/UserInfoRequestHandler.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * UserInfoRequestHandler.h - * - * Copyright (C) 2009 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_USERINFOREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_USERINFOREQUESTHANDLER_H_ - -#include -#include - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class UserInfoRequestHandler : public Common::RequestHandler { - private: - void userInfoHandler(const Common::UserInfo &info); - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - UserInfoRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_USERINFOREQUESTHANDLER_H_ */ diff --git a/src/Core/RequestHandlers/UserListRequestHandler.cpp b/src/Core/RequestHandlers/UserListRequestHandler.cpp deleted file mode 100644 index 8a61cbd..0000000 --- a/src/Core/RequestHandlers/UserListRequestHandler.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* - * UserListRequestHandler.cpp - * - * Copyright (C) 2009 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#include "UserListRequestHandler.h" -#include "../UserManager.h" -#include -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -void UserListRequestHandler::handlePacket(const Common::XmlPacket &packet) { - if(packet.getType() != "ListUsers") { - Common::Logger::log(Common::Logger::ERROR, "Received an unexpected packet."); - - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::UNEXPECTED_PACKET); - - sendPacket(ret); - - signalFinished().emit(); - return; - } - - // TODO Require authentication - - if(!UserManager::get()->getUserList(sigc::mem_fun(this, &UserListRequestHandler::userListHandler))) { - Common::XmlPacket ret; - ret.setType("Error"); - ret.add("ErrorCode", Common::Exception::NOT_IMPLEMENTED); - - sendPacket(ret); - signalFinished().emit(); - } -} - -void UserListRequestHandler::userListHandler(const std::map &info) { - Common::XmlPacket ret; - ret.setType("OK"); - ret.addList("users"); - - for(std::map::const_iterator user = info.begin(); user != info.end(); ++user) { - ret["users"].addEntry(); - Common::XmlPacket::Entry &entry = ret["users"].back(); - - entry.add("uid", user->second.getUid()); - entry.add("gid", user->second.getGid()); - entry.add("username", user->second.getUsername()); - entry.add("fullName", user->second.getFullName()); - } - - sendPacket(ret); - signalFinished().emit(); -} - -} -} -} diff --git a/src/Core/RequestHandlers/UserListRequestHandler.h b/src/Core/RequestHandlers/UserListRequestHandler.h deleted file mode 100644 index e31da67..0000000 --- a/src/Core/RequestHandlers/UserListRequestHandler.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * UserListRequestHandler.h - * - * Copyright (C) 2009 Matthias Schiffer - * - * This program is free software: you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see . - */ - -#ifndef MAD_CORE_REQUESTHANDLERS_USERLISTREQUESTHANDLER_H_ -#define MAD_CORE_REQUESTHANDLERS_USERLISTREQUESTHANDLER_H_ - -#include -#include - -#include - -namespace Mad { -namespace Core { -namespace RequestHandlers { - -class UserListRequestHandler : public Common::RequestHandler { - private: - void userListHandler(const std::map &info); - - protected: - virtual void handlePacket(const Common::XmlPacket &packet); - - public: - UserListRequestHandler(Common::Connection *connection, uint16_t requestId) - : RequestHandler(connection, requestId) {} -}; - -} -} -} - -#endif /* MAD_CORE_REQUESTHANDLERS_USERLISTREQUESTHANDLER_H_ */ -- cgit v1.2.3