[cpp-sp COMMIT] in /branches/REL_2/shibd: shibd.cpp shibd_win32.cpp

noreply at shibboleth.net noreply at shibboleth.net
Mon Oct 29 14:35:15 EDT 2012


Author: scantor
Date: Mon Oct 29 14:35:14 2012
New Revision: 3810

URL: http://svn.shibboleth.net/view/cpp-sp?rev=3810&view=rev
Log:
https://issues.shibboleth.net/jira/browse/SSPCPP-505

Modified:
    branches/REL_2/shibd/shibd.cpp
    branches/REL_2/shibd/shibd_win32.cpp

Modified: branches/REL_2/shibd/shibd.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibd/shibd.cpp?rev=3810&r1=3809&r2=3810&view=diff
==============================================================================
--- branches/REL_2/shibd/shibd.cpp (original)
+++ branches/REL_2/shibd/shibd.cpp Mon Oct 29 14:35:14 2012
@@ -110,9 +110,14 @@
 
 int real_main(int preinit)
 {
-    SPConfig& conf=SPConfig::getConfig();
+    if (shar_version) {
+        if (preinit)
+            fprintf(stdout, PACKAGE_STRING"\n");
+        return 0;
+    }
+
+    SPConfig& conf = SPConfig::getConfig();
     if (preinit) {
-
         // Initialize the SP library.
         conf.setFeatures(
             SPConfig::Listener |

Modified: branches/REL_2/shibd/shibd_win32.cpp
URL: http://svn.shibboleth.net/view/cpp-sp/branches/REL_2/shibd/shibd_win32.cpp?rev=3810&r1=3809&r2=3810&view=diff
==============================================================================
--- branches/REL_2/shibd/shibd_win32.cpp (original)
+++ branches/REL_2/shibd/shibd_win32.cpp Mon Oct 29 14:35:14 2012
@@ -38,6 +38,7 @@
 extern const char* shar_config;
 extern const char* shar_prefix;
 extern bool shar_checkonly;
+extern bool shar_version;
 
 // internal variables
 SERVICE_STATUS          ssStatus;       // current status of the service
@@ -122,7 +123,13 @@
         {
             i++;
             bConsole = TRUE;
-            shar_checkonly=true;
+            shar_checkonly = true;
+        }
+        else if (_stricmp( "version", argv[i]+1) == 0)
+        {
+            i++;
+            bConsole = TRUE;
+            shar_version = true;
         }
         else if (_stricmp( "config", argv[i]+1) == 0)
         {
@@ -177,6 +184,7 @@
         printf("%s -remove <name>    to remove the named service\n", argv[0]);
         printf("%s -console          to run as a console app for debugging\n", argv[0]);
         printf("%s -check            to run as a console app and check configuration\n", argv[0]);
+        printf("%s -version          to run as a console app and print the version\n", argv[0]);
         printf("\t-stdout <path> to redirect stdout stream\n");
         printf("\t-stderr <path> to redirect stderr stream\n");
         printf("\t-prefix <dir> to specify the installation directory\n");



More information about the commits mailing list