summaryrefslogtreecommitdiff
path: root/cmd/podman/cp.go
Commit message (Collapse)AuthorAge
* Podman V2 birthBrent Baude2020-04-16
| | | | | | remote podman v1 and replace with podman v2. Signed-off-by: Brent Baude <bbaude@redhat.com>
* make lint: enable gocriticValentin Rothberg2020-01-13
| | | | | | | `gocritic` is a powerful linter that helps in preventing certain kinds of errors as well as enforcing a coding style. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* cp: drop check for rootlessGiuseppe Scrivano2020-01-10
| | | | | | | | | | | | | | | | | | | | rootless containers can use pause on cgroups v2. Whether it is possible or not to use pause depends from multiple conditions, such as: - be on a cgroup v2 unified hierarchy, - using systemd cgroup manager, - the kernel has the freezer controller, The last one may fail for root as well. Instead of trying to catch all the possible conditions in Podman, let the OCI runtime complain if pause cannot be performed. Closes: https://github.com/containers/libpod/issues/4813 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* fix bug copy from container directoryQi Wang2020-01-02
| | | | | | Keep the original input source path with "/." so podman can copy the content of the directory when copying from container to host. Signed-off-by: Qi Wang <qiwan@redhat.com>
* codespell: spelling correctionsDmitry Smirnov2019-11-13
| | | | Signed-off-by: Dmitry Smirnov <onlyjob@member.fsf.org>
* Fix cp from pipeAleksey Chudov2019-10-30
| | | | Signed-off-by: Aleksey Chudov <aleksey.chudov@gmail.com>
* fix cp none exists dest path ends with '/'Qi Wang2019-09-25
| | | | | | | close #3894 This patch let podman cp return 'no such file or directory' error if DEST_PATH does not exist and ends with / when copying file. Signed-off-by: Qi Wang <qiwan@redhat.com>
* Fix default to pause in podman cpDaniel J Walsh2019-09-13
| | | | | | | | We want to default to secure when running containers as root, in rootless, we need to change the default if the system does not support cgroup v1. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* Do not support wildcards on cpJhon Honce2019-09-12
| | | | | | | * symlink processing and wildcarding led to unexpected files being copied Signed-off-by: Jhon Honce <jhonce@redhat.com>
* podman-remote: cp crashesbaude2019-08-21
| | | | | | | | | | prune unwanted messages when running a container remotely. also, cp is not remote-enabled yet and as such should not be available on the remote client. Fixes: #3861 Signed-off-by: baude <bbaude@redhat.com>
* fix copy change file owner if cp from containerQi Wang2019-08-08
| | | | | | If copies file from container to local machine, change the file owner to the cp command caller. Signed-off-by: Qi Wang <qiwan@redhat.com>
* golangci-lint round #3baude2019-07-21
| | | | | | | this is the third round of preparing to use the golangci-lint on our code base. Signed-off-by: baude <bbaude@redhat.com>
* first pass of corrections for golangci-lintbaude2019-07-10
| | | | Signed-off-by: baude <bbaude@redhat.com>
* trivial cleanups from golangbaude2019-07-03
| | | | | | the results of a code cleanup performed by the goland IDE. Signed-off-by: baude <bbaude@redhat.com>
* libpod removal from main (phase 2)baude2019-06-27
| | | | | | this is phase 2 for the removal of libpod from main. Signed-off-by: baude <bbaude@redhat.com>
* Merge pull request #3419 from baude/removelibpodfrommainphase1OpenShift Merge Robot2019-06-26
|\ | | | | remove libpod from main
| * remove libpod from mainbaude2019-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | | the compilation demands of having libpod in main is a burden for the remote client compilations. to combat this, we should move the use of libpod structs, vars, constants, and functions into the adapter code where it will only be compiled by the local client. this should result in cleaner code organization and smaller binaries. it should also help if we ever need to compile the remote client on non-Linux operating systems natively (not cross-compiled). Signed-off-by: baude <bbaude@redhat.com>
* | fix bug creats directory copying fileQi Wang2019-06-20
|/ | | | | | close #3384 Signed-off-by: Qi Wang <qiwan@redhat.com>
* Merge pull request #3094 from QiWang19/cpvolOpenShift Merge Robot2019-06-15
|\ | | | | podman copy files to the volume with a container
| * podman copy files to the volume with a containerQi Wang2019-06-03
| | | | | | | | | | | | | | enabls podman to cpoy files between the host machine and the volume related with a container. Close #3059 Signed-off-by: Qi Wang <qiwan@redhat.com>
* | Default 'pause' to false for 'podman cp'Matthew Heon2019-06-07
| | | | | | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* | Vendor Buildah v1.8.3TomSweeneyRedHat2019-06-04
|/ | | | | | Vendor in Buildah v1.8.3 Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
* Error when trying to copy into a running rootless ctrMatthew Heon2019-05-30
| | | | | | We can't pause them, so if that's requested, throw an error. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* We can't pause rootless containers during cpMatthew Heon2019-05-29
| | | | | | | | | Rootless containers can't be paused (no CGroups, so no freezer). We could try and emulate this with a SIGSTOP to all PIDs in the container, but that's inherently racy, so let's avoid it for now. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Tolerate non-running containers in paused cpMatthew Heon2019-05-29
| | | | Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Pause containers while copying into themMatthew Heon2019-05-29
| | | | | | Should fix CVE-2018-15664 for Podman. Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* Use securejoin to merge paths in `podman cp`Matthew Heon2019-05-29
| | | | | | | | | Securejoin ensures that paths are resolved in the container, not on the host. Fixes #3211 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
* fix bug dest path of copying tarQi Wang2019-05-24
| | | | | | when podman cp tar without --extract flag, if the destination already exists, or ends with path seprator, cp the tar under the directory, otherwise copy the tar named with the destination Signed-off-by: Qi Wang <qiwan@redhat.com>
* implement cp reads tar file from stdin/stdoutQi Wang2019-05-09
| | | | | | enables podman cp uses - to stream a tar archive from STDIN or to STDOUT. Signed-off-by: Qi Wang <qiwan@redhat.com>
* runtime: pass down the contextGiuseppe Scrivano2019-04-26
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* Fix segfaults attribute to missing optionsbaude2019-04-15
| | | | | | | | | In cases where the remote client culls options to a command, we need to be sure that the lookup for that flag does not result in a nil pointer. To do so, we add a Remote attribute to the podman struct and then cli helper funcs are now aware they are remote. Signed-off-by: baude <bbaude@redhat.com>
* fix bug podman cp directoryQi Wang2019-04-04
| | | | | | | | | | | | | | | | | | | | | `podman cp` used to copy the contents under the source directory to the destination. But according to the specification in podman-cp.md. it should copy the whole directory to the destination if the destination directory already exists. - src dir ends with /., copy the contents to dest dir - src dir does not end with /. - dest dir /home does not exist, copy the contents - dest dir /home exists, copy the directory ``` $ sudo podman cp /home/qiwan/Documents/empty 7c47:/home $ sudo podman exec -it 7c47 ls /home $ $ sudo podman cp /home/qiwan/Documents/empty 7c47:/home $ sudo podman exec -it 7c47 ls /home empty ``` Signed-off-by: Qi Wang <qiwan@redhat.com>
* rootless: use a single user namespaceGiuseppe Scrivano2019-04-01
| | | | | | | | | | | | | | | | | | | | | simplify the rootless implementation to use a single user namespace for all the running containers. This makes the rootless implementation behave more like root Podman, where each container is created in the host environment. There are multiple advantages to it: 1) much simpler implementation as there is only one namespace to join. 2) we can join namespaces owned by different containers. 3) commands like ps won't be limited to what container they can access as previously we either had access to the storage from a new namespace or access to /proc when running from the host. 4) rootless varlink works. 5) there are only two ways to enter in a namespace, either by creating a new one if no containers are running or joining the existing one from any container. Containers created by older Podman versions must be restarted. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* rootless: remove SkipStorageSetup()Giuseppe Scrivano2019-04-01
| | | | | | | | in the few places where we care about skipping the storage initialization, we can simply use the process effective UID, instead of relying on a global boolean flag. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* vendor buildah, image, storage, cniValentin Rothberg2019-03-28
| | | | Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
* Fix help commands to show short and long description.Daniel J Walsh2019-03-07
| | | | | | Cleanup lots of help information to look good when displayed. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
* add flag --extract tar file in podman cpQi Wang2019-03-06
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* Don't extract tar file in podman cpQi Wang2019-03-04
| | | | Signed-off-by: Qi Wang <qiwan@redhat.com>
* Better usage synopses for subcommandsEd Santiago2019-02-26
| | | | | | | Conceptually simple: include, where applicable, a brief description of command-line options for each subcommand. Signed-off-by: Ed Santiago <santiago@redhat.com>
* cmd: support rootless mode for cp commandGiuseppe Scrivano2019-02-22
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* 'podman cp' copy between host and containerQi Wang2019-02-14
Signed-off-by: Qi Wang <qiwan@redhat.com>