summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2018-01-29 12:42:51 +0530
committerShyamsundar Ranganathan <srangana@redhat.com>2018-01-30 18:36:10 +0000
commit55f63e2cc971873ec0eacb4425fc6bf22cb46b62 (patch)
treef98a87636ef8c1bcf6d3b6b8302978fd4c03330f
parentea972d9f5c9b318429c228108c21a334b4acd95c (diff)
geo-rep: Remove unused working directory check in gsyncd
To append the default config file path, gsyncd calls gluster command to get the workdir path and constructs config file path. This is not required now since the Config management in Geo-replication is changed with patch 18257(Issue #73) BUG: 1539701 Change-Id: Ia7eb39e36ed59ece4de65ea7ec71a0f615e338bb Signed-off-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit 596143a286079338c30c8abc4b862f8d6ddddb3a)
-rw-r--r--geo-replication/src/gsyncd.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/geo-replication/src/gsyncd.c b/geo-replication/src/gsyncd.c
index 2c48ca5d540..df2ee35b037 100644
--- a/geo-replication/src/gsyncd.c
+++ b/geo-replication/src/gsyncd.c
@@ -111,44 +111,11 @@ str2argv (char *str, char ***argv)
static int
invoke_gsyncd (int argc, char **argv)
{
- char config_file[PATH_MAX] = {0,};
- size_t gluster_workdir_len = 0;
- runner_t runner = {0,};
int i = 0;
int j = 0;
char *nargv[argc + 4];
char *python = NULL;
- if (restricted) {
- size_t len;
- /* in restricted mode we forcibly use the system-wide config */
- runinit (&runner);
- runner_add_args (&runner, SBIN_DIR"/gluster",
- "--remote-host=localhost",
- "--log-file=-", "system::", "getwd",
- NULL);
- runner_redir (&runner, STDOUT_FILENO, RUN_PIPE);
- if (runner_start (&runner) == 0 &&
- fgets (config_file, PATH_MAX,
- runner_chio (&runner, STDOUT_FILENO)) != NULL &&
- (len = strlen (config_file)) &&
- config_file[len - 1] == '\n' &&
- runner_end (&runner) == 0)
- gluster_workdir_len = len - 1;
-
- if (gluster_workdir_len) {
- if (gluster_workdir_len + 1 + strlen (GSYNCD_CONF_TEMPLATE) + 1 >
- PATH_MAX)
- goto error;
- config_file[gluster_workdir_len] = '/';
- strcat (config_file, GSYNCD_CONF_TEMPLATE);
- } else
- goto error;
-
- if (setenv ("_GSYNCD_RESTRICTED_", "1", 1) == -1)
- goto error;
- }
-
if (chdir ("/") == -1)
goto error;
@@ -160,10 +127,7 @@ invoke_gsyncd (int argc, char **argv)
nargv[j++] = GSYNCD_PREFIX"/python/syncdaemon/"GSYNCD_PY;
for (i = 1; i < argc; i++)
nargv[j++] = argv[i];
- if (config_file[0]) {
- nargv[j++] = "-c";
- nargv[j++] = config_file;
- }
+
nargv[j++] = NULL;
execvp (python, nargv);