Skip to content

Commit

Permalink
use original password for dedicated pam api
Browse files Browse the repository at this point in the history
  • Loading branch information
iychoi committed Oct 23, 2024
1 parent d7bc2e3 commit b40b30f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions irods/connection/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func (conn *IRODSConnection) SupportParallelUpload() bool {
return conn.serverVersion.HasHigherVersionThan(4, 2, 9)
}

func (conn *IRODSConnection) requirePAMPassword() bool {
func (conn *IRODSConnection) requreNewPamAuth() bool {
return conn.serverVersion.HasHigherVersionThan(4, 3, 0)
}

Expand Down Expand Up @@ -579,7 +579,7 @@ func (conn *IRODSConnection) loginPAMWithPassword() error {
authContext := strings.Join([]string{userKV, passwordKV, ttlKV}, ";")

useDedicatedPAMApi := true
if conn.requirePAMPassword() {
if conn.requreNewPamAuth() {
useDedicatedPAMApi = strings.ContainsAny(pamPassword, ";=") || len(authContext) >= 1024+64
}

Expand All @@ -589,7 +589,7 @@ func (conn *IRODSConnection) loginPAMWithPassword() error {
if useDedicatedPAMApi {
logger.Debugf("use dedicated PAM api")

pamAuthRequest := message.NewIRODSMessagePamAuthRequest(conn.account.ProxyUser, pamPassword, ttl)
pamAuthRequest := message.NewIRODSMessagePamAuthRequest(conn.account.ProxyUser, conn.account.Password, ttl)
pamAuthResponse := message.IRODSMessagePamAuthResponse{}
err := conn.RequestAndCheck(pamAuthRequest, &pamAuthResponse, nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion irods/types/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewAuthError(config *IRODSAccount) error {

// Error returns error message
func (err *AuthError) Error() string {
return fmt.Sprintf("authentication error (auth scheme: %q, username: %q, zone: %q)", err.Config.AuthenticationScheme, err.Config.ClientUser, err.Config.ClientZone)
return fmt.Sprintf("authentication error (auth scheme: %q, proxy username: %q, client username: %q, client zone: %q)", err.Config.AuthenticationScheme, err.Config.ProxyUser, err.Config.ClientUser, err.Config.ClientZone)
}

// Is tests type of error
Expand Down

0 comments on commit b40b30f

Please sign in to comment.