Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-server-http-db-auth
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cellframe
libdap-server-http-db-auth
Commits
2f53a820
Commit
2f53a820
authored
5 years ago
by
Constantin Papizh
Browse files
Options
Downloads
Patches
Plain Diff
authorization fixed
parent
d5e1eb42
No related branches found
No related tags found
1 merge request
!2
authorization fixed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/db_auth.c
+10
-5
10 additions, 5 deletions
src/db_auth.c
with
10 additions
and
5 deletions
src/db_auth.c
+
10
−
5
View file @
2f53a820
...
...
@@ -1038,13 +1038,18 @@ void db_auth_http_proc(enc_http_delegate_t *a_delegate, void * a_arg)
char
l_password
[
1024
]
=
{
0
};
char
l_domain
[
64
]
=
{
0
};
char
l_pkey
[
4096
]
=
{
0
};
char
l_something
[
64
]
=
{
0
};
if
(
sscanf
(
a_delegate
->
request_str
,
"%255s %1023s %63s %4095s"
,
l_user
,
l_password
,
l_domain
,
l_pkey
)
>=
3
){
if
(
sscanf
(
a_delegate
->
request_str
,
"%255s %1023s %63s %4095s
%64s
"
,
l_user
,
l_password
,
l_domain
,
l_pkey
,
l_something
)
>=
3
){
log_it
(
L_INFO
,
"Trying to login with username '%s'"
,
l_user
);
if
(
!
check_user_data_for_space
(
strlen
(
a_delegate
->
request_str
),
(
strlen
(
l_user
)
+
strlen
(
l_password
)
+
strlen
(
l_domain
)))){
log_it
(
L_WARNING
,
"Wrong symbols in username or password or domain"
);
log_it
(
L_DEBUG
,
"%s@%s %s"
,
l_user
,
l_pkey
);
if
(
!
check_user_data_for_space
(
strlen
(
a_delegate
->
request_str
),
strlen
(
l_user
)
+
strlen
(
l_password
)
+
strlen
(
l_domain
)
+
strlen
(
l_pkey
)
+
strlen
(
l_something
))){
log_it
(
L_WARNING
,
"Wrong symbols in username or password or domain, misfit is %d"
,
strlen
(
a_delegate
->
request_str
)
-
strlen
(
l_user
)
-
strlen
(
l_password
)
-
strlen
(
l_domain
)
-
strlen
(
l_pkey
)
-
strlen
(
l_something
));
//log_it(L_WARNING, "l_user size: %d", strlen(l_user));
//log_it(L_WARNING, "l_pass size: %d", strlen(l_password));
//log_it(L_WARNING, "l_pkey size: %d", strlen(l_pkey));
log_it
(
L_DEBUG
,
"%s@%s"
,
l_user
,
l_password
);
enc_http_reply_f
(
a_delegate
,
OP_CODE_INCORRECT_SYMOLS
);
*
return_code
=
Http_Status_BadRequest
;
return
;
...
...
@@ -1243,5 +1248,5 @@ static bool mongod_is_running()
/// (there are 2 separator spaces), otherwise false.
bool
check_user_data_for_space
(
size_t
before_parsing
,
size_t
after_parsing
)
{
return
(
before_parsing
-
after_parsing
)
==
2
;
return
(
before_parsing
-
after_parsing
)
==
3
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment