summaryrefslogtreecommitdiff
path: root/src/nshd
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-03 16:59:14 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-03 16:59:14 -0600
commitdf78914cae2dc2e3da5170cf3f9c7b412aed3afa (patch)
tree9817dd885f6a11fe3b9bdd6d56eddfb15e7634ba /src/nshd
parenta6c2e22de92f459a52b8151ccc7f7c562c954750 (diff)
Use a defer/recover block to have the exit status on panic match LSB.
Diffstat (limited to 'src/nshd')
-rw-r--r--src/nshd/hackers_git/hackers.go2
-rw-r--r--src/nshd/main.go2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/nshd/hackers_git/hackers.go b/src/nshd/hackers_git/hackers.go
index ecbda7a..814e921 100644
--- a/src/nshd/hackers_git/hackers.go
+++ b/src/nshd/hackers_git/hackers.go
@@ -6,6 +6,7 @@ import (
"nslcd_proto/util"
"nslcd_systemd"
"sd_daemon/logger"
+ "sd_daemon/lsb"
"sync"
)
@@ -47,6 +48,7 @@ func NewHackers(config Config) *Hackers {
}
o.workers.Add(1)
go func() {
+ defer lsb.Recover()
defer o.workers.Done()
o.worker()
}()
diff --git a/src/nshd/main.go b/src/nshd/main.go
index ebca1a6..bc53711 100644
--- a/src/nshd/main.go
+++ b/src/nshd/main.go
@@ -1,12 +1,14 @@
package main
import (
+ "sd_daemon/lsb"
"nshd/hackers_git"
"nslcd_systemd"
"os"
)
func main() {
+ defer lsb.Recover()
config := hackers_git.Config{
Pam_password_prohibit_message: "",
Yamldir: "/var/cache/parabola-hackers/users",