From 955e8e2dc4bd7865f2b21139d61424a168e5a041 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 5 Sep 2015 00:43:54 -0600 Subject: The way nslcd_proto's GenericGetNext was designed, nil checks didn't work --- src/nshd/hackers_git/db_passwd.go | 9 +++++++-- src/nshd/hackers_git/db_shadow.go | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'src/nshd') diff --git a/src/nshd/hackers_git/db_passwd.go b/src/nshd/hackers_git/db_passwd.go index 8aad45e..2cfaccd 100644 --- a/src/nshd/hackers_git/db_passwd.go +++ b/src/nshd/hackers_git/db_passwd.go @@ -60,8 +60,13 @@ func (e *allPasswdEnumerator) GetNext() (*p.Passwd, error) { return nil, nil } -func (e *allPasswdEnumerator) GenericGetNext() (interface{}, error) { - return e.GetNext() +func (o *allPasswdEnumerator) GenericGetNext() (n *interface{}, err error) { + a, err := o.GetNext() + if a != nil { + b := (interface{})(*a) + n = &b + } + return } func (o *Hackers) newAllPasswdEnumerator() *allPasswdEnumerator { diff --git a/src/nshd/hackers_git/db_shadow.go b/src/nshd/hackers_git/db_shadow.go index 468f79d..97af6e9 100644 --- a/src/nshd/hackers_git/db_shadow.go +++ b/src/nshd/hackers_git/db_shadow.go @@ -59,8 +59,13 @@ func (e *allShadowEnumerator) GetNext() (*p.Shadow, error) { return nil, nil } -func (e *allShadowEnumerator) GenericGetNext() (interface{}, error) { - return e.GetNext() +func (o *allShadowEnumerator) GenericGetNext() (n *interface{}, err error) { + a, err := o.GetNext() + if a != nil { + b := (interface{})(*a) + n = &b + } + return } func (o *Hackers) newAllShadowEnumerator() *allShadowEnumerator { -- cgit v1.2.3-54-g00ecf