summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 00:42:36 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-05 00:42:36 -0600
commit3d58c018117b26e9fb0c3a347303c8eb37e30341 (patch)
tree5d182ac3233dbe3073306278db89c1fbb1684cd0 /src
parente729072329556406dfdb19b89d177e89e27ca4a7 (diff)
error handling fixes
Diffstat (limited to 'src')
-rw-r--r--src/nshd/hackers_git/hackers_parse.go2
-rw-r--r--src/nshd/main.go3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/nshd/hackers_git/hackers_parse.go b/src/nshd/hackers_git/hackers_parse.go
index f1f360f..a9a03f3 100644
--- a/src/nshd/hackers_git/hackers_parse.go
+++ b/src/nshd/hackers_git/hackers_parse.go
@@ -77,7 +77,7 @@ func load_user_yaml(filename string) (ret user, err error) {
}
if iface, isSet := data["groups"]; !isSet {
- errs = append(errs, "\"groups\" is not set")
+ ret.groups = make([]string, 0)
} else if ary, isTyp := iface.([]interface{}); !isTyp {
errs = append(errs, "\"groups\" is not an array")
} else {
diff --git a/src/nshd/main.go b/src/nshd/main.go
index bc53711..3560870 100644
--- a/src/nshd/main.go
+++ b/src/nshd/main.go
@@ -14,6 +14,9 @@ func main() {
Yamldir: "/var/cache/parabola-hackers/users",
}
backend := hackers_git.NewHackers(config)
+ if backend == nil {
+ os.Exit(int(lsb.EXIT_FAILURE))
+ }
ret := nslcd_systemd.Main(backend)
backend.Close()
os.Exit(int(ret))