forked from rosa/hakurei
cmd/app: enforce mutable instance exclusion
This avoids invoking undefined behaviour in the underlying overlay filesystem implementation. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
+9
-1
@@ -31,7 +31,12 @@ func parsePair(s string) (source, target *check.Absolute, err error) {
|
||||
|
||||
// parse decodes a high-level configuration stream and returns its
|
||||
// corresponding [hst.Config].
|
||||
func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
||||
func parse(
|
||||
id string,
|
||||
base *check.Absolute,
|
||||
r io.Reader,
|
||||
templateP *string,
|
||||
) (*hst.Config, error) {
|
||||
shell := fhs.AbsRoot.Append("bin", "zsh")
|
||||
home := hst.AbsPrivateTmp.Append("home")
|
||||
|
||||
@@ -99,6 +104,9 @@ func parse(id string, base *check.Absolute, r io.Reader) (*hst.Config, error) {
|
||||
} else if v, err := strconv.Atoi(identity); err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
if templateP != nil {
|
||||
*templateP = template
|
||||
}
|
||||
c.Identity = v
|
||||
root.Upper = base.Append("template", template)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user