kubernetes/pkg/kubectl
Kubernetes Submit Queue 6acfda8a85
Merge pull request #64573 from juanvallejo/jvallejo/remove-extraneous-path-shortcuts
Automatic merge from submit-queue (batch tested with PRs 64613, 64596, 64573, 64154, 64639). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove extra "../" when copying from pod to local

**Release note**:
```release-note
NONE
```

Copying via `kubectl cp` from a pod to local will no longer panic if any received tar headers contain an extra "../". This can happen when specifying a remote location beyond "/" - for example:

```
# I am attempting to go backwards beyond "/"
$ kubectl cp mypod:/one/two/../../../etc/hosts ./
```

The above command results in a tar header containing an extra "../" in its name (../etc/hosts), causing a panic [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/cp.go#L388).

Related downstream bug: https://bugzilla.redhat.com/show_bug.cgi?id=1584555

cc @soltysh
2018-06-02 06:30:16 -07:00
..
apply
apps
cmd Merge pull request #64573 from juanvallejo/jvallejo/remove-extraneous-path-shortcuts 2018-06-02 06:30:16 -07:00
explain
genericclioptions Merge pull request #64453 from deads2k/cli-73-resourcebuidlerflags 2018-05-30 08:42:29 -07:00
metricsutil
plugins
polymorphichelpers
proxy
scheme
util cleanup some dead kubectl code and narrow scope of helpers 2018-05-29 12:44:53 -04:00
validation
.import-restrictions Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00
apply.go
autoscale.go
autoscale_test.go
BUILD
clusterrolebinding.go
clusterrolebinding_test.go
conditions.go
configmap.go
configmap_test.go
deployment.go
deployment_test.go
doc.go
env_file.go
env_file_test.go
generate.go
generate_test.go
history.go
history_test.go
interfaces.go
namespace.go
namespace_test.go
OWNERS
pdb.go
pdb_test.go
priorityclass.go
priorityclass_test.go
quota.go
quota_test.go
rolebinding.go
rolebinding_test.go
rollback.go
rollback_test.go
rolling_updater.go
rolling_updater_test.go
rollout_status.go
rollout_status_test.go
run.go
run_test.go
scale.go
scale_test.go
secret.go
secret_for_docker_registry.go
secret_for_docker_registry_test.go
secret_for_tls.go
secret_for_tls_test.go
secret_test.go
service.go
service_basic.go
service_basic_test.go
service_test.go
serviceaccount.go
serviceaccount_test.go
sorter.go
sorter_test.go