Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
User Manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BBF
User Manager
Commits
fa6a85c1
Verified
Commit
fa6a85c1
authored
2 months ago
by
Vivek Dutta
Browse files
Options
Downloads
Patches
Plain Diff
Remove RemoteAccessCapable and updated logging
parent
b6f34ac2
Branches
Branches containing commit
No related tags found
1 merge request
!39
Remove RemoteAccessCapable and updated logging
Pipeline
#204690
passed
2 months ago
Stage: static_code_analysis
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.c
+30
-1
30 additions, 1 deletion
src/main.c
src/users.c
+0
-23
0 additions, 23 deletions
src/users.c
with
30 additions
and
24 deletions
src/main.c
+
30
−
1
View file @
fa6a85c1
...
...
@@ -247,8 +247,37 @@ static int register_config_change(struct ubus_context *uctx)
return
0
;
}
static
void
usage
(
const
char
*
prog
)
{
fprintf
(
stderr
,
"Usage: %s [options]
\n
"
,
prog
);
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
"options:
\n
"
);
fprintf
(
stderr
,
" -l <0-7> Set the loglevel
\n
"
);
fprintf
(
stderr
,
" -h Displays this help
\n
"
);
fprintf
(
stderr
,
"
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
log_level
=
7
;
int
c
=
0
;
while
((
c
=
getopt
(
argc
,
argv
,
"hl:"
))
!=
-
1
)
{
switch
(
c
)
{
case
'l'
:
log_level
=
(
int
)
strtod
(
optarg
,
NULL
);
if
(
log_level
<
0
||
log_level
>
7
)
{
log_level
=
7
;
}
break
;
case
'h'
:
usage
(
argv
[
0
]);
exit
(
0
);
default:
usage
(
argv
[
0
]);
exit
(
0
);
}
}
load_system_users
();
load_system_groups
();
...
...
@@ -258,7 +287,7 @@ int main(int argc, char **argv)
create_users
();
bbfdm_ubus_set_service_name
(
&
bbfdm_ctx
,
"usermngr"
);
bbfdm_ubus_set_log_level
(
3
);
bbfdm_ubus_set_log_level
(
log_level
);
bbfdm_ubus_load_data_model
(
tDynamicObj
);
if
(
bbfdm_ubus_regiter_init
(
&
bbfdm_ctx
))
...
...
This diff is collapsed.
Click to expand it.
src/users.c
+
0
−
23
View file @
fa6a85c1
...
...
@@ -810,12 +810,6 @@ static int get_user_password(char *refparam, struct dmctx *ctx, void *data, char
return
0
;
}
static
int
get_user_remote_accessable
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
*
value
=
bbf_uci_get_value_by_section_fallback_def
(((
struct
dm_data
*
)
data
)
->
config_section
,
"remote_access"
,
"1"
);
return
0
;
}
static
int
get_user_group_participation
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
**
value
)
{
char
*
groups
=
NULL
;
...
...
@@ -1165,22 +1159,6 @@ static int set_user_password(char *refparam, struct dmctx *ctx, void *data, char
return
0
;
}
static
int
set_user_remote_accessable
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
*
value
,
int
action
)
{
bool
b
;
switch
(
action
)
{
case
VALUECHECK
:
if
(
bbfdm_validate_boolean
(
ctx
,
value
))
return
FAULT_9007
;
break
;
case
VALUESET
:
bbf_convert_string_to_bool
(
value
,
&
b
);
bbf_uci_set_value_by_section
(((
struct
dm_data
*
)
data
)
->
config_section
,
"remote_access"
,
b
?
"1"
:
"0"
);
break
;
}
return
0
;
}
static
int
set_user_group_participation
(
char
*
refparam
,
struct
dmctx
*
ctx
,
void
*
data
,
char
*
instance
,
char
*
value
,
int
action
)
{
struct
dm_reference
reference
=
{
0
};
...
...
@@ -1425,7 +1403,6 @@ DMLEAF tUsersUserParams[] = {
{
"UserID"
,
&
DMREAD
,
DMT_UNINT
,
get_user_id
,
NULL
,
BBFDM_BOTH
,
DM_FLAG_UNIQUE
},
{
"Username"
,
&
DMWRITE
,
DMT_STRING
,
get_param_name
,
set_user_username
,
BBFDM_BOTH
,
DM_FLAG_UNIQUE
},
{
"Password"
,
&
DMWRITE
,
DMT_STRING
,
get_user_password
,
set_user_password
,
BBFDM_BOTH
,
DM_FLAG_SECURE
},
{
"RemoteAccessCapable"
,
&
DMWRITE
,
DMT_BOOL
,
get_user_remote_accessable
,
set_user_remote_accessable
,
BBFDM_BOTH
},
{
"GroupParticipation"
,
&
DMWRITE
,
DMT_STRING
,
get_user_group_participation
,
set_user_group_participation
,
BBFDM_BOTH
,
DM_FLAG_REFERENCE
},
{
"RoleParticipation"
,
&
DMWRITE
,
DMT_STRING
,
get_role_participation
,
set_role_participation
,
BBFDM_BOTH
,
DM_FLAG_REFERENCE
},
{
"StaticUser"
,
&
DMREAD
,
DMT_BOOL
,
get_user_static_user
,
NULL
,
BBFDM_BOTH
},
...
...
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