diff options
-rw-r--r-- | src/nshd/hackers_git/hackers_watch.go | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/nshd/hackers_git/hackers_watch.go b/src/nshd/hackers_git/hackers_watch.go index afae203..7a38c7f 100644 --- a/src/nshd/hackers_git/hackers_watch.go +++ b/src/nshd/hackers_git/hackers_watch.go @@ -76,19 +76,18 @@ func (o *Hackers) reload() (err error) { } func (o *Hackers) load_yaml_file(filename string) { - logger.Debug("hackers.git: Loading yaml file: %s", filename) + logger.Debug("hackers.git: Loading YAML file: %s", filename) user, err := parse_user_yaml(filename) + uid := user.passwd.UID if err == nil { - // User added/updated - logger.Debug("hackers.git: ... success") + logger.Debug("hackers.git: -> User %d added/updated", uid) o.lock.Lock() defer o.lock.Unlock() - o.users[user.passwd.UID] = user - o.watchHomedir(user.passwd.UID) - } else if user.passwd.UID >= 0 { + o.users[uid] = user + o.watchHomedir(uid) + } else if uid >= 0 { // User became invalid - logger.Debug("hackers.git: ... error: %v", err) - uid := user.passwd.UID + logger.Debug("hackers.git: -> User %d invalidated: %v", uid, err) o.lock.Lock() defer o.lock.Unlock() wd, found := o.in_uid2wd[uid] @@ -96,6 +95,8 @@ func (o *Hackers) load_yaml_file(filename string) { o.unwatchHomedir(wd) } delete(o.users, uid) + } else { + logger.Debug("hackers.git: -> File ignored: %v", err) } } |