Page MenuHomeFreeBSD

audit(4): Syscalls dealing with {mounted/unmounted} file system statistics
ClosedPublic

Authored by aniketp on Jun 10 2018, 10:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 7, 2:51 PM
Unknown Object (File)
Wed, Nov 27, 12:05 PM
Unknown Object (File)
Nov 22 2024, 10:31 AM
Unknown Object (File)
Nov 20 2024, 6:46 PM
Unknown Object (File)
Nov 18 2024, 5:08 PM
Unknown Object (File)
Nov 18 2024, 3:28 PM
Unknown Object (File)
Nov 17 2024, 6:37 PM
Unknown Object (File)
Nov 17 2024, 3:53 PM
Subscribers

Details

Summary

The following change introduces 3 system calls dealing with retrieving file system
statistics and list of mounted filesystems. The system calls are categorized as audit
events within file-attribute-access audit class

List of system calls:

  • statfs(2)
  • fstatfs(2)
  • getfsstat(2)
Test Plan

Execute make && make install from test/sys/audit.
Execute kyua test from /usr/tests/sys/audit. All testcases should succeed.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Build fails.

$ make && sudo make install
(cd /usr/home/somers/freebsd/base/head/tests/sys/audit &&  DEPENDFILE=.depend.file-attribute-access  NO_SUBDIR=1 make -f /usr/home/somers/freebsd/base/head/tests/sys/audit/Makefile _RECURSING_PROGS=t  PROG=file-attribute-access )
rm -f .depend.file-attribute-access
echo file-attribute-access.full: /usr/lib/libc.a /usr/lib/libprivateatf-c.a >> .depend.file-attribute-access
cc  -O2 -pipe   -g -MD  -MF.depend.file-attribute-access.file-attribute-access.o -MTfile-attribute-access.o -std=gnu99 -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wmissing-variable-declarations -Wthread-safety -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable  -Qunused-arguments  -c /usr/home/somers/freebsd/base/head/tests/sys/audit/file-attribute-access.c -o file-attribute-access.o
/usr/home/somers/freebsd/base/head/tests/sys/audit/file-attribute-access.c:294:19: error: 
      use of undeclared identifier 'regex'
        check_audit(fds, regex, pipefd);
                         ^
1 error generated.                                                              
*** Error code 1

Stop.
make[1]: stopped in /usr/home/somers/freebsd/base/head/tests/sys/audit
*** Error code 1

Stop.
make: stopped in /usr/home/somers/freebsd/base/head/tests/sys/audit
This revision now requires changes to proceed.Jun 11 2018, 12:06 AM

Replace regex with extregex

Looks like there are also some file descriptors to close here.

@asomers I'll rebase this file after D15782 is committed. Since both revisions change the file: file-attribute-access.

Close file descriptor for statfs(2) and fstatfs(2) success case

It no longer compiles. I think those headers were important.

Include missing headers and struct statfs declaration

This revision is now accepted and ready to land.Jun 14 2018, 1:22 AM
This revision was automatically updated to reflect the committed changes.