Skip to content

Commit

Permalink
cluster: set owner to current user when decompressing tarballs (#713)
Browse files Browse the repository at this point in the history
  • Loading branch information
AstroProfundis authored Aug 26, 2020
1 parent 91c5f94 commit 104839b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion components/dm/spec/grafana.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (i *GrafanaInstance) Deploy(t *task.Builder, srcPath string, deployDir stri
return errors.AddStack(err)
}

cmd := fmt.Sprintf(`tar -xzf %s -C %s && rm %s`, dstPath, tmp, dstPath)
cmd := fmt.Sprintf(`tar --no-same-owner -zxf %s -C %s && rm %s`, dstPath, tmp, dstPath)
_, stderr, err = e.Execute(cmd, false)
if err != nil {
return errors.Annotatef(err, "stderr: %s", string(stderr))
Expand Down
2 changes: 1 addition & 1 deletion components/dm/spec/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (i *MonitorInstance) Deploy(t *task.Builder, srcPath string, deployDir stri
return errors.AddStack(err)
}

cmd := fmt.Sprintf(`tar -xzf %s -C %s && rm %s`, dstPath, tmp, dstPath)
cmd := fmt.Sprintf(`tar --no-same-owner -zxf %s -C %s && rm %s`, dstPath, tmp, dstPath)
_, stderr, err = e.Execute(cmd, false)
if err != nil {
return errors.Annotatef(err, "stderr: %s", string(stderr))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/operation/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func GetNodeInfo(
}

// get node info by exec _telemetry node_info at remote instance.
cmd := fmt.Sprintf(`tar -xzf %s -C %s && rm %s`, dstPath, dstDir, dstPath)
cmd := fmt.Sprintf(`tar --no-same-owner -zxf %s -C %s && rm %s`, dstPath, dstDir, dstPath)
_, stderr, err := exec.Execute(cmd, false)
if err != nil {
return errors.Annotatef(err, "stderr: %s", string(stderr))
Expand Down
2 changes: 1 addition & 1 deletion pkg/cluster/task/install_package.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (c *InstallPackage) Execute(ctx *Context) error {
return errors.Annotatef(err, "failed to scp %s to %s:%s", c.srcPath, c.host, dstPath)
}

cmd := fmt.Sprintf(`tar -xzf %s -C %s && rm %s`, dstPath, dstDir, dstPath)
cmd := fmt.Sprintf(`tar --no-same-owner -zxf %s -C %s && rm %s`, dstPath, dstDir, dstPath)

_, stderr, err := exec.Execute(cmd, false)
if err != nil {
Expand Down

0 comments on commit 104839b

Please sign in to comment.