Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
6
66
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
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
Eric Vidal
66
Commits
3c4950ac
Commit
3c4950ac
authored
1 year ago
by
Eric Vidal
Browse files
Options
Downloads
Patches
Plain Diff
deny to search external frontend service file inside the module directory
parent
2d399c72
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib66/module/parse_module.c
+17
-4
17 additions, 4 deletions
src/lib66/module/parse_module.c
with
17 additions
and
4 deletions
src/lib66/module/parse_module.c
+
17
−
4
View file @
3c4950ac
...
...
@@ -125,7 +125,6 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
size_t
pos
=
0
,
copylen
=
0
,
len
=
0
;
uint8_t
opt_tree
=
info
->
opt_tree
;
char
name
[
strlen
(
res
->
sa
.
s
+
res
->
name
)
+
1
]
;
auto_strings
(
name
,
res
->
sa
.
s
+
res
->
name
)
;
char
*
src
=
res
->
sa
.
s
+
res
->
path
.
frontend
;
char
dirname
[
strlen
(
src
)]
;
char
copy
[
SS_MAX_PATH_LEN
]
;
...
...
@@ -133,6 +132,8 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
stralloc
list
=
STRALLOC_ZERO
;
resolve_wrapper_t_ref
wres
=
0
;
auto_strings
(
name
,
res
->
sa
.
s
+
res
->
name
)
;
log_trace
(
"parse module: "
,
name
)
;
wres
=
resolve_set_struct
(
DATA_SERVICE
,
res
)
;
...
...
@@ -239,6 +240,16 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
len
=
list
.
len
;
uint8_t
out
=
0
;
char
l
[
len
+
1
]
;
char
ebase
[
copylen
+
1
]
;
memcpy
(
ebase
,
copy
,
copylen
)
;
ebase
[
copylen
]
=
0
;
if
(
!
ob_basename
(
dirname
,
dirname
))
log_dieusys
(
LOG_EXIT_SYS
,
"get basename of: "
,
dirname
)
;
if
(
!
ob_basename
(
ebase
,
ebase
))
log_dieusys
(
LOG_EXIT_SYS
,
"get basename of: "
,
dirname
)
;
stralloc
sa
=
STRALLOC_ZERO
;
sastr_to_char
(
l
,
&
list
)
;
...
...
@@ -251,6 +262,7 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
out
=
0
;
info
->
opt_tree
=
opt_tree
;
char
fname
[
strlen
(
l
+
pos
)]
;
char
const
*
exclude
[
1
]
=
{
0
}
;
if
(
!
ob_basename
(
fname
,
l
+
pos
))
log_dieusys
(
LOG_EXIT_ZERO
,
"basename of: "
,
l
+
pos
)
;
...
...
@@ -259,11 +271,12 @@ void parse_module(resolve_service_t *res, resolve_service_t *ares, unsigned int
if
(
!
strcmp
(
name
,
fname
))
log_die
(
LOG_EXIT_SYS
,
"cyclic call detected -- "
,
name
,
" call "
,
fname
)
;
/** Search first inside the
frontend
directory.
/** Search first inside the
module
directory.
* If not found, search in the entire system. */
if
(
!
service_frontend_path
(
&
sa
,
fname
,
info
->
owner
,
copy
))
{
if
(
!
service_frontend_path
(
&
sa
,
fname
,
info
->
owner
,
copy
,
exclude
))
{
if
(
!
service_frontend_path
(
&
sa
,
fname
,
info
->
owner
,
0
))
char
const
*
inside
[
3
]
=
{
ebase
,
dirname
,
0
}
;
if
(
!
service_frontend_path
(
&
sa
,
fname
,
info
->
owner
,
0
,
inside
))
log_dieu
(
LOG_EXIT_USER
,
"find service frontend file of: "
,
fname
)
;
out
++
;
...
...
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