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
Compare revisions
d5e1eb429228ebe5d237155ee8ba6afae4db74e7 to 2f53a820a892d1e1c4527ce35ec05fd42b675929
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
cellframe/libdap-server-http-db-auth
Select target project
No results found
2f53a820a892d1e1c4527ce35ec05fd42b675929
Select Git revision
Swap
Target
cellframe/libdap-server-http-db-auth
Select target project
cellframe/libdap-server-http-db-auth
1 result
d5e1eb429228ebe5d237155ee8ba6afae4db74e7
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (1)
authorization fixed
· 2f53a820
Constantin Papizh
authored
5 years ago
2f53a820
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
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.