From 726e1d174ef8fe7108c1a5a736550824766ec11f Mon Sep 17 00:00:00 2001 From: Oliver Calder Date: Fri, 29 May 2026 15:27:45 -0500 Subject: [PATCH] Remove flags field from NewAtomicFile calls The `osutil.AtomicWriteFlags` has had its only flag value removed from snapd, as that flag had been unused since 2016. Now, since all the `flags osutil.AtomicWriteFlags` fields were ignored, we want to remove those fields from snapd as well. However, snapd vendors secboot, and secboot uses `osutil.NewAtomicFile` from snapd, so we can't make the change in snapd without first making the change in secboot. Once this secboot change lands and a new secboot build is available, then we can bump the secboot version used by snapd within the PR which changes the `osutil` function signatures. Then, after that PR within snapd lands, we can bump the snapd version which secboot builds against. That PR within snapd is https://github.com/canonical/snapd/pull/17129 Signed-off-by: Oliver Calder --- keydata_file.go | 2 +- tpm2/keydata_legacy.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keydata_file.go b/keydata_file.go index f9239b70..c7ca56d9 100644 --- a/keydata_file.go +++ b/keydata_file.go @@ -69,7 +69,7 @@ type FileKeyDataWriter struct { } func (w *FileKeyDataWriter) Commit() error { - f, err := osutil.NewAtomicFile(w.path, 0600, 0, sys.UserID(osutil.NoChown), sys.GroupID(osutil.NoChown)) + f, err := osutil.NewAtomicFile(w.path, 0600, sys.UserID(osutil.NoChown), sys.GroupID(osutil.NoChown)) if err != nil { return xerrors.Errorf("cannot create new atomic file: %w", err) } diff --git a/tpm2/keydata_legacy.go b/tpm2/keydata_legacy.go index 7864755b..3c58fbd0 100644 --- a/tpm2/keydata_legacy.go +++ b/tpm2/keydata_legacy.go @@ -194,7 +194,7 @@ type FileSealedKeyObjectWriter struct { } func (w *FileSealedKeyObjectWriter) Commit() (err error) { - f, err := osutil.NewAtomicFile(w.path, 0600, 0, sys.UserID(osutil.NoChown), sys.GroupID(osutil.NoChown)) + f, err := osutil.NewAtomicFile(w.path, 0600, sys.UserID(osutil.NoChown), sys.GroupID(osutil.NoChown)) if err != nil { return err }