kubernetes/pkg/volume/util/atomic_writer_linux.go
Gavin Lam e5920df4da
bug: Fix link file ownership of projected serviceAccountToken
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>
2026-03-01 15:22:09 -05:00

27 lines
860 B
Go

//go:build linux
/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import "os"
// lchown changes the numeric uid and gid of the named file.
// If the file is a symbolic link, it changes the uid and gid of the link itself.
func (w *AtomicWriter) lchown(name string, uid, gid int) error {
return os.Lchown(name, uid, gid)
}