]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: warn on suspicious civetweb frontend parameters 6944/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 15 Dec 2015 16:28:44 +0000 (11:28 -0500)
committerMatt Benjamin <mbenjamin@redhat.com>
Tue, 22 Dec 2015 16:28:45 +0000 (11:28 -0500)
Warns about incorrect spacing near 'port' (e.g., 'port = 80').

Fixes issue #12038.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
src/rgw/rgw_main.cc

index 2246b6a40ea11b598e09a422e8dde714b57afd1a..9bbf31a0a34ce12712c385422b52742372b884aa 100644 (file)
@@ -1168,6 +1168,16 @@ int main(int argc, const char **argv)
   for (list<string>::iterator iter = frontends.begin(); iter != frontends.end(); ++iter) {
     string& f = *iter;
 
+    if (f.find("civetweb") != string::npos) {
+      if (f.find("port") != string::npos) {
+       // check for the most common ws problems
+       if ((f.find("port=") == string::npos) ||
+           (f.find("port= ") != string::npos)) {
+         derr << "WARNING: civetweb frontend config found unexpected spacing around 'port' (ensure civetweb port parameter has the form 'port=80' with no spaces before or after '=')" << dendl;
+       }
+      }
+    }
+
     RGWFrontendConfig *config = new RGWFrontendConfig(f);
     int r = config->init();
     if (r < 0) {