linux-audit.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] auditctl: check for a watch before adding perm
@ 2021-10-28 19:48 Richard Guy Briggs
  2021-10-28 21:14 ` Steve Grubb
  0 siblings, 1 reply; 2+ messages in thread
From: Richard Guy Briggs @ 2021-10-28 19:48 UTC (permalink / raw)
  To: Linux-Audit Mailing List; +Cc: Richard Guy Briggs

The existing check would never trigger since add and del are defaulted to
AUDIT_FILTER_UNSET which is not zero.

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
---
 src/auditctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/auditctl.c b/src/auditctl.c
index ca6905b2884e..06bb747c5fd2 100644
--- a/src/auditctl.c
+++ b/src/auditctl.c
@@ -1020,7 +1020,7 @@ process_keys:
 		}
 		break;
 	case 'p':
-		if (!add && !del) {
+		if (add == AUDIT_FILTER_UNSET && del == AUDIT_FILTER_UNSET) {
 			audit_msg(LOG_ERR,
 			"permission option needs a watch given prior to it");
 			retval = -1;
-- 
2.27.0

--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] auditctl: check for a watch before adding perm
  2021-10-28 19:48 [PATCH v1] auditctl: check for a watch before adding perm Richard Guy Briggs
@ 2021-10-28 21:14 ` Steve Grubb
  0 siblings, 0 replies; 2+ messages in thread
From: Steve Grubb @ 2021-10-28 21:14 UTC (permalink / raw)
  To: Linux-Audit Mailing List, Richard Guy Briggs

On Thursday, October 28, 2021 3:48:57 PM EDT Richard Guy Briggs wrote:
> The existing check would never trigger since add and del are defaulted to
> AUDIT_FILTER_UNSET which is not zero.

Thanks! Applied.

-Steve

> Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
> ---
>  src/auditctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/auditctl.c b/src/auditctl.c
> index ca6905b2884e..06bb747c5fd2 100644
> --- a/src/auditctl.c
> +++ b/src/auditctl.c
> @@ -1020,7 +1020,7 @@ process_keys:
>  		}
>  		break;
>  	case 'p':
> -		if (!add && !del) {
> +		if (add == AUDIT_FILTER_UNSET && del == AUDIT_FILTER_UNSET) {
>  			audit_msg(LOG_ERR,
>  			"permission option needs a watch given prior to it");
>  			retval = -1;




--
Linux-audit mailing list
Linux-audit@redhat.com
https://listman.redhat.com/mailman/listinfo/linux-audit


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-28 21:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-28 19:48 [PATCH v1] auditctl: check for a watch before adding perm Richard Guy Briggs
2021-10-28 21:14 ` Steve Grubb

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).