From 7e5063a93d15945150339c30beb6d09ba7b42939 Mon Sep 17 00:00:00 2001 From: Robert Rauch Date: Wed, 1 Apr 2015 00:45:00 +0200 Subject: [PATCH 1/4] fix typo in centos init script We should be *sourcing* `/etc/sysconfig/gogs`, not *executing* it, don't we? --- scripts/init/centos/gogs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/init/centos/gogs b/scripts/init/centos/gogs index 1a92ff2070..5ff6de537f 100644 --- a/scripts/init/centos/gogs +++ b/scripts/init/centos/gogs @@ -33,7 +33,7 @@ LOGFILE=${GOGS_HOME}/log/gogs.log RETVAL=0 # Read configuration from /etc/sysconfig/gogs to override defaults -[ -r /etc/sysconfig/$NAME ] && ./etc/sysconfig/$NAME +[ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME # Don't do anything if nothing is installed [ -x ${GOGS_PATH} ] || exit 0 From f78046fc3be8db80f8ac44512237c92825540e5d Mon Sep 17 00:00:00 2001 From: Dustin Willis Webber Date: Thu, 16 Apr 2015 14:36:32 -0400 Subject: [PATCH 2/4] typo fix --- models/login.go | 2 +- models/user.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/models/login.go b/models/login.go index 916e27310c..73d112568b 100644 --- a/models/login.go +++ b/models/login.go @@ -169,7 +169,7 @@ func UserSignIn(uname, passwd string) (*User, error) { // For plain login, user must exist to reach this line. // Now verify password. if u.LoginType == PLAIN { - if !u.ValidtePassword(passwd) { + if !u.ValidatePassword(passwd) { return nil, ErrUserNotExist } return u, nil diff --git a/models/user.go b/models/user.go index dcfd0dc5ec..8651464e7b 100644 --- a/models/user.go +++ b/models/user.go @@ -146,7 +146,7 @@ func (u *User) EncodePasswd() { } // ValidtePassword checks if given password matches the one belongs to the user. -func (u *User) ValidtePassword(passwd string) bool { +func (u *User) ValidatePassword(passwd string) bool { newUser := &User{Passwd: passwd, Salt: u.Salt} newUser.EncodePasswd() return u.Passwd == newUser.Passwd From e57594dc31fc42c1bb7ba0df77d1d4f249f8f079 Mon Sep 17 00:00:00 2001 From: Dustin Willis Webber Date: Thu, 16 Apr 2015 14:40:39 -0400 Subject: [PATCH 3/4] typo fix for comment --- models/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/user.go b/models/user.go index 8651464e7b..e0ba4be3c1 100644 --- a/models/user.go +++ b/models/user.go @@ -145,7 +145,7 @@ func (u *User) EncodePasswd() { u.Passwd = fmt.Sprintf("%x", newPasswd) } -// ValidtePassword checks if given password matches the one belongs to the user. +// ValidatePassword checks if given password matches the one belongs to the user. func (u *User) ValidatePassword(passwd string) bool { newUser := &User{Passwd: passwd, Salt: u.Salt} newUser.EncodePasswd() From 5a4f314cf7465425bb2802bf9d2995c258af6697 Mon Sep 17 00:00:00 2001 From: Dustin Willis Webber Date: Thu, 16 Apr 2015 14:42:24 -0400 Subject: [PATCH 4/4] fix calls that go rename missed --- routers/api/v1/repo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/api/v1/repo.go b/routers/api/v1/repo.go index d7cc5955ab..4ec524b401 100644 --- a/routers/api/v1/repo.go +++ b/routers/api/v1/repo.go @@ -163,7 +163,7 @@ func MigrateRepo(ctx *middleware.Context, form auth.MigrateRepoForm) { } return } - if !u.ValidtePassword(ctx.Query("password")) { + if !u.ValidatePassword(ctx.Query("password")) { ctx.HandleAPI(422, "Username or password is not correct.") return }