Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain-net-srv-vpn
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain-net-srv-vpn
Commits
d532852f
Commit
d532852f
authored
5 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[*] Small fix with active_time/active_days
parent
9f695e9a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dap_chain_net_srv_vpn_cdb_auth.c
+7
-7
7 additions, 7 deletions
dap_chain_net_srv_vpn_cdb_auth.c
with
7 additions
and
7 deletions
dap_chain_net_srv_vpn_cdb_auth.c
+
7
−
7
View file @
d532852f
...
...
@@ -218,13 +218,13 @@ int dap_chain_net_srv_vpn_cdb_auth_cli_cmd ( const char *a_user_str,int a_arg
const
char
*
l_first_name_str
=
NULL
;
const
char
*
l_last_name_str
=
NULL
;
const
char
*
l_email_str
=
NULL
;
const
char
*
l_active_
time
_str
=
NULL
;
const
char
*
l_active_
days
_str
=
NULL
;
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--login"
,
&
l_login_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--password"
,
&
l_password_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--first_name"
,
&
l_first_name_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--last_name"
,
&
l_last_name_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--email"
,
&
l_email_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--active_
time
"
,
&
l_active_
time
_str
);
dap_chain_node_cli_find_option_val
(
a_argv
,
a_arg_index
,
a_argc
,
"--active_
days
"
,
&
l_active_
days
_str
);
if
(
(
l_is_user_create
&&
l_login_str
&&
l_password_str
)
||
(
l_is_user_update
&&
l_login_str
&&
(
l_password_str
||
l_first_name_str
||
l_last_name_str
||
l_email_str
)
)
){
...
...
@@ -252,11 +252,11 @@ int dap_chain_net_srv_vpn_cdb_auth_cli_cmd ( const char *a_user_str,int a_arg
dap_chain_global_db_gr_set
(
dap_strdup
(
l_login_str
),
l_time
,
sizeof
(
*
l_time
),
s_group_ts_updated
);
l_time
=
NULL
;
// to prevent usage uleased memory that could be free in any moment
if
(
l_active_
time
_str
){
uint64_t
l_active_
time
=
strtoull
(
l_active_
time
_str
,
NULL
,
10
);
if
(
l_active_
time
){
*
l_time
=
DAP_NEW_Z
(
dap_chain_time_t
);
*
l_time
=
dap_chain_time_now
()
+
(
dap_chain_time_t
)
l_active_
time
;
if
(
l_active_
days
_str
){
uint64_t
l_active_
days
=
strtoull
(
l_active_
days
_str
,
NULL
,
10
);
if
(
l_active_
days
){
l_time
=
DAP_NEW_Z
(
dap_chain_time_t
);
*
l_time
=
dap_chain_time_now
()
+
(
dap_chain_time_t
)
l_active_
days
*
86400ull
;
dap_chain_global_db_gr_set
(
dap_strdup
(
l_login_str
),
l_time
,
sizeof
(
*
l_time
)
,
s_group_ts_active_till
);
}
else
dap_string_append_printf
(
l_ret_str
,
"WARNING: Wrong --active_time format
\n
"
);
...
...
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