From 596143a286079338c30c8abc4b862f8d6ddddb3a Mon Sep 17 00:00:00 2001 From: Aravinda VK Date: Mon, 29 Jan 2018 12:42:51 +0530 Subject: 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: 1539545 Change-Id: Ia7eb39e36ed59ece4de65ea7ec71a0f615e338bb Signed-off-by: Aravinda VK --- geo-replication/src/gsyncd.c | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'geo-replication') 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); -- cgit