소스 검색

security: fix improper PAM authorization handling (#6819)

Co-authored-by: Joe Chen <[email protected]>
ysf 3 년 전
부모
커밋
940a7da9d1
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 0
      CHANGELOG.md
  2. 6 2
      internal/auth/pam/pam.go

+ 1 - 0
CHANGELOG.md

@@ -22,6 +22,7 @@ All notable changes to Gogs are documented in this file.
 ### Fixed
 
 - _Security:_ Potential SSRF in repository migration. [#6754](https://github.com/gogs/gogs/issues/6754)
+- _Security:_ Improper PAM authorization handling. [#6810](https://github.com/gogs/gogs/issues/6810)
 - Unable to use LDAP authentication on ARM machines. [#6761](https://github.com/gogs/gogs/issues/6761)
 
 ### Removed

+ 6 - 2
internal/auth/pam/pam.go

@@ -25,6 +25,10 @@ func (c *Config) doAuth(login, password string) error {
 	if err != nil {
 		return err
 	}
-
-	return t.Authenticate(0)
+	
+	err = t.Authenticate(0)
+	if err != nil {
+		return err
+	}
+	return t.AcctMgmt(0)
 }