summaryrefslogtreecommitdiff
path: root/src/nshd/hackers_git/hackers.go
blob: 99af13576e48f047c86ecc2e1552710e293d425b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package hackers_git

import (
	_ "golang.org/x/exp/inotify"
	_ "gopkg.in/yaml.v2"
	p "nslcd_proto"
	"nslcd_systemd"
	"sync"
)

type Hackers struct {
	p.NullBackend
	lock                          *sync.RWMutex
	pam_password_prohibit_message string
}

var _ nslcd_systemd.Backend = &Hackers{}
var _ p.Backend = &Hackers{}

func (o *Hackers) Reload() {
	o.lock.Lock()
	defer o.lock.Unlock()
	// TODO
}

func NewHackers(yamlDir string) *Hackers {
	// TODO
	var hackers Hackers

	var lock sync.RWMutex
	hackers.lock = &lock

	go inotify_watcher(yamlDir)

	return &hackers
}

func inotify_watcher(yamlDir string) {
	// TODO
}