spiegel_podman/pkg/util
Martin Roukala (né Peres) f4c81b0aa5 Only prevent VTs to be mounted inside privileged systemd containers
While mounting virtual console devices in a systemd container is a
recipe for disaster (I experienced it first hand), mounting serial
console devices, modems, and others should still be done by default
for privileged systemd-based containers.

v2, addressing the review from @fho:
 - use backticks in the regular expression to remove backslashes
 - pre-compile the regex at the package level
 - drop IsVirtualTerminalDevice (not needed for a one-liner)

v3, addressing the review from @fho and @rhatdan:
 - re-introduce a private function for matching the device names
 - use path.Match rather than a regex not to slow down startup time

Closes #16925.

Fixes: 5a2405ae1b ("Don't mount /dev/tty* inside privileged...")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
2023-01-11 16:57:58 +02:00
..
camelcase bump golangci-lint to v1.49.0 2022-10-17 09:19:41 +02:00
filters.go prune filter handling 2022-07-25 09:28:26 -04:00
filters_test.go prune filter handling 2022-07-25 09:28:26 -04:00
kube.go play kube: Allow the user to import the contents of a tar file into a volume 2022-10-25 15:11:25 +03:00
mountOpts.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
mountOpts_linux.go Turn off 'noexec' option by default for named volumes 2020-05-20 16:48:20 -04:00
mountOpts_other.go go fmt: use go 1.18 conditional-build syntax 2022-03-18 09:11:53 +01:00
utils.go Merge pull request #16329 from gupttaru/encryption-decryption-feature 2022-11-28 06:33:59 -05:00
utils_darwin.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00
utils_freebsd.go pkg/util: Add pid information descriptors for FreeBSD 2022-10-17 15:33:04 +01:00
utils_linux.go Only prevent VTs to be mounted inside privileged systemd containers 2023-01-11 16:57:58 +02:00
utils_linux_test.go Fix up errors found by codespell 2020-09-11 06:14:25 -04:00
utils_supported.go Eval symlinks on XDG_RUNTIME_DIR 2022-10-28 14:32:39 -04:00
utils_test.go Merge pull request #11218 from cdoern/untilBug 2021-08-26 10:12:09 -04:00
utils_unsupported.go pkg: Build pkg/util on FreeBSD 2022-08-13 07:53:34 +01:00
utils_windows.go pkg: switch to golang native error wrapping 2022-07-08 08:54:47 +02:00