summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 20:36:19 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 20:36:19 -0600
commit922e4f2ab556fdf1773c8a98bef27f98535e00f7 (patch)
tree5ab906ae0f507b1b5381ec9348ccc88ec7ceaca6 /src
parenta7535d8ca8a3f3ed6ed6293e3380e2b1f0d888d8 (diff)
clean up load_yaml_file logging
Diffstat (limited to 'src')
-rw-r--r--src/nshd/hackers_git/hackers_watch.go17
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)
}
}