diff options
Diffstat (limited to 'go')
-rw-r--r-- | go/cmd-nshd/main.go.in | 5 | ||||
m--------- | go/git.lukeshu.com/go/libgnulinux | 0 | ||||
m--------- | go/git.lukeshu.com/go/libnslcd | 0 | ||||
m--------- | go/git.lukeshu.com/go/libsystemd | 0 | ||||
m--------- | go/golang.org/x/sys | 0 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/db_config.go | 5 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/db_group.go | 4 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/db_pam.go | 17 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/db_passwd.go | 5 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/db_shadow.go | 7 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/hackers.go | 19 | ||||
-rw-r--r-- | go/parabola_hackers/nslcd_backend/util.go | 2 | ||||
-rw-r--r-- | go/parabola_hackers/passwords.go.in | 8 | ||||
-rw-r--r-- | go/parabola_hackers/users.go.in | 6 |
14 files changed, 39 insertions, 39 deletions
diff --git a/go/cmd-nshd/main.go.in b/go/cmd-nshd/main.go.in index b8c3e71..260f553 100644 --- a/go/cmd-nshd/main.go.in +++ b/go/cmd-nshd/main.go.in @@ -14,14 +14,15 @@ // License along with this manual; if not, see // <http://www.gnu.org/licenses/>. -// Command nshd is an implementation of nslcd that talks to hackers.git instead of LDAP. +// Command nshd is an implementation of nslcd that talks to +// hackers.git instead of LDAP. package main import ( "os" hackers_nslcd_backend "parabola_hackers/nslcd_backend" - nslcd_systemd "lukeshu.com/git/go/libnslcd.git/systemd" + "git.lukeshu.com/go/libnslcd/nslcd_systemd" ) func main() { diff --git a/go/git.lukeshu.com/go/libgnulinux b/go/git.lukeshu.com/go/libgnulinux -Subproject d8c4fd9aef9137b04e4311a1f50024ab88d4c6e +Subproject b2bae3c73817740b48a4698c6aa863d70234a64 diff --git a/go/git.lukeshu.com/go/libnslcd b/go/git.lukeshu.com/go/libnslcd -Subproject b97ad53c80372d3246220b8fdb5a7a4c1a4d3f0 +Subproject 939ef442f33dadf17f60ebf9f0c1fbaaa27f0c6 diff --git a/go/git.lukeshu.com/go/libsystemd b/go/git.lukeshu.com/go/libsystemd -Subproject 89efdfbee5f9a22f9dd1083f7a383daba54d4f1 +Subproject 1ac9db65fda0693d13336e6471a858914348f2f diff --git a/go/golang.org/x/sys b/go/golang.org/x/sys new file mode 160000 +Subproject d75a52659825e75fff6158388dddc6a5b04f9ba diff --git a/go/parabola_hackers/nslcd_backend/db_config.go b/go/parabola_hackers/nslcd_backend/db_config.go index e78643b..556aa76 100644 --- a/go/parabola_hackers/nslcd_backend/db_config.go +++ b/go/parabola_hackers/nslcd_backend/db_config.go @@ -17,9 +17,8 @@ package hackers_nslcd_backend import ( - s "syscall" - - p "lukeshu.com/git/go/libnslcd.git/proto" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + s "golang.org/x/sys/unix" ) func (o *Hackers) Config_Get(cred s.Ucred, req p.Request_Config_Get) <-chan p.Config { diff --git a/go/parabola_hackers/nslcd_backend/db_group.go b/go/parabola_hackers/nslcd_backend/db_group.go index 18e54b1..41f049e 100644 --- a/go/parabola_hackers/nslcd_backend/db_group.go +++ b/go/parabola_hackers/nslcd_backend/db_group.go @@ -18,9 +18,9 @@ package hackers_nslcd_backend import ( "parabola_hackers" - s "syscall" - p "lukeshu.com/git/go/libnslcd.git/proto" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + s "golang.org/x/sys/unix" ) func (o *Hackers) groupByName(name string, users bool) p.Group { diff --git a/go/parabola_hackers/nslcd_backend/db_pam.go b/go/parabola_hackers/nslcd_backend/db_pam.go index f770cc1..0538e70 100644 --- a/go/parabola_hackers/nslcd_backend/db_pam.go +++ b/go/parabola_hackers/nslcd_backend/db_pam.go @@ -1,4 +1,4 @@ -// Copyright 2015-2016 Luke Shumaker <lukeshu@sbcglobal.net>. +// Copyright 2015-2016 Luke Shumaker <git.lukeshu@sbcglobal>. // // This is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -20,11 +20,12 @@ import ( "fmt" "os" "parabola_hackers" - s "syscall" - "lukeshu.com/git/go/libgnulinux.git/crypt" - p "lukeshu.com/git/go/libnslcd.git/proto" - "lukeshu.com/git/go/libsystemd.git/sd_daemon/logger" + s "golang.org/x/sys/unix" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + + "git.lukeshu.com/go/libgnulinux/crypt" + "git.lukeshu.com/go/libsystemd/sd_daemon" ) func checkPassword(password string, hash string) bool { @@ -36,7 +37,7 @@ func hashPassword(newPassword string, oldHash string) string { if salt == "!" { str, err := parabola_hackers.RandomString(crypt.SaltAlphabet, 8) if err != nil { - logger.Err("Could not generate a random string") + sd_daemon.Log.Err("Could not generate a random string") str = "" } salt = "$6$" + str + "$" @@ -174,7 +175,7 @@ func (o *Hackers) PAM_PwMod(cred s.Ucred, req p.Request_PAM_PwMod) <-chan p.PAM_ // Update the PwHash in memory user.Passwd.PwHash = hashPassword(req.NewPassword, user.Passwd.PwHash) if len(user.Passwd.PwHash) == 0 { - logger.Err("Password hashing failed") + sd_daemon.Log.Err("Password hashing failed") return } @@ -186,7 +187,7 @@ func (o *Hackers) PAM_PwMod(cred s.Ucred, req p.Request_PAM_PwMod) <-chan p.PAM_ passwords[user.Passwd.Name] = user.Passwd.PwHash err := parabola_hackers.SaveAllPasswords(passwords) if err != nil { - logger.Err("Writing passwords to disk: %v", err) + sd_daemon.Log.Err(fmt.Sprintf("Writing passwords to disk: %v", err)) return } diff --git a/go/parabola_hackers/nslcd_backend/db_passwd.go b/go/parabola_hackers/nslcd_backend/db_passwd.go index 3f32ddd..c5faf5c 100644 --- a/go/parabola_hackers/nslcd_backend/db_passwd.go +++ b/go/parabola_hackers/nslcd_backend/db_passwd.go @@ -17,9 +17,8 @@ package hackers_nslcd_backend import ( - s "syscall" - - p "lukeshu.com/git/go/libnslcd.git/proto" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + s "golang.org/x/sys/unix" ) /* Note that the output password hash value should be one of: diff --git a/go/parabola_hackers/nslcd_backend/db_shadow.go b/go/parabola_hackers/nslcd_backend/db_shadow.go index abfff28..58b13ec 100644 --- a/go/parabola_hackers/nslcd_backend/db_shadow.go +++ b/go/parabola_hackers/nslcd_backend/db_shadow.go @@ -1,4 +1,4 @@ -// Copyright 2015-2016 Luke Shumaker <lukeshu@sbcglobal.net>. +// Copyright 2015-2016 Luke Shumaker <git.lukeshu@sbcglobal>. // // This is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License as @@ -17,9 +17,8 @@ package hackers_nslcd_backend import ( - s "syscall" - - p "lukeshu.com/git/go/libnslcd.git/proto" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + s "golang.org/x/sys/unix" ) func (o *Hackers) Shadow_ByName(cred s.Ucred, req p.Request_Shadow_ByName) <-chan p.Shadow { diff --git a/go/parabola_hackers/nslcd_backend/hackers.go b/go/parabola_hackers/nslcd_backend/hackers.go index bb03862..9cff815 100644 --- a/go/parabola_hackers/nslcd_backend/hackers.go +++ b/go/parabola_hackers/nslcd_backend/hackers.go @@ -19,12 +19,13 @@ package hackers_nslcd_backend import ( + "fmt" "parabola_hackers" "sync" - nslcd_server "lukeshu.com/git/go/libnslcd.git/proto/server" - nslcd_systemd "lukeshu.com/git/go/libnslcd.git/systemd" - "lukeshu.com/git/go/libsystemd.git/sd_daemon/logger" + "git.lukeshu.com/go/libnslcd/nslcd_server" + "git.lukeshu.com/go/libnslcd/nslcd_systemd" + "git.lukeshu.com/go/libsystemd/sd_daemon" ) type config struct { @@ -46,17 +47,17 @@ var _ nslcd_systemd.Backend = &Hackers{} var _ nslcd_server.Backend = &Hackers{} func (o *Hackers) Init() error { - logger.Debug("hackers.git: CfgFilename = %v", o.CfgFilename) + sd_daemon.Log.Debug(fmt.Sprintf("hackers.git: CfgFilename = %v", o.CfgFilename)) err := o.Reload() if err != nil { - logger.Err("hackers.git: Could not initialize: %v", err) + sd_daemon.Log.Err(fmt.Sprintf("hackers.git: Could not initialize: %v", err)) return err } return nil } func (o *Hackers) Close() { - logger.Info("hackers.git: Closing session") + sd_daemon.Log.Info("hackers.git: Closing session") o.lock.Lock() defer o.lock.Unlock() @@ -65,7 +66,7 @@ func (o *Hackers) Close() { } func (o *Hackers) Reload() error { - logger.Info("hackers.git: Loading session") + sd_daemon.Log.Info("hackers.git: Loading session") o.lock.Lock() defer o.lock.Unlock() @@ -74,9 +75,9 @@ func (o *Hackers) Reload() error { if err != nil { return err } - logger.Info("hackers.git: pam_password_prohibit_message: %#v", o.cfg.Pam_password_prohibit_message) + sd_daemon.Log.Info(fmt.Sprintf("hackers.git: pam_password_prohibit_message: %#v", o.cfg.Pam_password_prohibit_message)) - logger.Debug("hackers.git: Parsing user data") + sd_daemon.Log.Debug("hackers.git: Parsing user data") o.users, err = parabola_hackers.LoadAllUsers() if err != nil { return err diff --git a/go/parabola_hackers/nslcd_backend/util.go b/go/parabola_hackers/nslcd_backend/util.go index 4fb28f3..a3b2b5d 100644 --- a/go/parabola_hackers/nslcd_backend/util.go +++ b/go/parabola_hackers/nslcd_backend/util.go @@ -21,7 +21,7 @@ import ( "os" yaml "gopkg.in/yaml.v2" - "lukeshu.com/git/go/libgnulinux.git/getgr" + "git.lukeshu.com/go/libgnulinux/getgr" ) func name2gid(name string) int32 { diff --git a/go/parabola_hackers/passwords.go.in b/go/parabola_hackers/passwords.go.in index b9f93d9..7065eb1 100644 --- a/go/parabola_hackers/passwords.go.in +++ b/go/parabola_hackers/passwords.go.in @@ -23,8 +23,8 @@ import ( "sort" "strings" - "lukeshu.com/git/go/libgnulinux.git/crypt" - "lukeshu.com/git/go/libsystemd.git/sd_daemon/logger" + "git.lukeshu.com/go/libgnulinux/crypt" + "git.lukeshu.com/go/libsystemd/sd_daemon" ) /* Note that the password hash value should be one of: @@ -53,14 +53,14 @@ func LoadAllPasswords() (map[string]string, error) { } cols := strings.SplitN(line, ":", 2) if len(cols) != 2 { - logger.Err("hackers.git %s:%d: malformed line", shadow_file, i+1) + sd_daemon.Log.Err(fmt.Sprintf("hackers.git %s:%d: malformed line", shadow_file, i+1)) continue } username := cols[0] hash := cols[1] if hash != "!" && !crypt.SaltOk(hash) { hash = "!" - logger.Err("%s:%d: malformed hash for user: %s", shadow_file, i+1, username) + sd_daemon.Log.Err(fmt.Sprintf("%s:%d: malformed hash for user: %s", shadow_file, i+1, username)) } passwords[username] = hash } diff --git a/go/parabola_hackers/users.go.in b/go/parabola_hackers/users.go.in index e54de01..3a307be 100644 --- a/go/parabola_hackers/users.go.in +++ b/go/parabola_hackers/users.go.in @@ -21,8 +21,8 @@ import ( "os/exec" yaml "gopkg.in/yaml.v2" - p "lukeshu.com/git/go/libnslcd.git/proto" - "lukeshu.com/git/go/libsystemd.git/sd_daemon/logger" + p "git.lukeshu.com/go/libnslcd/nslcd_proto" + "git.lukeshu.com/go/libsystemd/sd_daemon" ) /* Note that the password hash value should be one of: @@ -67,7 +67,7 @@ func LoadAllUsers() (users map[int32]User, err error) { continue } user.Passwd.UID = int32(uid) - logger.Debug("hackers.git: -> User %d(%s) parsed", user.Passwd.UID, user.Passwd.Name) + sd_daemon.Log.Debug(fmt.Sprintf("hackers.git: -> User %d(%s) parsed", user.Passwd.UID, user.Passwd.Name)) users[user.Passwd.UID] = user } } |