spiegel_podman/pkg
tomsweeneyredhat 6b64861922 [v4.4.1-rhel] Use append() to add elements to a slice (restore)
Backports #17755 from @adrianreber to fix an append issue.  Will be
used for a ZeroDay delivery to RHEL 8.8/9.2.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2177611

Original commit message:

The code was not using append() to add items to a slice.

Accessing non allocated elements of the slice failed with:
```
$ podman container restore -l
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
github.com/containers/podman/v4/pkg/domain/infra/abi.(*ContainerEngine).ContainerRestore(0xc00051a8b8, {0x1dbced0, 0xc0000440d0}, {0x2a31b30, 0x0, 0x0}, {0x0, 0x0, 0x0, 0x0, ...})
        /share/go/src/github.com/containers/podman/pkg/domain/infra/abi/containers.go:676 +0x39c
github.com/containers/podman/v4/cmd/podman/containers.restore(0x28fb6c0?, {0xc0002c9080, 0x0, 0x1?})
        /share/go/src/github.com/containers/podman/cmd/podman/containers/restore.go:171 +0x4ef
github.com/spf13/cobra.(*Command).execute(0x28fb6c0, {0xc0000400b0, 0x1, 0x1})
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:916 +0x862
github.com/spf13/cobra.(*Command).ExecuteC(0x291ab00)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:1044 +0x3bd
github.com/spf13/cobra.(*Command).Execute(...)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext(...)
        /share/go/src/github.com/containers/podman/vendor/github.com/spf13/cobra/command.go:961
main.Execute()
        /share/go/src/github.com/containers/podman/cmd/podman/root.go:107 +0xcc
main.main()
        /share/go/src/github.com/containers/podman/cmd/podman/main.go:41 +0x7c
```

[NO NEW TESTS NEEDED]

Signed-off-by: tomsweeneyredhat <tsweeney@redhat.com>
2023-03-14 19:52:14 -04:00
..
annotations Remove ReservedAnnotations from kube generate specification 2023-01-18 08:46:24 -05:00
api Add missing return after errors 2023-02-07 14:51:07 -05:00
auth [CI:DOCS] Fix spelling and typos 2022-11-19 16:26:00 +01:00
autoupdate bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
bindings Add support for podman build --group-add 2023-01-19 10:42:10 -05:00
channel bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
checkpoint checkpoint restore: fix --ignore-static-ip/mac 2022-12-12 18:34:49 +01:00
copy pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
criu deps: bump go-criu to v6 2022-11-01 13:57:24 +05:30
ctime Replace deprecated ioutil 2022-09-20 15:34:27 -04:00
domain [v4.4.1-rhel] Use append() to add elements to a slice (restore) 2023-03-14 19:52:14 -04:00
env [CI:DOCS] Fix spelling and typos 2022-11-19 16:26:00 +01:00
errorhandling libpod/runtime: switch to golang native error wrapping 2022-07-04 15:39:00 +02:00
inspect pkg/inspect: remove unused ImageResult type 2022-05-24 16:07:39 +02:00
k8s.io Merge pull request #16560 from eriksjolund/fix_typo_a_an 2022-11-20 17:04:36 -05:00
lookup bump golangci-lint to v1.50.1 2022-12-15 13:39:56 +01:00
machine Resolve symlink path for qemu directory if possible 2023-02-08 14:17:19 +00:00
namespaces libpod: Add pasta networking mode 2022-11-08 00:16:35 +01:00
parallel Fix stutters 2022-09-10 07:52:00 -04:00
ps DB: make loading container states optional 2023-01-27 09:14:12 +00:00
rctl pkg/rctl: Remove unused cgo dependency 2022-10-31 15:13:48 +00:00
rootless rootless: rename auth-scripts to preexec-hooks 2023-01-17 10:58:46 +01:00
rootlessport go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
seccomp pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
selinux Fix SELinux functions names to not be repetitive 2020-04-23 15:57:34 -04:00
servicereaper go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
signal Run codespell on code 2022-11-04 10:57:41 -04:00
specgen oci: bind mount /sys with --userns=(auto|pod:) 2023-02-07 14:40:56 -05:00
specgenutil Remove ReservedAnnotations from kube generate specification 2023-01-18 08:46:24 -05:00
systemd kube play: only enforce passthrough in Quadlet 2023-02-20 07:53:56 +00:00
terminal podman ssh work, using new c/common interface 2022-08-09 14:00:58 -04:00
timetype bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
trust pkg/trust: Take the default policy path from c/common/pkg/config 2022-11-25 10:14:15 +00:00
util Do not mount /dev/tty into rootless containers 2023-01-31 22:59:29 +01:00