Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
60
Issues
60
List
Boards
Labels
Service Desk
Milestones
Merge Requests
14
Merge Requests
14
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
apk-tools
Commits
0999ec95
Commit
0999ec95
authored
Jul 16, 2012
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
audit: report new directories in recurse mode too
Add new 'd' flag for it.
parent
ea5b08d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
src/audit.c
src/audit.c
+5
-12
No files found.
src/audit.c
View file @
0999ec95
...
...
@@ -103,8 +103,8 @@ static int audit_directory(struct audit_ctx *actx,
struct
apk_db_dir
*
dbd
,
struct
apk_file_info
*
fi
)
{
if
(
dbd
==
NULL
)
return
'D'
;
if
(
dbd
==
NULL
||
dbd
->
refs
==
1
)
return
actx
->
recursive
?
'd'
:
'D'
;
if
(
actx
->
check_permissions
&&
(
dbd
->
mode
!=
0
||
dbd
->
uid
!=
0
||
dbd
->
gid
!=
0
))
{
...
...
@@ -171,26 +171,19 @@ static int audit_directory_tree_item(void *ctx, int dirfd, const char *name)
}
else
{
child
=
apk_db_dir_query
(
db
,
bfull
);
if
(
child
==
NULL
)
recurse
=
FALSE
;
else
child
=
apk_db_dir_ref
(
child
);
goto
done
;
child
=
apk_db_dir_ref
(
child
);
}
reason
=
audit_directory
(
actx
,
db
,
child
,
&
fi
);
if
(
reason
<
0
)
goto
done
;
if
(
reason
==
'D'
)
{
if
(
actx
->
mode
==
MODE_SYSTEM
)
goto
done
;
if
(
!
actx
->
recursive
)
recurse
=
FALSE
;
}
recurse_check:
atctx
->
path
[
atctx
->
pathlen
++
]
=
'/'
;
bfull
.
len
++
;
report_audit
(
actx
,
reason
,
bfull
,
NULL
);
if
(
recurse
)
{
if
(
re
ason
!=
'D'
&&
re
curse
)
{
atctx
->
dir
=
child
;
reason
=
apk_dir_foreach_file
(
openat
(
dirfd
,
name
,
O_RDONLY
|
O_CLOEXEC
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment