summaryrefslogtreecommitdiff
path: root/src/nshd/hackers_git/main.go
blob: 9e71710540883ec8adea24122f3a45445836389e (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
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
}

//
func (o *Hackers) Config_Get(cred p.Ucred, req p.Request_Config_Get) p.Config_Enumerator {
	var val *string = nil

	switch req {
	case p.NSLCD_CONFIG_PAM_PASSWORD_PROHIBIT_MESSAGE:
		val = &o.pam_password_prohibit_message
	}

	if val != nil {
		return p.New_Config_List([]p.Config{p.Config(*val)})
	} else {
		return p.Config_Ø{}
	}
}
//
func (o *Hackers) Passwd_ByName(cred p.Ucred, req p.Request_Passwd_ByName) p.Passwd_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Passwd_ByUID(cred p.Ucred, req p.Request_Passwd_ByUID) p.Passwd_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Passwd_All(cred p.Ucred, req p.Request_Passwd_All) p.Passwd_Enumerator {
	// TODO
	return nil
}
//
func (o *Hackers) Shadow_ByName(cred p.Ucred, req p.Request_Shadow_ByName) p.Shadow_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Shadow_All(cred p.Ucred, req p.Request_Shadow_All) p.Shadow_Enumerator {
	// TODO
	return nil
}
//
func (o *Hackers) Group_ByName(cred p.Ucred, req p.Request_Group_ByName) p.Group_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Group_ByGid(cred p.Ucred, req p.Request_Group_ByGid) p.Group_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Group_ByMember(cred p.Ucred, req p.Request_Group_ByMember) p.Group_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) Group_All(cred p.Ucred, req p.Request_Group_All) p.Group_Enumerator {
	// TODO
	return nil
}
//
func (o *Hackers) PAM_Authentication(cred p.Ucred, req p.Request_PAM_Authentication) p.PAM_Authentication_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) PAM_Authorization(cred p.Ucred, req p.Request_PAM_Authorization) p.PAM_Authorization_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) PAM_SessionOpen(cred p.Ucred, req p.Request_PAM_SessionOpen) p.PAM_SessionOpen_Enumerator {
	// TODO
	return nil
}
func (o *Hackers) PAM_SessionClose(cred p.Ucred, req p.Request_PAM_SessionClose) p.PAM_SessionClose_Enumerator {
	// TODO
	return nil
}