mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-02 14:51:58 +00:00
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