Re: [PATCH] libselinux: Add missing '\n' to avc_log() messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Petr Lautrbach <plautrba@xxxxxxxxxx> writes:

> Signed-off-by: Petr Lautrbach <plautrba@xxxxxxxxxx>
> ---
>  libselinux/src/avc.c          | 2 +-
>  libselinux/src/avc_internal.c | 4 ++--
>  libselinux/src/checkAccess.c  | 4 ++--
>  3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/libselinux/src/avc.c b/libselinux/src/avc.c
> index 8d5983a2fe0c..98a3fcae41c8 100644
> --- a/libselinux/src/avc.c
> +++ b/libselinux/src/avc.c
> @@ -725,7 +725,7 @@ void avc_audit(security_id_t ssid, security_id_t tsid,
>  	if (denied)
>  		log_append(avc_audit_buf, " permissive=%u", result ? 0 : 1);
>  
> -	avc_log(SELINUX_AVC, "%s", avc_audit_buf);
> +	avc_log(SELINUX_AVC, "%s\n", avc_audit_buf);


There is a conflict between this change and commit 142372522c7e ("libselinux: avoid
newline in avc message").

I'll send another version without it.


>  
>  	avc_release_lock(avc_log_lock);
>  }
> diff --git a/libselinux/src/avc_internal.c b/libselinux/src/avc_internal.c
> index 71a1357bc564..c550e5788527 100644
> --- a/libselinux/src/avc_internal.c
> +++ b/libselinux/src/avc_internal.c
> @@ -59,7 +59,7 @@ int avc_process_setenforce(int enforcing)
>  	int rc = 0;
>  
>  	avc_log(SELINUX_SETENFORCE,
> -		"%s:  op=setenforce lsm=selinux enforcing=%d res=1",
> +		"%s:  op=setenforce lsm=selinux enforcing=%d res=1\n",
>  		avc_prefix, enforcing);
>  	if (avc_setenforce)
>  		goto out;
> @@ -81,7 +81,7 @@ int avc_process_policyload(uint32_t seqno)
>  	int rc = 0;
>  
>  	avc_log(SELINUX_POLICYLOAD,
> -		"%s:  op=load_policy lsm=selinux seqno=%u res=1",
> +		"%s:  op=load_policy lsm=selinux seqno=%u res=1\n",
>  		avc_prefix, seqno);
>  	rc = avc_ss_reset(seqno);
>  	if (rc < 0) {
> diff --git a/libselinux/src/checkAccess.c b/libselinux/src/checkAccess.c
> index 022cd6b5ecab..319af267c6a7 100644
> --- a/libselinux/src/checkAccess.c
> +++ b/libselinux/src/checkAccess.c
> @@ -44,7 +44,7 @@ int selinux_check_access(const char *scon, const char *tcon, const char *class,
>         sclass = string_to_security_class(class);
>         if (sclass == 0) {
>  	       rc = errno;
> -	       avc_log(SELINUX_ERROR, "Unknown class %s", class);
> +	       avc_log(SELINUX_ERROR, "Unknown class %s\n", class);
>  	       if (security_deny_unknown() == 0)
>  		       return 0;
>  	       errno = rc;
> @@ -54,7 +54,7 @@ int selinux_check_access(const char *scon, const char *tcon, const char *class,
>         av = string_to_av_perm(sclass, perm);
>         if (av == 0) {
>  	       rc = errno;
> -	       avc_log(SELINUX_ERROR, "Unknown permission %s for class %s", perm, class);
> +	       avc_log(SELINUX_ERROR, "Unknown permission %s for class %s\n", perm, class);
>  	       if (security_deny_unknown() == 0)
>  		       return 0;
>  	       errno = rc;
> -- 
> 2.37.3




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux