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

Method getXattr

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

Source from the content-addressed store, hash-verified

996}
997
998func (i *inode) getXattr(creds *auth.Credentials, opts *vfs.GetXattrOptions) (string, error) {
999 if err := i.checkXattrPrefix(opts.Name); err != nil {
1000 return "", err
1001 }
1002 mode := linux.FileMode(i.mode.Load())
1003 kuid := auth.KUID(i.uid.Load())
1004 kgid := auth.KGID(i.gid.Load())
1005 if err := vfs.GenericCheckPermissions(creds, vfs.MayRead, mode, kuid, kgid); err != nil {
1006 return "", err
1007 }
1008 return i.xattrs.GetXattr(creds, mode, kuid, opts)
1009}
1010
1011func (i *inode) setXattr(creds *auth.Credentials, opts *vfs.SetXattrOptions) error {
1012 if err := i.checkXattrPrefix(opts.Name); err != nil {

Callers 2

GetXattrMethod · 0.45
GetXattrAtMethod · 0.45

Calls 7

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

Tested by

no test coverage detected