diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-10-03 02:26:14 +0900 |
| commit | d16da6da8c4880d90dc35fa9006806f7c0395d7f (patch) | |
| tree | d4ca8fed4e14bcffe63268daa6d8efd1923ff03b /system/tmpfiles.go | |
| parent | e58181a930064385c881b7ee1cac4914dd435121 (diff) | |
system: enforce absolute paths
This is less error-prone, and is quite easy to integrate considering internal/app has already migrated to container.Absolute.
Closes #11.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/tmpfiles.go')
| -rw-r--r-- | system/tmpfiles.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/system/tmpfiles.go b/system/tmpfiles.go index 434a3aea..0fe61176 100644 --- a/system/tmpfiles.go +++ b/system/tmpfiles.go @@ -8,14 +8,15 @@ import ( "os" "syscall" + "hakurei.app/container" "hakurei.app/hst" ) // CopyFile reads up to n bytes from src and writes the resulting byte slice to payloadP. -func (sys *I) CopyFile(payloadP *[]byte, src string, cap int, n int64) *I { +func (sys *I) CopyFile(payloadP *[]byte, src *container.Absolute, cap int, n int64) *I { buf := new(bytes.Buffer) buf.Grow(cap) - sys.ops = append(sys.ops, &tmpfileOp{payloadP, src, n, buf}) + sys.ops = append(sys.ops, &tmpfileOp{payloadP, src.String(), n, buf}) return sys } |
