diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-07 23:56:19 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-07 23:56:19 +0900 |
| commit | 1f0226f7e01822a2a5b37d8626b59b7b6f4d0144 (patch) | |
| tree | 47ca771c20a1073f4c2743c7c1b4189f66ddf336 /container/mount.go | |
| parent | 584ce3da685352847e5c6189e5050bd5cb0307e9 (diff) | |
container/check: relocate overlay escape
This is used in hst to format strings.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/mount.go')
| -rw-r--r-- | container/mount.go | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/container/mount.go b/container/mount.go index 2749d0ec..0c459c9c 100644 --- a/container/mount.go +++ b/container/mount.go @@ -4,7 +4,6 @@ import ( "errors" "fmt" "os" - "strings" . "syscall" "hakurei.app/container/vfs" @@ -85,13 +84,6 @@ const ( // OptionOverlayUserxattr represents the userxattr option of the overlay pseudo-filesystem. // Use the "user.overlay." xattr namespace instead of "trusted.overlay.". OptionOverlayUserxattr = "userxattr" - - // SpecialOverlayEscape is the escape string for overlay mount options. - SpecialOverlayEscape = `\` - // SpecialOverlayOption is the separator string between overlay mount options. - SpecialOverlayOption = "," - // SpecialOverlayPath is the separator string between overlay paths. - SpecialOverlayPath = ":" ) // bindMount mounts source on target and recursively applies flags if MS_REC is set. @@ -206,20 +198,3 @@ func parentPerm(perm os.FileMode) os.FileMode { } return os.FileMode(pperm) } - -// EscapeOverlayDataSegment escapes a string for formatting into the data argument of an overlay mount call. -func EscapeOverlayDataSegment(s string) string { - if s == zeroString { - return zeroString - } - - if f := strings.SplitN(s, "\x00", 2); len(f) > 0 { - s = f[0] - } - - return strings.NewReplacer( - SpecialOverlayEscape, SpecialOverlayEscape+SpecialOverlayEscape, - SpecialOverlayOption, SpecialOverlayEscape+SpecialOverlayOption, - SpecialOverlayPath, SpecialOverlayEscape+SpecialOverlayPath, - ).Replace(s) -} |
