Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Yoann Congal <yoann.congal@smile.fr>
Cc: openembedded-core@lists.openembedded.org,
	Pavel Modilaynen <pavelmn@axis.com>,
	Mingli Yu <mingli.yu@windriver.com>
Subject: Re: [OE-core] [pseudo][PATCH 1/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
Date: Wed, 1 Mar 2023 09:52:17 +0100	[thread overview]
Message-ID: <Y/8SQZ9wDOAtztSX@mail.local> (raw)
In-Reply-To: <20230301000302.93660-2-yoann.congal@smile.fr>

On 01/03/2023 01:03:04+0100, Yoann Congal wrote:
> From: Pavel Modilaynen <pavelmn@axis.com>
> 
> Use close-on-exec (O_CLOEXEC) flag when open log file to
> make sure its file descriptor is not leaked to parent
> process on fork/exec.
> 
> Fixes [YOCTO #13311]
> 

This is missing the author's SoB

> Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
>  pseudo_util.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/pseudo_util.c b/pseudo_util.c
> index 64636b7..b58036f 100644
> --- a/pseudo_util.c
> +++ b/pseudo_util.c
> @@ -1611,7 +1611,7 @@ pseudo_logfile(char *filename, char *defname, int prefer_fd) {
>  		}
>  		free(filename);
>  	}	
> -	fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT, 0644);
> +	fd = open(pseudo_path, O_WRONLY | O_APPEND | O_CREAT | O_CLOEXEC, 0644);
>  	if (fd == -1) {
>  		pseudo_diag("help: can't open log file %s: %s\n", pseudo_path, strerror(errno));
>  	} else {
> -- 
> 2.30.2
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#177861): https://lists.openembedded.org/g/openembedded-core/message/177861
> Mute This Topic: https://lists.openembedded.org/mt/97303652/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2023-03-01  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-01  0:03 [pseudo][PATCH 0/1] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak Yoann Congal
2023-03-01  0:03 ` [pseudo][PATCH 1/1] " Yoann Congal
2023-03-01  8:52   ` Alexandre Belloni [this message]
2023-03-01  9:00     ` [OE-core] " Yoann Congal
2023-03-01  9:04       ` Alexander Kanavin
2023-03-01 10:16       ` Richard Purdie
2023-03-01 10:18   ` Richard Purdie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y/8SQZ9wDOAtztSX@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=mingli.yu@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=pavelmn@axis.com \
    --cc=yoann.congal@smile.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox