summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/nshd/hackers_git/db_config.go4
-rw-r--r--src/nshd/hackers_git/db_passwd.go4
-rw-r--r--src/nshd/hackers_git/db_shadow.go2
-rw-r--r--src/nslcd_proto/nslcd_h.go76
4 files changed, 44 insertions, 42 deletions
diff --git a/src/nshd/hackers_git/db_config.go b/src/nshd/hackers_git/db_config.go
index aa8bef8..1de0013 100644
--- a/src/nshd/hackers_git/db_config.go
+++ b/src/nshd/hackers_git/db_config.go
@@ -11,7 +11,7 @@ func (o *Hackers) Config_Get(cred p.Ucred, req p.Request_Config_Get) p.Config_En
var val *string = nil
- switch req {
+ switch req.Key {
case p.NSLCD_CONFIG_PAM_PASSWORD_PROHIBIT_MESSAGE:
if o.cfg.Pam_password_prohibit_message != "" {
val = &o.cfg.Pam_password_prohibit_message
@@ -19,7 +19,7 @@ func (o *Hackers) Config_Get(cred p.Ucred, req p.Request_Config_Get) p.Config_En
}
if val != nil {
- return util.New_Config_List([]p.Config{p.Config(*val)})
+ return util.New_Config_List([]p.Config{p.Config{Value:(*val)}})
} else {
return util.Config_Ø{}
}
diff --git a/src/nshd/hackers_git/db_passwd.go b/src/nshd/hackers_git/db_passwd.go
index 7bc3671..8aad45e 100644
--- a/src/nshd/hackers_git/db_passwd.go
+++ b/src/nshd/hackers_git/db_passwd.go
@@ -16,7 +16,7 @@ func (o *Hackers) Passwd_ByName(cred p.Ucred, req p.Request_Passwd_ByName) p.Pas
o.lock.RLock()
defer o.lock.RUnlock()
- uid := o.name2uid(string(req))
+ uid := o.name2uid(req.Name)
if uid < 0 {
return util.Passwd_Ø{}
}
@@ -30,7 +30,7 @@ func (o *Hackers) Passwd_ByUID(cred p.Ucred, req p.Request_Passwd_ByUID) p.Passw
o.lock.RLock()
defer o.lock.RUnlock()
- user, found := o.users[int32(req)]
+ user, found := o.users[req.UID]
if !found {
return util.Passwd_Ø{}
}
diff --git a/src/nshd/hackers_git/db_shadow.go b/src/nshd/hackers_git/db_shadow.go
index df628cf..468f79d 100644
--- a/src/nshd/hackers_git/db_shadow.go
+++ b/src/nshd/hackers_git/db_shadow.go
@@ -12,7 +12,7 @@ func (o *Hackers) Shadow_ByName(cred p.Ucred, req p.Request_Shadow_ByName) p.Sha
if cred.Uid != 0 {
return util.Shadow_Ø{}
}
- uid := o.name2uid(string(req))
+ uid := o.name2uid(req.Name)
passwd := o.users[uid].passwd
shadow := p.Shadow{
Name: passwd.Name,
diff --git a/src/nslcd_proto/nslcd_h.go b/src/nslcd_proto/nslcd_h.go
index 5d5bb06..9d53e52 100644
--- a/src/nslcd_proto/nslcd_h.go
+++ b/src/nslcd_proto/nslcd_h.go
@@ -30,8 +30,6 @@ import (
"net"
)
-type void struct{}
-
/*
The protocol used between the nslcd client and server is a simple binary
protocol. It is request/response based where the client initiates a
@@ -80,15 +78,19 @@ type void struct{}
const NSLCD_VERSION int32 = 0x00000002
/* Get a NSLCD configuration option. There is one request parameter: */
-type Request_Config_Get int32 /* NSLCD_CONFIG_* */
+type Request_Config_Get struct{
+ Key int32 /* NSLCD_CONFIG_* */
+}
/* the result value is: */
-type Config string /* interpretation depending on request */
+type Config struct{
+ Value string /* interpretation depending on request */
+}
const NSLCD_ACTION_CONFIG_GET int32 = 0x00010001
const (
/* return the message, if any, that is presented to the user when password
modification through PAM is prohibited */
- NSLCD_CONFIG_PAM_PASSWORD_PROHIBIT_MESSAGE Request_Config_Get = 1
+ NSLCD_CONFIG_PAM_PASSWORD_PROHIBIT_MESSAGE int32 = 1
)
/* Email alias (/etc/aliases) NSS requests. The result values for a
@@ -97,8 +99,8 @@ type Alias struct {
Name string
Recipients []string
}
-const NSLCD_ACTION_ALIAS_BYNAME int32 = 0x00020001; type Request_Alias_ByName string
-const NSLCD_ACTION_ALIAS_ALL int32 = 0x00020008; type Request_Alias_All void
+const NSLCD_ACTION_ALIAS_BYNAME int32 = 0x00020001; type Request_Alias_ByName struct{ Name string }
+const NSLCD_ACTION_ALIAS_ALL int32 = 0x00020008; type Request_Alias_All struct{}
/* Ethernet address/name mapping NSS requests. The result values for a
single entry are: */
@@ -106,9 +108,9 @@ type Ether struct {
Name string
Address [6]byte
}
-const NSLCD_ACTION_ETHER_BYNAME int32 = 0x00030001; type Request_Ether_ByName string
-const NSLCD_ACTION_ETHER_BYETHER int32 = 0x00030002; type Request_Ether_ByEther [6]byte
-const NSLCD_ACTION_ETHER_ALL int32 = 0x00030008; type Request_Ether_All void
+const NSLCD_ACTION_ETHER_BYNAME int32 = 0x00030001; type Request_Ether_ByName struct{ Name string }
+const NSLCD_ACTION_ETHER_BYETHER int32 = 0x00030002; type Request_Ether_ByEther struct{ Ether [6]byte }
+const NSLCD_ACTION_ETHER_ALL int32 = 0x00030008; type Request_Ether_All struct{}
/* Group and group membership related NSS requests. The result values
for a single entry are: */
@@ -119,10 +121,10 @@ type Group struct {
Members []string
}
/* (note that the BYMEMER call returns an emtpy members list) */
-const NSLCD_ACTION_GROUP_BYNAME int32 = 0x00040001; type Request_Group_ByName string
-const NSLCD_ACTION_GROUP_BYGID int32 = 0x00040002; type Request_Group_ByGid int32
-const NSLCD_ACTION_GROUP_BYMEMBER int32 = 0x00040006; type Request_Group_ByMember string
-const NSLCD_ACTION_GROUP_ALL int32 = 0x00040008; type Request_Group_All void
+const NSLCD_ACTION_GROUP_BYNAME int32 = 0x00040001; type Request_Group_ByName struct{ Name string }
+const NSLCD_ACTION_GROUP_BYGID int32 = 0x00040002; type Request_Group_ByGid struct{ Gid int32 }
+const NSLCD_ACTION_GROUP_BYMEMBER int32 = 0x00040006; type Request_Group_ByMember struct{ Member string }
+const NSLCD_ACTION_GROUP_ALL int32 = 0x00040008; type Request_Group_All struct{}
/* Hostname (/etc/hosts) lookup NSS requests. The result values
for an entry are: */
@@ -131,9 +133,9 @@ type Host struct {
Aliases []string
Addresses []net.IP
}
-const NSLCD_ACTION_HOST_BYNAME int32 = 0x00050001; type Request_Host_ByName string
-const NSLCD_ACTION_HOST_BYADDR int32 = 0x00050002; type Request_Host_ByAddr net.IP
-const NSLCD_ACTION_HOST_ALL int32 = 0x00050008; type Request_Host_All void
+const NSLCD_ACTION_HOST_BYNAME int32 = 0x00050001; type Request_Host_ByName struct{ Name string }
+const NSLCD_ACTION_HOST_BYADDR int32 = 0x00050002; type Request_Host_ByAddr struct{ Addr net.IP }
+const NSLCD_ACTION_HOST_ALL int32 = 0x00050008; type Request_Host_All struct{}
/* Netgroup NSS result entries contain a number of parts. A result entry
starts with:
@@ -200,8 +202,8 @@ type Netgroup struct {
Name string
Parts Netgroup_PartList
}
-const NSLCD_ACTION_NETGROUP_BYNAME int32 = 0x00060001; type Request_Netgroup_ByName string
-const NSLCD_ACTION_NETGROUP_ALL int32 = 0x00060008; type Request_Netgroup_All void
+const NSLCD_ACTION_NETGROUP_BYNAME int32 = 0x00060001; type Request_Netgroup_ByName struct{ Name string }
+const NSLCD_ACTION_NETGROUP_ALL int32 = 0x00060008; type Request_Netgroup_All struct{}
const (
NSLCD_NETGROUP_TYPE_NETGROUP int32 = 1
NSLCD_NETGROUP_TYPE_TRIPLE int32 = 2
@@ -215,9 +217,9 @@ type Network struct {
Aliases []string
Addresses []net.IP
}
-const NSLCD_ACTION_NETWORK_BYNAME int32 = 0x00070001; type Request_Network_ByName string
-const NSLCD_ACTION_NETWORK_BYADDR int32 = 0x00070002; type Request_Network_ByAddr net.IP
-const NSLCD_ACTION_NETWORK_ALL int32 = 0x00070008; type Request_Network_All void
+const NSLCD_ACTION_NETWORK_BYNAME int32 = 0x00070001; type Request_Network_ByName struct{ Name string }
+const NSLCD_ACTION_NETWORK_BYADDR int32 = 0x00070002; type Request_Network_ByAddr struct{ Addr net.IP }
+const NSLCD_ACTION_NETWORK_ALL int32 = 0x00070008; type Request_Network_All struct{}
/* User account (/etc/passwd) NSS requests. Result values are: */
type Passwd struct {
@@ -229,9 +231,9 @@ type Passwd struct {
HomeDir string
Shell string
}
-const NSLCD_ACTION_PASSWD_BYNAME int32 = 0x00080001; type Request_Passwd_ByName string
-const NSLCD_ACTION_PASSWD_BYUID int32 = 0x00080002; type Request_Passwd_ByUID int32
-const NSLCD_ACTION_PASSWD_ALL int32 = 0x00080008; type Request_Passwd_All void
+const NSLCD_ACTION_PASSWD_BYNAME int32 = 0x00080001; type Request_Passwd_ByName struct{ Name string }
+const NSLCD_ACTION_PASSWD_BYUID int32 = 0x00080002; type Request_Passwd_ByUID struct{ UID int32 }
+const NSLCD_ACTION_PASSWD_ALL int32 = 0x00080008; type Request_Passwd_All struct{}
/* Protocol information requests. Result values are: */
type Protocol struct {
@@ -239,9 +241,9 @@ type Protocol struct {
Aliases []string
Number int32
}
-const NSLCD_ACTION_PROTOCOL_BYNAME int32 = 0x00090001; type Request_Protocol_ByName string
-const NSLCD_ACTION_PROTOCOL_BYNUMBER int32 = 0x00090002; type Request_Protocol_ByNumber int32
-const NSLCD_ACTION_PROTOCOL_ALL int32 = 0x00090008; type Request_Protocol_All void
+const NSLCD_ACTION_PROTOCOL_BYNAME int32 = 0x00090001; type Request_Protocol_ByName struct{ Name string }
+const NSLCD_ACTION_PROTOCOL_BYNUMBER int32 = 0x00090002; type Request_Protocol_ByNumber struct{ Number int32 }
+const NSLCD_ACTION_PROTOCOL_ALL int32 = 0x00090008; type Request_Protocol_All struct{}
/* RPC information requests. Result values are: */
type RPC struct {
@@ -249,9 +251,9 @@ type RPC struct {
Aliases []string
Number int32
}
-const NSLCD_ACTION_RPC_BYNAME int32 = 0x000a0001; type Request_RPC_ByName string
-const NSLCD_ACTION_RPC_BYNUMBER int32 = 0x000a0002; type Request_RPC_ByNumber int32
-const NSLCD_ACTION_RPC_ALL int32 = 0x000a0008; type Request_RPC_All void
+const NSLCD_ACTION_RPC_BYNAME int32 = 0x000a0001; type Request_RPC_ByName struct{ Name string }
+const NSLCD_ACTION_RPC_BYNUMBER int32 = 0x000a0002; type Request_RPC_ByNumber struct{ Number int32 }
+const NSLCD_ACTION_RPC_ALL int32 = 0x000a0008; type Request_RPC_All struct{}
/* Service (/etc/services) information requests. The BYNAME and BYNUMBER
requests contain an extra protocol string in the request which, if not
@@ -262,9 +264,9 @@ type Service struct {
PortNumber int32
Protocol string
}
-const NSLCD_ACTION_SERVICE_BYNAME int32 = 0x000b0001; type Request_Service_ByName string
-const NSLCD_ACTION_SERVICE_BYNUMBER int32 = 0x000b0002; type Request_Service_ByNumber int32
-const NSLCD_ACTION_SERVICE_ALL int32 = 0x000b0008; type Request_Service_All void
+const NSLCD_ACTION_SERVICE_BYNAME int32 = 0x000b0001; type Request_Service_ByName struct{ Name string }
+const NSLCD_ACTION_SERVICE_BYNUMBER int32 = 0x000b0002; type Request_Service_ByNumber struct{ Number int32 }
+const NSLCD_ACTION_SERVICE_ALL int32 = 0x000b0008; type Request_Service_All struct{}
/* Extended user account (/etc/shadow) information requests. Result
values for a single entry are: */
@@ -281,8 +283,8 @@ type Shadow struct {
ExpireDate int32
Flag int32
}
-const NSLCD_ACTION_SHADOW_BYNAME int32 = 0x000c0001; type Request_Shadow_ByName string
-const NSLCD_ACTION_SHADOW_ALL int32 = 0x000c0008; type Request_Shadow_All void
+const NSLCD_ACTION_SHADOW_BYNAME int32 = 0x000c0001; type Request_Shadow_ByName struct{ Name string }
+const NSLCD_ACTION_SHADOW_ALL int32 = 0x000c0008; type Request_Shadow_All struct{}
/* PAM-related requests. The request parameters for all these requests
begin with: */
@@ -339,7 +341,7 @@ type Request_PAM_SessionClose struct {
SessionID string
}
/* and this calls only returns an empty response value. */
-type PAM_SessionClose void
+type PAM_SessionClose struct{}
const NSLCD_ACTION_PAM_SESSIONCLOSE int32 = 0x000d0004
/* PAM password modification request. This requests has the following extra