]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: warn on suspicious civetweb frontend parameters 7414/head
authorMatt Benjamin <mbenjamin@redhat.com>
Tue, 15 Dec 2015 16:28:44 +0000 (11:28 -0500)
committerLoic Dachary <ldachary@redhat.com>
Fri, 29 Jan 2016 04:58:12 +0000 (11:58 +0700)
Warns about incorrect spacing near 'port' (e.g., 'port = 80').

Fixes issue #12038.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 93497e576a946ed7e59f4a4299e447b65aa1774b)

src/rgw/rgw_main.cc

index 0ddd9de272e0506daa063dbec1053de0041194bf..fc12a7046dad50a82c1775924ca8b24e117dd13f 100644 (file)
@@ -1165,6 +1165,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) {