Commit Graph

9 Commits

Author SHA1 Message Date
Kir Kolyshkin 24da18800e *: fix build tags
This change is generated by `go1.23rc2 fix ./...`.

Had to use go1.23rc2, since all released go versions have a bug
preventing it from working with `go 1.22.0` in go.mod (opened
https://github.com/golang/go/issues/68825,
https://github.com/golang/go/issues/68824 for awareness).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2024-08-09 17:05:30 -07:00
Nalin Dahyabhai bb149ea686 Use errors.Is() instead of os.Is{Not,}Exist
If errors for which os.IsExist() or os.IsNotExist() would have returned
true have been wrapped using fmt.Errorf()'s "%w" verb, os.IsExist() and
os.IsNotExist(), not having been retrofitted to use errors.Is(), will
return false.

Use errors.Is() to check if an error is an os.ErrExist or os.ErrNotExist
error instead of calling os.IsExist() or os.IsNotExist().

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2022-07-26 15:36:58 -04:00
Sascha Grunert ce384684c0
Switch to golang native error wrapping
We now use the golang error wrapping format specifier `%w` instead of
the deprecated github.com/pkg/errors package.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2022-07-07 11:41:47 +02:00
Daniel J Walsh 0d53dcff38
Vendor in latest opencontainers/selinux v1.10.1
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-04-04 10:08:44 -04:00
Nalin Dahyabhai 9b6a02f3af run: ensure that stdio pipes are labeled correctly
Label stdio pipes to ensure that processes we run can read through
/dev/stdin and write through the /dev/stdout and /dev/stderr links.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-11-19 10:55:50 -05:00
Daniel J Walsh 580356f0c3
SELinux no longer requires a tag.
It should work fine on linux and not linux boxes. Since there
is no glibc added, we can safely compile and run this code
on non SELinux boxes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-12-21 15:24:28 -05:00
Nalin Dahyabhai 3835460c3b Use pipes for copying
Use the copier package to rework how we handle ADD and COPY.

When evaluating cache for content that's being copied/added in, switch
from (digest the data, check for a cache entry, then maybe copy the data
and create the new layer) to (copy the data and create the new layer,
digesting as we go, check for a cache entry, either commit or discard
the new layer).

Use the copier package for ADD, COPY, and for ensuring that a specified
directory exists in the working container's rootfs.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2020-08-21 12:34:00 -04:00
Nalin Dahyabhai 0160a7757b run: check if SELinux is enabled
When we're built with support for SELinux, refrain from setting process
and mount labels if SELinux isn't detected as enabled at runtime.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #1542
Approved by: rhatdan
2019-04-25 17:50:11 +00:00
Nalin Dahyabhai d54f0eaf30 run: clear default seccomp filter if not enabled
When seccomp is not enabled, make sure to clear any default setting
which runtime-tools supplied for us.  Likewise, if SELinux is not
enabled, don't set a process label or a mount label.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>

Closes: #988
Approved by: rhatdan
2018-09-05 20:34:41 +00:00