MCPcopy
hub / github.com/google/gvisor / setXattr

Method setXattr

pkg/sentry/fsimpl/tmpfs/tmpfs.go:1011–1022  ·  view source on GitHub ↗
(creds *auth.Credentials, opts *vfs.SetXattrOptions)

Source from the content-addressed store, hash-verified

1009}
1010
1011func (i *inode) setXattr(creds *auth.Credentials, opts *vfs.SetXattrOptions) error {
1012 if err := i.checkXattrPrefix(opts.Name); err != nil {
1013 return err
1014 }
1015 mode := linux.FileMode(i.mode.Load())
1016 kuid := auth.KUID(i.uid.Load())
1017 kgid := auth.KGID(i.gid.Load())
1018 if err := vfs.GenericCheckPermissions(creds, vfs.MayWrite, mode, kuid, kgid); err != nil {
1019 return err
1020 }
1021 return i.xattrs.SetXattr(creds, mode, kuid, kgid, opts)
1022}
1023
1024func (i *inode) removeXattr(creds *auth.Credentials, name string) error {
1025 if err := i.checkXattrPrefix(name); err != nil {

Callers 2

SetXattrMethod · 0.45
SetXattrAtMethod · 0.45

Calls 7

checkXattrPrefixMethod · 0.95
FileModeTypeAlias · 0.92
KUIDTypeAlias · 0.92
KGIDTypeAlias · 0.92
GenericCheckPermissionsFunction · 0.92
LoadMethod · 0.65
SetXattrMethod · 0.65

Tested by

no test coverage detected