blob: f7c45734b429ad13b0ed9997edadfa07e865e899 (
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
41
42
43
44
45
46
47
|
package hackers_git
import (
"inotify"
p "nslcd_proto"
"nslcd_systemd"
"sd_daemon/logger"
"sync"
)
type Config struct {
Pam_password_prohibit_message string
Yamldir string
}
type Hackers struct {
p.NullBackend
cfg Config
lock sync.RWMutex
users map[int32]p.Passwd
passwords map[int32]string
in_fd *inotify.Inotify
in_wd_home inotify.Cint
in_wd_yaml inotify.Cint
in_uid2wd map[int32]inotify.Cint
in_wd2uid map[inotify.Cint]int32
}
var _ nslcd_systemd.Backend = &Hackers{}
var _ p.Backend = &Hackers{}
func (o *Hackers) Close() {
logger.Info("Closing hackers.git session")
o.lock.Lock()
defer o.lock.Unlock()
o.close()
}
func (o *Hackers) Reload() error {
logger.Info("Loading hackers.git session")
o.lock.Lock()
defer o.lock.Unlock()
return o.reload()
}
|