Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Vault
Commits
d7efee8f
Unverified
Commit
d7efee8f
authored
5 years ago
by
Jeff Mitchell
Committed by
GitHub
5 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Fix panic when logging in to userpass without a valid user (#7160)
parent
7f0ff628
Branches unavailable
v1.10.2
v1.10.1
v1.10.0
v1.10.0-rc1
v1.9.6
v1.9.5
v1.9.4
v1.9.3
v1.9.2
v1.9.1
v1.9.0
v1.9.0-rc1
v1.8.11
v1.8.10
v1.8.9
v1.8.8
v1.8.7
v1.8.6
v1.8.5
v1.8.4
v1.8.3
v1.8.2
v1.8.1
v1.8.0
v1.8.0-rc2
v1.8.0-rc1
v1.7.10
v1.7.9
v1.7.8
v1.7.7
v1.7.6
v1.7.5
v1.7.4
v1.7.3
v1.7.2
v1.7.1
v1.7.0
v1.7.0-rc2
v1.7.0-rc1
v1.6.7
v1.6.6
v1.6.5
v1.6.4
v1.6.3
v1.6.2
v1.6.1
v1.6.0
v1.6.0-rc
v1.5.9
v1.5.8
v1.5.7
v1.5.6
v1.5.5
v1.5.4
v1.5.3
v1.5.2
v1.5.1
v1.5.0
v1.5.0-rc
v1.4.7
v1.4.6
v1.4.5
v1.4.4
v1.4.3
v1.4.2
v1.4.1
v1.4.0
v1.4.0-rc1
v1.4.0-beta1
v1.3.10
v1.3.9
v1.3.8
v1.3.7
v1.3.6
v1.3.5
v1.3.4
v1.3.3
v1.3.2
v1.3.1
v1.3.0
v1.3.0-beta1
v1.2.7
v1.2.6
v1.2.5
v1.2.4
v1.2.3
v1.2.2
v1.2.1
v1.2.0
v1.2.0-rc1
sdk/v0.4.1
sdk/v0.4.0
sdk/v0.3.0
sdk/v0.2.1
sdk/v0.2.0
sdk/v0.1.13
sdk/v0.1.12
old-stable-website
old-stable-website-20210728
main-creation
last-go-modable
api/v1.5.0
api/v1.4.1
api/v1.4.0
api/v1.3.1
api/v1.3.0
api/v1.2.0
api/v1.1.1
api/v1.1.0
api/v1.0.4
api/v1.0.3
api/auth/userpass/v0.1.0
api/auth/ldap/v0.1.0
api/auth/kubernetes/v0.1.0
api/auth/gcp/v0.1.0
api/auth/azure/v0.1.0
api/auth/aws/v0.1.0
api/auth/approle/v0.1.1
api/auth/approle/v0.1.0
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
builtin/credential/userpass/path_login.go
+5
-5
builtin/credential/userpass/path_login.go
with
5 additions
and
5 deletions
+5
-5
builtin/credential/userpass/path_login.go
+
5
-
5
View file @
d7efee8f
...
...
@@ -64,11 +64,6 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, d *framew
// Get the user and validate auth
user
,
userError
:=
b
.
user
(
ctx
,
req
.
Storage
,
username
)
// Check for a CIDR match.
if
!
cidrutil
.
RemoteAddrIsOk
(
req
.
Connection
.
RemoteAddr
,
user
.
TokenBoundCIDRs
)
{
return
nil
,
logical
.
ErrPermissionDenied
}
var
userPassword
[]
byte
var
legacyPassword
bool
// If there was an error or it's nil, we fake a password for the bcrypt
...
...
@@ -108,6 +103,11 @@ func (b *backend) pathLogin(ctx context.Context, req *logical.Request, d *framew
return
logical
.
ErrorResponse
(
"invalid username or password"
),
nil
}
// Check for a CIDR match.
if
!
cidrutil
.
RemoteAddrIsOk
(
req
.
Connection
.
RemoteAddr
,
user
.
TokenBoundCIDRs
)
{
return
nil
,
logical
.
ErrPermissionDenied
}
auth
:=
&
logical
.
Auth
{
Metadata
:
map
[
string
]
string
{
"username"
:
username
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help