From: Matt Benjamin Date: Tue, 15 Dec 2015 16:28:44 +0000 (-0500) Subject: rgw: warn on suspicious civetweb frontend parameters X-Git-Tag: v0.94.7~34^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ad4df3be0f4adba5e8e14829be724fa3a92263c8;p=ceph.git rgw: warn on suspicious civetweb frontend parameters Warns about incorrect spacing near 'port' (e.g., 'port = 80'). Fixes issue #12038. Signed-off-by: Matt Benjamin (cherry picked from commit 93497e576a946ed7e59f4a4299e447b65aa1774b) --- diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 0ddd9de272e..fc12a7046da 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -1165,6 +1165,16 @@ int main(int argc, const char **argv) for (list::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) {