Commit Graph

15 Commits

Author SHA1 Message Date
Daniel J Walsh a3204cf7e8
Move to golang 1.18 and later
Github.com is reporting security issues on older versions of
golang.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-03 15:26:54 -04:00
Giuseppe Scrivano f0cd0b97b1
chrootarchive: use unshare to detect user namespace
use the function in containers/storage that has the same
functionalities.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2022-09-08 23:07:14 +02:00
Daniel J Walsh 3f8c0dc0de
Wrap errors properly with fmt.Errorf
Also returned errors should not begine with a capatalized errors.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-07-12 13:26:10 -04:00
Daniel J Walsh b3531c3df8
Vendor in opencontainers/runc v1.0.0
The RunningInUserNS Function was removed from libcontainer and is now
in contianerd.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-06-22 08:41:17 -04:00
Giuseppe Scrivano 4821b98b8a
copy, rootless: skip copying trusted.* xattr
unprivileged users cannot use the trusted.* xattrs.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-04-06 16:55:18 +02:00
Giuseppe Scrivano 029896beb3
copy: create a unix socket with os.ModeSocket
os.ModeSocket refers to a UNIX socket, not a FIFO.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-12 15:20:37 +01:00
Giuseppe Scrivano 87b50c455a
drivers: new function CopyRegularToFile
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-09 15:35:34 +01:00
Giuseppe Scrivano 7ce64181a0
drivers: make copyRegular public
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-03-09 15:35:27 +01:00
Kir Kolyshkin 3bf3251882 system.*xattr: wrap errors into os.PathError
This way the error messages are more informative.

Convert all the users accordingly (assuming there are no users outside
of this repo).

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-29 03:30:02 -07:00
Daniel J Walsh 632ac1df6f
Remove dead code
Coverity found this dead code.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-11 17:37:45 -04:00
Zac Medico f39fb8370d Remove redundant if statements for nil slices
Suggested-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Zac Medico <zmedico@gmail.com>
2019-11-22 13:02:42 -08:00
Zac Medico 5fc095c06d VFS support for user.* xattrs
Preservation of user.* xattrs is supported by most (if not all) other
drivers, and it's especially useful for containers that run under a
PaX kernel where "user.pax.flags" is used to store PaX flags.

Signed-off-by: Zac Medico <zmedico@gmail.com>
2019-11-20 22:15:20 -08:00
Daniel J Walsh f3c3a0abee
Fix to be able to build on FTBFS on mipsel
Some platforms store s.Rdev as unit32, translate to unit64 so it
will compile.

Also add function to make it clear that the object is a whiteout object.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-11-11 17:27:49 -05:00
Valentin Rothberg f240cc75a0 drivers.DirCopy: fix filemode detection
We failed to detect char devices as those were not covered by the
`ModeDevice` check.  Fix this by using the entire FileMode mask as
suggested by the standard library.

Also change the "unknown file type" error to include the mode to
ease debugging potential regressions in the future.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-04-05 15:12:54 +02:00
Nalin Dahyabhai 6a9fa6b66e drivers/copy: add a non-cgo fallback
The vfs driver already has logic that avoids use of the copy package
when we're not on Linux, so provide the same fallback in the copy
package for non-cgo cases.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-03-26 10:03:04 -04:00