diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-11 23:28:54 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2015-09-11 23:28:54 -0600 |
commit | 2130c2ab56eb130c2fb6112098ea8ccb1fa235b0 (patch) | |
tree | d3329cc7a02e848035c6c6c5a800482c52f11995 /src/nshd/hackers_git/db_shadow.go | |
parent | 7374395eb39700cd71f77be4f218eadb2712d19d (diff) |
fix several all*Enumerator initializers
Diffstat (limited to 'src/nshd/hackers_git/db_shadow.go')
-rw-r--r-- | src/nshd/hackers_git/db_shadow.go | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/nshd/hackers_git/db_shadow.go b/src/nshd/hackers_git/db_shadow.go index 97af6e9..fecb9f8 100644 --- a/src/nshd/hackers_git/db_shadow.go +++ b/src/nshd/hackers_git/db_shadow.go @@ -68,22 +68,20 @@ func (o *allShadowEnumerator) GenericGetNext() (n *interface{}, err error) { return } -func (o *Hackers) newAllShadowEnumerator() *allShadowEnumerator { +func (o *Hackers) Shadow_All(cred p.Ucred, req p.Request_Shadow_All) p.Shadow_Enumerator { + if cred.Uid != 0 { + return util.Shadow_Ø{} + } o.lock.RLock() e := allShadowEnumerator{ uids: make([]int32, len(o.users)), backend: o, done: false, } + i := uint(0) for uid, _ := range o.users { - e.uids = append(e.uids, uid) + e.uids[i] = uid + i++ } return &e } - -func (o *Hackers) Shadow_All(cred p.Ucred, req p.Request_Shadow_All) p.Shadow_Enumerator { - if cred.Uid != 0 { - return util.Shadow_Ø{} - } - return o.newAllShadowEnumerator() -} |