myserver-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-373


From: Giuseppe Scrivano
Subject: [myserver-commit] [SCM] GNU MyServer branch, master, updated. v0.9.2-373-g8249ef2
Date: Fri, 27 Aug 2010 13:34:59 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU MyServer".

The branch, master has been updated
       via  8249ef25c77a6121f27fa55f4f74c50e9d300600 (commit)
       via  6fa1707fe728ce7dd36ac37e782cf48a1f4438c4 (commit)
       via  ea4e11eb0144ec86c1cb2b1f663d6481d7f6dd29 (commit)
      from  05a98093a733cb9e92f29bffeb1a652c6c16fb3d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------


commit 8249ef25c77a6121f27fa55f4f74c50e9d300600
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Aug 27 15:19:51 2010 +0200

    Control: Use special names to access configuration files.

diff --git a/myserver/include/protocol/control/control_protocol.h 
b/myserver/include/protocol/control/control_protocol.h
index 70b5c90..8efa361 100644
--- a/myserver/include/protocol/control/control_protocol.h
+++ b/myserver/include/protocol/control/control_protocol.h
@@ -45,7 +45,7 @@ protected:
   static char adminLogin[64];
   static char adminPassword[64];
   static int controlEnabled;
-
+  const char *mapPath (const char *path);
   int checkAuth (ControlHeader&);
   int showConnections (ConnectionPtr,File* out, char *b1,int bs1, 
ControlHeader&);
   int showDynamicProtocols (ConnectionPtr,File* out, char *b1,int bs1, 
ControlHeader&);
diff --git a/myserver/include/server/server.h b/myserver/include/server/server.h
index e9a7038..ac05fdd 100644
--- a/myserver/include/server/server.h
+++ b/myserver/include/server/server.h
@@ -173,6 +173,10 @@ public:
   MainConfiguration *getConfiguration ();
   CryptAlgoManager *getCryptAlgoManager () {return &cryptAlgoManager;}
 
+  const char *getMainConfigurationFile () {return mainConfigurationFile.c_str 
();}
+  const char *getVhostConfigurationFile () {return 
vhostConfigurationFile.c_str ();}
+  const char *getMimeConfigurationFile () {return mimeConfigurationFile.c_str 
();}
+
 private:
   XmlValidator *xmlValidator;
   VhostManagerHandler *vhostHandler;
diff --git a/myserver/src/GUI/MyServer/pycontrollib/controller.py 
b/myserver/src/GUI/MyServer/pycontrollib/controller.py
index 64cb7c6..69affff 100644
--- a/myserver/src/GUI/MyServer/pycontrollib/controller.py
+++ b/myserver/src/GUI/MyServer/pycontrollib/controller.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-
 '''
 MyServer
-Copyright (C) 2009 Free Software Foundation, Inc.
+Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 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
@@ -122,24 +122,24 @@ class BasicController():
 class Controller(BasicController):
     def get_MIME_type_configuration(self):
         '''Get MIME types settings.'''
-        return MIMETypes.from_string(self.get_file('mimetypes.xml'))
+        return MIMETypes.from_string(self.get_file('&&&mime'))
 
     def get_vhost_configuration(self):
         '''Get VHosts settings.'''
-        return VHosts.from_string(self.get_file('virtualhosts.xml'))
+        return VHosts.from_string(self.get_file('&&&vhost'))
 
     def get_server_configuration(self):
         '''Get server settings.'''
-        return MyServerConfig.from_string(self.get_file('myserver.xml'))
+        return MyServerConfig.from_string(self.get_file('&&&server'))
 
     def put_MIME_type_configuration(self, config):
         '''Put MIME types settings.'''
-        self.put_file(str(config), 'mimetypes.xml')
+        self.put_file(str(config), '&&&mime')
 
     def put_vhost_configuration(self, config):
         '''Put VHost settings.'''
-        self.put_file(str(config), 'virtualhosts.xml')
+        self.put_file(str(config), '&&&vhost')
 
     def put_server_configuration(self, config):
         '''Put server settings.'''
-        self.put_file(str(config), 'myserver.xml')
+        self.put_file(str(config), '&&&server')
diff --git a/myserver/src/protocol/control/control_protocol.cpp 
b/myserver/src/protocol/control/control_protocol.cpp
index 56f928e..bcadb9e 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -593,7 +593,7 @@ int ControlProtocol::getFile (ConnectionPtr a, char *fn, 
File *in, File *out,
   /* # of bytes written.  */
   size_t nbw = 0;
 
-  filename = fn;
+  filename = mapPath (fn);
 
   ret = localfile.openFile (filename, File::READ | File::OPEN_IF_EXISTS);
 
@@ -644,7 +644,7 @@ int ControlProtocol::putFile (ConnectionPtr a, char *fn, 
File *in,
   size_t nbw = 0;
   Server::getInstance ()->disableAutoReboot ();
 
-  filename = fn;
+  filename = mapPath (fn);
 
   localfile.openFile (filename, File::WRITE | File::FILE_OPEN_ALWAYS);
   localfile.truncate (0);
@@ -685,3 +685,17 @@ int ControlProtocol::getVersion (ConnectionPtr a, File 
*out, char *buffer,
   myserver_strlcpy (buffer, MYSERVER_VERSION, bufferSize);
   return out->writeToFile (buffer, strlen (buffer), &nbw);
 }
+
+const char *ControlProtocol::mapPath (const char *path)
+{
+  if (!strcmp (path, "&&&server"))
+    return Server::getInstance ()->getMainConfigurationFile ();
+
+  if (!strcmp (path, "&&&vhost"))
+    return Server::getInstance ()->getVhostConfigurationFile ();
+
+  if (!strcmp (path, "&&&mime"))
+    return Server::getInstance ()->getMimeConfigurationFile ();
+
+  return path;
+}



commit 6fa1707fe728ce7dd36ac37e782cf48a1f4438c4
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Aug 27 14:58:05 2010 +0200

    ControlProtocol: use FilesUtility::temporaryFileName to generate temporary 
file name.

diff --git a/myserver/src/protocol/control/control_protocol.cpp 
b/myserver/src/protocol/control/control_protocol.cpp
index 3558f58..56f928e 100644
--- a/myserver/src/protocol/control/control_protocol.cpp
+++ b/myserver/src/protocol/control/control_protocol.cpp
@@ -194,8 +194,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
   int ret;
   int realHeaderLength;
   int dataWritten = 0;
-  ostringstream inFilePath;
-  ostringstream outFilePath;
+  string inFilePath;
+  string outFilePath;
   size_t nbw;
   int specifiedLength;
   char *version = 0;
@@ -251,9 +251,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
       timeout = getTicks ();
       if (specifiedLength)
         {
-          inFilePath << getdefaultwd (0,0) << "/ControlInput_" << (u_int) id;
-
-          inFile.createTemporaryFile (inFilePath.str ().c_str ());
+          FilesUtility::temporaryFileName (id, inFilePath);
+          inFile.createTemporaryFile (inFilePath.c_str ());
 
           if (nbtr - realHeaderLength)
             {
@@ -285,7 +284,7 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
                   sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, 
header,
                                 0);
                   inFile.close ();
-                  FilesUtility::deleteFile (inFilePath.str ().c_str ());
+                  FilesUtility::deleteFile (inFilePath.c_str ());
                   return 0;
                 }
               else
@@ -293,13 +292,11 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
             }
         }
 
-      inFile.seek (0);
-
       if (strcasecmp (version, "CONTROL/1.0"))
         {
           a->host->warningsLogWrite (_("Control: specified version not 
supported"));
           inFile.close ();
-          FilesUtility::deleteFile (inFilePath.str ().c_str ());
+          FilesUtility::deleteFile (inFilePath.c_str ());
           sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_VERSION, header, 
0);
           return 0;
         }
@@ -312,7 +309,7 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
       if (authorized == 0)
         {
           inFile.close ();
-          FilesUtility::deleteFile (inFilePath.str ().c_str ());
+          FilesUtility::deleteFile (inFilePath.c_str ());
           sendResponse (auxBuffer, bufferSize, a, CONTROL_AUTH, header, 0);
           return 0;
         }
@@ -323,7 +320,7 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
       if (dataWritten != specifiedLength)
         {
           inFile.close ();
-          FilesUtility::deleteFile (inFilePath.str ().c_str ());
+          FilesUtility::deleteFile (inFilePath.c_str ());
           sendResponse (auxBuffer, bufferSize, a, CONTROL_BAD_LEN, header, 0);
           return 0;
         }
@@ -334,10 +331,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
       knownCommand = 0;
 
       /* Create an out file. This can be used by commands needing it. */
-      outFilePath << getdefaultwd (0, 0) << "/ControlOutput_" << (u_int) id;
-
-      outFile.createTemporaryFile (outFilePath.str ().c_str ());
-
+      FilesUtility::temporaryFileName (id, outFilePath);
+      outFile.createTemporaryFile (outFilePath.c_str ());
       if (!strcmp (command, "SHOWCONNECTIONS"))
         {
           knownCommand = 1;
@@ -401,8 +396,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
           inFile.close ();
           outFile.close ();
 
-          FilesUtility::deleteFile (inFilePath.str ().c_str ());
-          FilesUtility::deleteFile (outFilePath.str ().c_str ());
+          FilesUtility::deleteFile (inFilePath.c_str ());
+          FilesUtility::deleteFile (outFilePath.c_str ());
           connection = header.getConnection ();
 
           /*
@@ -421,8 +416,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
 
           inFile.close ();
           outFile.close ();
-          FilesUtility::deleteFile (inFilePath.str ().c_str ());
-          FilesUtility::deleteFile (outFilePath.str ().c_str ());
+          FilesUtility::deleteFile (inFilePath.c_str ());
+          FilesUtility::deleteFile (outFilePath.c_str ());
 
           return ClientsThread::DELETE_CONNECTION;
         }
@@ -431,8 +426,8 @@ int ControlProtocol::controlConnection (ConnectionPtr a, 
char *request,
     {
       inFile.close ();
       outFile.close ();
-      FilesUtility::deleteFile (inFilePath.str ().c_str ());
-      FilesUtility::deleteFile (outFilePath.str ().c_str ());
+      FilesUtility::deleteFile (inFilePath.c_str ());
+      FilesUtility::deleteFile (outFilePath.c_str ());
       a->host->warningsLogWrite (_E ("Control: internal error"), &e);
       return ClientsThread::DELETE_CONNECTION;
     }
@@ -581,8 +576,6 @@ int ControlProtocol::visitConnection (ConnectionPtr con, 
void *argP)
   return 0;
 }
 
-
-
 /*!
   Return the requested file to the client.
  */



commit ea4e11eb0144ec86c1cb2b1f663d6481d7f6dd29
Author: Giuseppe Scrivano <address@hidden>
Date:   Fri Aug 27 14:33:45 2010 +0200

    Use root as default system administrator name.

diff --git a/myserver/binaries/myserver.default.xml 
b/myserver/binaries/myserver.default.xml
index 921eab1..e0635ff 100755
--- a/myserver/binaries/myserver.default.xml
+++ b/myserver/binaries/myserver.default.xml
@@ -64,7 +64,7 @@
   <DEFINE name="http.dir.css" value="/sys/css/browsestyle.css" />
 
   <!--DEFINE THE ADMINISTRATOR E-MAIL-->
-  <DEFINE name="server.admin" value="address@hidden" />
+  <DEFINE name="server.admin" value="address@hidden" />
 
   <!--DEFINE THE GZIP COMPRESSION THRESHOLD VALUE-->
   <DEFINE name="gzip.threshold" value="1048576" />

-----------------------------------------------------------------------

Summary of changes:
 myserver/binaries/myserver.default.xml             |    2 +-
 .../include/protocol/control/control_protocol.h    |    2 +-
 myserver/include/server/server.h                   |    4 ++
 .../src/GUI/MyServer/pycontrollib/controller.py    |   14 +++---
 myserver/src/protocol/control/control_protocol.cpp |   57 +++++++++++---------
 5 files changed, 45 insertions(+), 34 deletions(-)


hooks/post-receive
-- 
GNU MyServer



reply via email to

[Prev in Thread] Current Thread [Next in Thread]