From 2d45bbd332bf439f483dacadf5e3e9776c97ef60 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 3 Sep 2015 13:50:10 -0600 Subject: tidy --- src/nshd/hackers_git/hackers.go | 12 ++++++++++++ src/nshd/hackers_git/hackers_parse.go | 2 +- src/nshd/hackers_git/hackers_watch.go | 12 ------------ 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/nshd/hackers_git/hackers.go b/src/nshd/hackers_git/hackers.go index 4a1021a..b1fffc6 100644 --- a/src/nshd/hackers_git/hackers.go +++ b/src/nshd/hackers_git/hackers.go @@ -36,6 +36,18 @@ type Hackers struct { var _ nslcd_systemd.Backend = &Hackers{} var _ nslcd_proto.Backend = &Hackers{} +func NewHackers(config Config) *Hackers { + o := Hackers{ + cfg: config, + } + err := o.Reload() + if err != nil { + return nil + } + go o.worker() + return &o +} + func (o *Hackers) Close() { logger.Info("Closing hackers.git session") o.lock.Lock() diff --git a/src/nshd/hackers_git/hackers_parse.go b/src/nshd/hackers_git/hackers_parse.go index b446ba1..47f10da 100644 --- a/src/nshd/hackers_git/hackers_parse.go +++ b/src/nshd/hackers_git/hackers_parse.go @@ -98,7 +98,7 @@ func load_user_yaml(filename string) (ret user, err error) { } } if len(errs) > 0 { - err = &yaml.TypeError{errs} + err = &yaml.TypeError{Errors: errs} } ret.passwd.PwHash = "!" diff --git a/src/nshd/hackers_git/hackers_watch.go b/src/nshd/hackers_git/hackers_watch.go index f902229..99e5eb3 100644 --- a/src/nshd/hackers_git/hackers_watch.go +++ b/src/nshd/hackers_git/hackers_watch.go @@ -43,18 +43,6 @@ func (o *Hackers) unwatchHomedir(wd inotify.Cint) { delete(o.in_uid2wd, uid) } -func NewHackers(config Config) *Hackers { - o := Hackers{ - cfg: config, - } - err := o.reload() - if err != nil { - return nil - } - go o.worker() - return &o -} - func (o *Hackers) close() { if o.in_fd != nil { o.in_fd.Close() -- cgit v1.2.2