summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2015-09-02 12:58:58 -0600
committerLuke Shumaker <lukeshu@sbcglobal.net>2015-09-02 12:58:58 -0600
commit1eb1677cf916c13e07f61efc464edca1c571684d (patch)
treea25a47801de93d3027cf996b51e9cc725876b7d7 /src
parent5fa621f8dfe2ccd674d8d94eb148c10b52b4fca0 (diff)
Clean up
Diffstat (limited to 'src')
-rw-r--r--src/nshd/hackers_git/hackers.go1
-rw-r--r--src/nshd/hackers_git/hackers_parse.go3
-rw-r--r--src/nshd/hackers_git/hackers_watch.go2
-rwxr-xr-xsrc/nslcd_proto/func_handlerequest.go.sh3
-rw-r--r--src/nslcd_proto/nslcd_h.go32
5 files changed, 22 insertions, 19 deletions
diff --git a/src/nshd/hackers_git/hackers.go b/src/nshd/hackers_git/hackers.go
index 5c2ebd3..5876613 100644
--- a/src/nshd/hackers_git/hackers.go
+++ b/src/nshd/hackers_git/hackers.go
@@ -11,7 +11,6 @@ import (
type user struct {
passwd nslcd_proto.Passwd
- pwhash string
groups []string
}
diff --git a/src/nshd/hackers_git/hackers_parse.go b/src/nshd/hackers_git/hackers_parse.go
index b0ed91b..b446ba1 100644
--- a/src/nshd/hackers_git/hackers_parse.go
+++ b/src/nshd/hackers_git/hackers_parse.go
@@ -101,9 +101,8 @@ func load_user_yaml(filename string) (ret user, err error) {
err = &yaml.TypeError{errs}
}
- ret.passwd.Password = "x"
+ ret.passwd.PwHash = "!"
ret.passwd.GID = usersGid
- ret.pwhash = "!"
return
}
diff --git a/src/nshd/hackers_git/hackers_watch.go b/src/nshd/hackers_git/hackers_watch.go
index 1b4f08d..a878f4c 100644
--- a/src/nshd/hackers_git/hackers_watch.go
+++ b/src/nshd/hackers_git/hackers_watch.go
@@ -68,7 +68,7 @@ func (o *Hackers) close() {
func (o *Hackers) reload() (err error) {
o.close()
- o.in_fd, err = inotify.InotifyInit() ; if err != nil { return }
+ o.in_fd, err = inotify.InotifyInit() ; if err != nil { return }
o.in_wd_home, err = o.in_fd.AddWatch("/home" , in_DIR|in_CHILD_ADD); if err != nil { return }
o.in_wd_yaml, err = o.in_fd.AddWatch(o.cfg.Yamldir, in_DIR|in_CHILD_ANY); if err != nil { return }
diff --git a/src/nslcd_proto/func_handlerequest.go.sh b/src/nslcd_proto/func_handlerequest.go.sh
index 4008dd5..185db73 100755
--- a/src/nslcd_proto/func_handlerequest.go.sh
+++ b/src/nslcd_proto/func_handlerequest.go.sh
@@ -37,6 +37,9 @@ done < "$requests"
default:
panic(NslcdError(fmt.Sprintf("unknown request action: %#08x", action)))
}
+ if res == nil {
+ return
+ }
write(out, NSLCD_VERSION)
write(out, action)
diff --git a/src/nslcd_proto/nslcd_h.go b/src/nslcd_proto/nslcd_h.go
index 394e91c..5d5bb06 100644
--- a/src/nslcd_proto/nslcd_h.go
+++ b/src/nslcd_proto/nslcd_h.go
@@ -113,10 +113,10 @@ const NSLCD_ACTION_ETHER_ALL int32 = 0x00030008; type Request_Ether_All
/* Group and group membership related NSS requests. The result values
for a single entry are: */
type Group struct {
- Name string
- Password string
- ID int32
- Members []string
+ Name string
+ PwHash string
+ ID int32
+ Members []string
}
/* (note that the BYMEMER call returns an emtpy members list) */
const NSLCD_ACTION_GROUP_BYNAME int32 = 0x00040001; type Request_Group_ByName string
@@ -221,13 +221,13 @@ const NSLCD_ACTION_NETWORK_ALL int32 = 0x00070008; type Request_Network_Al
/* User account (/etc/passwd) NSS requests. Result values are: */
type Passwd struct {
- Name string
- Password string
- UID int32
- GID int32
- GECOS string
- HomeDir string
- Shell string
+ Name string
+ PwHash string
+ UID int32
+ GID int32
+ GECOS string
+ 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
@@ -272,7 +272,7 @@ type Shadow struct {
// It is my understanding that an empty value for an INT32
// field is expressed with a negative number. -- lukeshu
Name string
- Password string
+ PwHash string
LastChangeDate int32
MinDays int32
MaxDays int32
@@ -298,7 +298,7 @@ type PAM_Base struct {
/* PAM authentication check request. The extra request values are: */
type Request_PAM_Authentication struct {
- Base PAM_Base
+ PAM_Base
Password string
}
/* and the result value consists of: */
@@ -323,18 +323,19 @@ type PAM_Authorization struct {
information. The authorisation error message, if supplied, will be used
by the PAM module instead of a message that is generated by the PAM
module itself. */
-const NSLCD_ACTION_PAM_AUTHORIZATION int32 = 0x000d0002; type Request_PAM_Authorization void
+const NSLCD_ACTION_PAM_AUTHORIZATION int32 = 0x000d0002; type Request_PAM_Authorization PAM_Base
/* PAM session open request. The result value consists of: */
type PAM_SessionOpen struct {
SessionID string
}
/* This session id may be used to close this session with. */
-const NSLCD_ACTION_PAM_SESSIONOPEN int32 = 0x000d0003; type Request_PAM_SessionOpen void
+const NSLCD_ACTION_PAM_SESSIONOPEN int32 = 0x000d0003; type Request_PAM_SessionOpen PAM_Base
/* PAM session close request. This request has the following
extra request value: */
type Request_PAM_SessionClose struct {
+ PAM_Base
SessionID string
}
/* and this calls only returns an empty response value. */
@@ -344,6 +345,7 @@ const NSLCD_ACTION_PAM_SESSIONCLOSE int32 = 0x000d0004
/* PAM password modification request. This requests has the following extra
request values: */
type Request_PAM_PwMod struct {
+ PAM_Base
AsRoot int32 /* 0=oldpasswd is user passwd, 1=oldpasswd is root passwd */
OldPassword string
NewPassword string