diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-03-26 22:49:28 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-03-26 22:49:28 +0000 |
commit | 9699018b4ab2b2ca9abb3170abff4ab630238641 (patch) | |
tree | ccc43fb184215226265ede5412a2ed3ca6bed433 /pkg/sentry/kernel | |
parent | 98c58a207c4b3dfc9dd9b0d0ccab4e85fe82be75 (diff) | |
parent | 0e62a548eb093c95e41780c753afa87f4ccc5c8f (diff) |
Merge release-20200219.0-249-g0e62a54 (automated)
Diffstat (limited to 'pkg/sentry/kernel')
-rw-r--r-- | pkg/sentry/kernel/task.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/pkg/sentry/kernel/task.go b/pkg/sentry/kernel/task.go index 8452ddf5b..d6546735e 100644 --- a/pkg/sentry/kernel/task.go +++ b/pkg/sentry/kernel/task.go @@ -863,3 +863,15 @@ func (t *Task) SetOOMScoreAdj(adj int32) error { atomic.StoreInt32(&t.tg.oomScoreAdj, adj) return nil } + +// UID returns t's uid. +// TODO(gvisor.dev/issue/170): This method is not namespaced yet. +func (t *Task) UID() uint32 { + return uint32(t.Credentials().EffectiveKUID) +} + +// GID returns t's gid. +// TODO(gvisor.dev/issue/170): This method is not namespaced yet. +func (t *Task) GID() uint32 { + return uint32(t.Credentials().EffectiveKGID) +} |