diff --git a/CHANGELOG.md b/CHANGELOG.md index 5cb195e..dcd24a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Changed - Update syscall, arches, and audit msg type tables for Linux 5.16. [#96](https://github.com/elastic/go-libaudit/pull/96) +- Fixed error messages from `AddRule()` in the audit client. [#103](https://github.com/elastic/go-libaudit/pull/103) ### Removed diff --git a/audit.go b/audit.go index 250676d..0b9c39b 100644 --- a/audit.go +++ b/audit.go @@ -211,7 +211,7 @@ func (c *AuditClient) GetRules() ([][]byte, error) { for { reply, err := c.getReply(seq) if err != nil { - return nil, fmt.Errorf("failed receive rule data: %w", err) + return nil, fmt.Errorf("failed receiving rule data: %w", err) } if reply.Header.Type == syscall.NLMSG_DONE { @@ -259,7 +259,7 @@ func (c *AuditClient) DeleteRule(rule []byte) error { // Send AUDIT_DEL_RULE message to the kernel. seq, err := c.Netlink.Send(msg) if err != nil { - return fmt.Errorf("failed sending delete request: %w", err) + return fmt.Errorf("failed sending delete rule request: %w", err) } _, err = c.getReply(seq) @@ -283,12 +283,12 @@ func (c *AuditClient) AddRule(rule []byte) error { // Send AUDIT_ADD_RULE message to the kernel. seq, err := c.Netlink.Send(msg) if err != nil { - return fmt.Errorf("failed sending delete request: %w", err) + return fmt.Errorf("failed sending add rule request: %w", err) } ack, err := c.getReply(seq) if err != nil { - return fmt.Errorf("failed to get ACK to rule delete request: %w", err) + return fmt.Errorf("failed to get ACK to add rule request: %w", err) } if ack.Header.Type != syscall.NLMSG_ERROR {