13 Commits

Author SHA1 Message Date
01d397a658 podman: new option --preserve-fd
add a new option --preserve-fd that allows to specify a list of FDs to
pass down to the container.

It is similar to --preserve-fds but it allows to specify a list of FDs
instead of the maximum FD number to preserve.

--preserve-fd and --preserve-fds are mutually exclusive.

It requires crun since runc would complain if any fd below
--preserve-fds is not preserved.

Closes: https://github.com/containers/podman/issues/20844

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-12-05 10:16:41 +01:00
bad25da92e libpod: add !remote tag
This should never be pulled into the remote client.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-24 12:11:34 +02:00
29273cda10 lint: fix warnings found by perfsprint
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-20 16:27:46 +02:00
7ade972102 libpod: pass entire environment to conmon
Pass the _entire_ environment to conmon instead of selectively enabling
only specific variables.  The main reasoning is to make sure that conmon
and the podman-cleanup callback process operate in the exact same
environment than the initial podman process.  Some configuration files
may be passed via environment variables.  Podman not passing those down
to conmon has led to subtle and hard to debug issues in the past, so
passing all down will avoid such kinds of issues in the future.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-09-26 16:48:52 +02:00
73dc72f80d vendor of containers/common
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-09-20 08:39:49 -04:00
8bda49608f Merge pull request #19696 from Luap99/api-stream-format
api docs: document stream format
2023-08-28 19:43:24 +02:00
6f284dbd46 podman exec should set umask to match container
Fixes: https://github.com/containers/podman/issues/19713

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-08-24 13:20:06 -04:00
7c9c969815 API attach: return vnd.docker.multiplexed-stream header
The attach API used to always return the Content-Type
`vnd.docker.raw-stream`, however docker api v1.42 added the
`vnd.docker.multiplexed-stream` type when no tty was used.

Follow suit and return the same header for docker api v1.42 and libpod
v4.7.0. This technically allows clients to make a small optimization as
they no longer need to inspect the container to see if they get a raw or
multiplexed stream.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-08-24 16:22:28 +02:00
d968f3fe09 Replace deprecated ioutil
Package `io/ioutil` was deprecated in golang 1.16, preventing podman from
building under Fedora 37.  Fortunately, functionality identical
replacements are provided by the packages `io` and `os`.  Replace all
usage of all `io/ioutil` symbols with appropriate substitutions
according to the golang docs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-09-20 15:34:27 -04:00
2c63b8439b Fix stutters
Podman adds an Error: to every error message.  So starting an error
message with "error" ends up being reported to the user as

Error: error ...

This patch removes the stutter.

Also ioutil.ReadFile errors report the Path, so wrapping the err message
with the path causes a stutter.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-09-10 07:52:00 -04:00
f85fa9806a libpod: Filter out ENOTCONN errors when trying to close unix domain sockets
On FreeBSD, ENOTCONN can be reported if shutdown is called on a unix
domain socket where the remote end is already closed. This change
ignores those errors instead of printing an error message on container
exit.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-07 07:58:39 +01:00
6668ac93bb libpod: Factor out capabilites code from prepareProcessExec
This moves the code which sets the process capabilites for the exec to
oci_conmon_exec_linux.go since this is a linux-specific feature. Adding
a no-op stub for FreeBSD enables 'podman exec' when using the ocijail
runtime.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-09-07 07:58:37 +01:00
68b2450d3d libpod: Move oci_conmon_exec_linux.go to oci_conmon_exec_common.go
[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-08-18 08:05:42 +01:00