mirror of
https://github.com/containers/podman.git
synced 2025-08-26 11:10:47 +08:00
new 'no-dereference' mount option
Add a new `no-dereference` mount option supported by crun 1.11+ to re-create/copy a symlink if it's the source of a mount. By default the kernel will resolve the symlink on the host and mount the target. As reported in #20098, there are use cases where the symlink structure must be preserved by all means. Fixes: #20098 Fixes: issues.redhat.com/browse/RUN-1935 Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
This commit is contained in:
@ -28,7 +28,7 @@ type defaultMountOptions struct {
|
||||
// The sourcePath variable, if not empty, contains a bind mount source.
|
||||
func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string, error) {
|
||||
var (
|
||||
foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay, foundIdmap, foundCopy, foundNoSwap bool
|
||||
foundWrite, foundSize, foundProp, foundMode, foundExec, foundSuid, foundDev, foundCopyUp, foundBind, foundZ, foundU, foundOverlay, foundIdmap, foundCopy, foundNoSwap, foundNoDereference bool
|
||||
)
|
||||
|
||||
newOptions := make([]string, 0, len(options))
|
||||
@ -148,6 +148,11 @@ func ProcessOptions(options []string, isTmpfs bool, sourcePath string) ([]string
|
||||
foundNoSwap = true
|
||||
newOptions = append(newOptions, opt)
|
||||
continue
|
||||
case "no-dereference":
|
||||
if foundNoDereference {
|
||||
return nil, fmt.Errorf("the 'no-dereference' option can only be set once: %w", ErrDupeMntOption)
|
||||
}
|
||||
foundNoDereference = true
|
||||
case define.TypeBind, "rbind":
|
||||
if isTmpfs {
|
||||
return nil, fmt.Errorf("the 'bind' and 'rbind' options are not allowed with tmpfs mounts: %w", ErrBadMntOption)
|
||||
|
Reference in New Issue
Block a user