All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Open file with O_CLOEXEC to avoid fd leak
@ 2020-01-19  3:50 mingli.yu
  2020-01-19  4:02 ` ✗ patchtest: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: mingli.yu @ 2020-01-19  3:50 UTC (permalink / raw)
  To: openembedded-core, seebs; +Cc: pavelmn

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.
---
 pseudo_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_util.c b/pseudo_util.c
index c867ed6..0ec527b 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1594,7 +1594,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.7.4



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

* ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak
  2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
@ 2020-01-19  4:02 ` Patchwork
  2020-01-19  4:12 ` [PATCH v2] " mingli.yu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2020-01-19  4:02 UTC (permalink / raw)
  To: mingli.yu; +Cc: openembedded-core

== Series Details ==

Series: Open file with O_CLOEXEC to avoid fd leak
Revision: 1
URL   : https://patchwork.openembedded.org/series/22123/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 9d7a521971)

* Patch            Open file with O_CLOEXEC to avoid fd leak
 Issue             Shortlog does not follow expected format [test_shortlog_format] 
  Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"

* Patch            Open file with O_CLOEXEC to avoid fd leak
 Issue             Patch is missing Signed-off-by [test_signed_off_by_presence] 
  Suggested fix    Sign off the patch (either manually or with "git commit --amend -s")



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* [PATCH v2] Open file with O_CLOEXEC to avoid fd leak
  2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
  2020-01-19  4:02 ` ✗ patchtest: failure for " Patchwork
@ 2020-01-19  4:12 ` mingli.yu
  2020-01-19  4:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev2) Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 14+ messages in thread
From: mingli.yu @ 2020-01-19  4:12 UTC (permalink / raw)
  To: openembedded-core, seebs; +Cc: pavelmn

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.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 pseudo_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_util.c b/pseudo_util.c
index c867ed6..0ec527b 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1594,7 +1594,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.7.4



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

* ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev2)
  2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
  2020-01-19  4:02 ` ✗ patchtest: failure for " Patchwork
  2020-01-19  4:12 ` [PATCH v2] " mingli.yu
@ 2020-01-19  4:32 ` Patchwork
  2020-01-19  5:15 ` [PATCH v3] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
  2020-01-19  5:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Patchwork
  4 siblings, 0 replies; 14+ messages in thread
From: Patchwork @ 2020-01-19  4:32 UTC (permalink / raw)
  To: mingli.yu; +Cc: openembedded-core

== Series Details ==

Series: Open file with O_CLOEXEC to avoid fd leak (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/22123/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 9d7a521971)

* Patch            [v2] Open file with O_CLOEXEC to avoid fd leak
 Issue             Shortlog does not follow expected format [test_shortlog_format] 
  Suggested fix    Commit shortlog (first line of commit message) should follow the format "<target>: <summary>"



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* [PATCH v3] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
  2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
                   ` (2 preceding siblings ...)
  2020-01-19  4:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev2) Patchwork
@ 2020-01-19  5:15 ` mingli.yu
  2020-01-19  5:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Patchwork
  4 siblings, 0 replies; 14+ messages in thread
From: mingli.yu @ 2020-01-19  5:15 UTC (permalink / raw)
  To: openembedded-core, seebs; +Cc: pavelmn

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.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 pseudo_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_util.c b/pseudo_util.c
index c867ed6..0ec527b 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1594,7 +1594,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.7.4



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

* ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
                   ` (3 preceding siblings ...)
  2020-01-19  5:15 ` [PATCH v3] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
@ 2020-01-19  5:32 ` Patchwork
  2020-01-19  5:41   ` Yu, Mingli
  4 siblings, 1 reply; 14+ messages in thread
From: Patchwork @ 2020-01-19  5:32 UTC (permalink / raw)
  To: mingli.yu; +Cc: openembedded-core

== Series Details ==

Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
Revision: 3
URL   : https://patchwork.openembedded.org/series/22123/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             Series does not apply on top of target branch [test_series_merge_on_head] 
  Suggested fix    Rebase your series on top of targeted branch
  Targeted branch  master (currently at 9d7a521971)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-19  5:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Patchwork
@ 2020-01-19  5:41   ` Yu, Mingli
  2020-01-20  1:29     ` Paul Eggleton
  0 siblings, 1 reply; 14+ messages in thread
From: Yu, Mingli @ 2020-01-19  5:41 UTC (permalink / raw)
  To: openembedded-core



On 01/19/20 13:32, Patchwork wrote:
> == Series Details ==
>
> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
> Revision: 3
> URL   : https://patchwork.openembedded.org/series/22123/
> State : failure
>
> == Summary ==
>
>
> Thank you for submitting this patch series to OpenEmbedded Core. This is
> an automated response. Several tests have been executed on the proposed
> series by patchtest resulting in the following failures:
>
>
>
> * Issue             Series does not apply on top of target branch [test_series_merge_on_head]
>    Suggested fix    Rebase your series on top of targeted branch
>    Targeted branch  master (currently at 9d7a521971)

Have already rebased on the master branch of 
http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue out 
the above issue? Any hint?

Thanks,

>
>
>
> If you believe any of these test results are incorrect, please reply to the
> mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
> Otherwise we would appreciate you correcting the issues and submitting a new
> version of the patchset if applicable. Please ensure you add/increment the
> version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
> [PATCH v3] -> ...).
>
> ---
> Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
> Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
> Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
>
>


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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-19  5:41   ` Yu, Mingli
@ 2020-01-20  1:29     ` Paul Eggleton
  2020-01-20  1:34       ` Yu, Mingli
  0 siblings, 1 reply; 14+ messages in thread
From: Paul Eggleton @ 2020-01-20  1:29 UTC (permalink / raw)
  To: Yu, Mingli; +Cc: openembedded-core

Hi Mingli

On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
> On 01/19/20 13:32, Patchwork wrote:
> > == Series Details ==
> >
> > Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
> > Revision: 3
> > URL   : https://patchwork.openembedded.org/series/22123/
> > State : failure
> >
> > == Summary ==
> >
> >
> > Thank you for submitting this patch series to OpenEmbedded Core. This is
> > an automated response. Several tests have been executed on the proposed
> > series by patchtest resulting in the following failures:
> >
> >
> >
> > * Issue             Series does not apply on top of target branch [test_series_merge_on_head]
> >    Suggested fix    Rebase your series on top of targeted branch
> >    Targeted branch  master (currently at 9d7a521971)
> 
> Have already rebased on the master branch of 
> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue out 
> the above issue? Any hint?

It's assuming that patches sent to this list are for OE-Core (which they
generally are). I wasn't aware but apparently the documented place to
send pseudo patches is this list, so I think in this case you can just ignore
patchtest.

Cheers,
Paul

-- 

Paul Eggleton
Intel System Software Products




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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-20  1:29     ` Paul Eggleton
@ 2020-01-20  1:34       ` Yu, Mingli
  2020-01-20  2:28         ` Peter Kjellerstedt
  0 siblings, 1 reply; 14+ messages in thread
From: Yu, Mingli @ 2020-01-20  1:34 UTC (permalink / raw)
  To: Paul Eggleton; +Cc: openembedded-core



On 01/20/20 09:29, Paul Eggleton wrote:
> Hi Mingli
>
> On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
>> On 01/19/20 13:32, Patchwork wrote:
>>> == Series Details ==
>>>
>>> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
>>> Revision: 3
>>> URL   : https://patchwork.openembedded.org/series/22123/
>>> State : failure
>>>
>>> == Summary ==
>>>
>>>
>>> Thank you for submitting this patch series to OpenEmbedded Core. This is
>>> an automated response. Several tests have been executed on the proposed
>>> series by patchtest resulting in the following failures:
>>>
>>>
>>>
>>> * Issue             Series does not apply on top of target branch [test_series_merge_on_head]
>>>     Suggested fix    Rebase your series on top of targeted branch
>>>     Targeted branch  master (currently at 9d7a521971)
>>
>> Have already rebased on the master branch of
>> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue out
>> the above issue? Any hint?
>
> It's assuming that patches sent to this list are for OE-Core (which they
> generally are). I wasn't aware but apparently the documented place to
> send pseudo patches is this list, so I think in this case you can just ignore
> patchtest.

Okay, many thanks Paul for your hint!

Thanks,

>
> Cheers,
> Paul
>


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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-20  1:34       ` Yu, Mingli
@ 2020-01-20  2:28         ` Peter Kjellerstedt
  2020-01-20  3:04           ` Yu, Mingli
  0 siblings, 1 reply; 14+ messages in thread
From: Peter Kjellerstedt @ 2020-01-20  2:28 UTC (permalink / raw)
  To: Yu, Mingli, Paul Eggleton; +Cc: openembedded-core@lists.openembedded.org

> -----Original Message-----
> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
> bounces@lists.openembedded.org> On Behalf Of Yu, Mingli
> Sent: den 20 januari 2020 02:34
> To: Paul Eggleton <paul.eggleton@linux.intel.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with O_CLOEXEC
> to avoid fd leak (rev3)
> 
> On 01/20/20 09:29, Paul Eggleton wrote:
> > Hi Mingli
> >
> > On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
> >> On 01/19/20 13:32, Patchwork wrote:
> >>> == Series Details ==
> >>>
> >>> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
> >>> Revision: 3
> >>> URL   : https://patchwork.openembedded.org/series/22123/
> >>> State : failure
> >>>
> >>> == Summary ==
> >>>
> >>>
> >>> Thank you for submitting this patch series to OpenEmbedded Core. This
> is
> >>> an automated response. Several tests have been executed on the
> proposed
> >>> series by patchtest resulting in the following failures:
> >>>
> >>>
> >>>
> >>> * Issue             Series does not apply on top of target branch
> [test_series_merge_on_head]
> >>>     Suggested fix    Rebase your series on top of targeted branch
> >>>     Targeted branch  master (currently at 9d7a521971)
> >>
> >> Have already rebased on the master branch of
> >> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue out
> >> the above issue? Any hint?
> >
> > It's assuming that patches sent to this list are for OE-Core (which they
> > generally are). I wasn't aware but apparently the documented place to
> > send pseudo patches is this list, so I think in this case you can just
> > ignore patchtest.
> 
> Okay, many thanks Paul for your hint!
> 
> Thanks,
> 
> >
> > Cheers,
> > Paul

But it is probably a good idea to include a "[pseudo]" tag in the subject 
when sending patches related to pseudo to this list, as the expectation 
otherwise is that they are for OE-Core.

//Peter

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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-20  2:28         ` Peter Kjellerstedt
@ 2020-01-20  3:04           ` Yu, Mingli
  2020-01-20  3:15             ` Peter Kjellerstedt
  0 siblings, 1 reply; 14+ messages in thread
From: Yu, Mingli @ 2020-01-20  3:04 UTC (permalink / raw)
  To: Peter Kjellerstedt, Paul Eggleton
  Cc: openembedded-core@lists.openembedded.org



On 01/20/20 10:28, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: openembedded-core-bounces@lists.openembedded.org <openembedded-core-
>> bounces@lists.openembedded.org> On Behalf Of Yu, Mingli
>> Sent: den 20 januari 2020 02:34
>> To: Paul Eggleton <paul.eggleton@linux.intel.com>
>> Cc: openembedded-core@lists.openembedded.org
>> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with O_CLOEXEC
>> to avoid fd leak (rev3)
>>
>> On 01/20/20 09:29, Paul Eggleton wrote:
>>> Hi Mingli
>>>
>>> On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
>>>> On 01/19/20 13:32, Patchwork wrote:
>>>>> == Series Details ==
>>>>>
>>>>> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
>>>>> Revision: 3
>>>>> URL   : https://patchwork.openembedded.org/series/22123/
>>>>> State : failure
>>>>>
>>>>> == Summary ==
>>>>>
>>>>>
>>>>> Thank you for submitting this patch series to OpenEmbedded Core. This
>> is
>>>>> an automated response. Several tests have been executed on the
>> proposed
>>>>> series by patchtest resulting in the following failures:
>>>>>
>>>>>
>>>>>
>>>>> * Issue             Series does not apply on top of target branch
>> [test_series_merge_on_head]
>>>>>      Suggested fix    Rebase your series on top of targeted branch
>>>>>      Targeted branch  master (currently at 9d7a521971)
>>>>
>>>> Have already rebased on the master branch of
>>>> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue out
>>>> the above issue? Any hint?
>>>
>>> It's assuming that patches sent to this list are for OE-Core (which they
>>> generally are). I wasn't aware but apparently the documented place to
>>> send pseudo patches is this list, so I think in this case you can just
>>> ignore patchtest.
>>
>> Okay, many thanks Paul for your hint!
>>
>> Thanks,
>>
>>>
>>> Cheers,
>>> Paul
>
> But it is probably a good idea to include a "[pseudo]" tag in the subject
> when sending patches related to pseudo to this list, as the expectation
> otherwise is that they are for OE-Core.

Thanks Peter! And already add the "pseudo_util.c" tag in the subject in 
the v3, please check the mail with the subject "[OE-core] [PATCH v3] 
pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak".

Thanks,

>
> //Peter
>


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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-20  3:04           ` Yu, Mingli
@ 2020-01-20  3:15             ` Peter Kjellerstedt
  2020-01-20  3:27               ` [pseudo v4] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
  2020-01-20  3:27               ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Yu, Mingli
  0 siblings, 2 replies; 14+ messages in thread
From: Peter Kjellerstedt @ 2020-01-20  3:15 UTC (permalink / raw)
  To: Yu, Mingli, Paul Eggleton; +Cc: openembedded-core@lists.openembedded.org

> -----Original Message-----
> From: Yu, Mingli <mingli.yu@windriver.com>
> Sent: den 20 januari 2020 04:04
> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; Paul Eggleton
> <paul.eggleton@linux.intel.com>
> Cc: openembedded-core@lists.openembedded.org
> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with O_CLOEXEC
> to avoid fd leak (rev3)
> 
> On 01/20/20 10:28, Peter Kjellerstedt wrote:
> >> -----Original Message-----
> >> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
> core-
> >> bounces@lists.openembedded.org> On Behalf Of Yu, Mingli
> >> Sent: den 20 januari 2020 02:34
> >> To: Paul Eggleton <paul.eggleton@linux.intel.com>
> >> Cc: openembedded-core@lists.openembedded.org
> >> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with
> O_CLOEXEC
> >> to avoid fd leak (rev3)
> >>
> >> On 01/20/20 09:29, Paul Eggleton wrote:
> >>> Hi Mingli
> >>>
> >>> On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
> >>>> On 01/19/20 13:32, Patchwork wrote:
> >>>>> == Series Details ==
> >>>>>
> >>>>> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
> >>>>> Revision: 3
> >>>>> URL   : https://patchwork.openembedded.org/series/22123/
> >>>>> State : failure
> >>>>>
> >>>>> == Summary ==
> >>>>>
> >>>>>
> >>>>> Thank you for submitting this patch series to OpenEmbedded Core.
> This
> >> is
> >>>>> an automated response. Several tests have been executed on the
> >> proposed
> >>>>> series by patchtest resulting in the following failures:
> >>>>>
> >>>>>
> >>>>>
> >>>>> * Issue             Series does not apply on top of target branch
> >> [test_series_merge_on_head]
> >>>>>      Suggested fix    Rebase your series on top of targeted branch
> >>>>>      Targeted branch  master (currently at 9d7a521971)
> >>>>
> >>>> Have already rebased on the master branch of
> >>>> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue
> out
> >>>> the above issue? Any hint?
> >>>
> >>> It's assuming that patches sent to this list are for OE-Core (which
> they
> >>> generally are). I wasn't aware but apparently the documented place to
> >>> send pseudo patches is this list, so I think in this case you can just
> >>> ignore patchtest.
> >>
> >> Okay, many thanks Paul for your hint!
> >>
> >> Thanks,
> >>
> >>>
> >>> Cheers,
> >>> Paul
> >
> > But it is probably a good idea to include a "[pseudo]" tag in the
> subject
> > when sending patches related to pseudo to this list, as the expectation
> > otherwise is that they are for OE-Core.
> 
> Thanks Peter! And already add the "pseudo_util.c" tag in the subject in
> the v3, please check the mail with the subject "[OE-core] [PATCH v3]
> pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak".

That is not the same. The "pseudo_util.c:" is part of the commit subject 
and will end up in the Git repository. A "[pseudo]" tag is for anyone 
seeing the mail (possibly including patchwork and patchtest), letting 
them know that this commit is about pseudo, not OE-Core (similar to the 
"[PATCH v3]" tag, which is also information about the commit).

> Thanks,
> 
> > //Peter

//Peter


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

* [pseudo v4] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak
  2020-01-20  3:15             ` Peter Kjellerstedt
@ 2020-01-20  3:27               ` mingli.yu
  2020-01-20  3:27               ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Yu, Mingli
  1 sibling, 0 replies; 14+ messages in thread
From: mingli.yu @ 2020-01-20  3:27 UTC (permalink / raw)
  To: openembedded-core, peter.kjellerstedt, seebs

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.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 pseudo_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pseudo_util.c b/pseudo_util.c
index c867ed6..0ec527b 100644
--- a/pseudo_util.c
+++ b/pseudo_util.c
@@ -1594,7 +1594,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.7.4



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

* Re: ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3)
  2020-01-20  3:15             ` Peter Kjellerstedt
  2020-01-20  3:27               ` [pseudo v4] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
@ 2020-01-20  3:27               ` Yu, Mingli
  1 sibling, 0 replies; 14+ messages in thread
From: Yu, Mingli @ 2020-01-20  3:27 UTC (permalink / raw)
  To: Peter Kjellerstedt, Paul Eggleton
  Cc: openembedded-core@lists.openembedded.org



On 01/20/20 11:15, Peter Kjellerstedt wrote:
>> -----Original Message-----
>> From: Yu, Mingli <mingli.yu@windriver.com>
>> Sent: den 20 januari 2020 04:04
>> To: Peter Kjellerstedt <peter.kjellerstedt@axis.com>; Paul Eggleton
>> <paul.eggleton@linux.intel.com>
>> Cc: openembedded-core@lists.openembedded.org
>> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with O_CLOEXEC
>> to avoid fd leak (rev3)
>>
>> On 01/20/20 10:28, Peter Kjellerstedt wrote:
>>>> -----Original Message-----
>>>> From: openembedded-core-bounces@lists.openembedded.org <openembedded-
>> core-
>>>> bounces@lists.openembedded.org> On Behalf Of Yu, Mingli
>>>> Sent: den 20 januari 2020 02:34
>>>> To: Paul Eggleton <paul.eggleton@linux.intel.com>
>>>> Cc: openembedded-core@lists.openembedded.org
>>>> Subject: Re: [OE-core] ✗ patchtest: failure for Open file with
>> O_CLOEXEC
>>>> to avoid fd leak (rev3)
>>>>
>>>> On 01/20/20 09:29, Paul Eggleton wrote:
>>>>> Hi Mingli
>>>>>
>>>>> On Sunday, 19 January 2020 6:41:49 PM NZDT Yu, Mingli wrote:
>>>>>> On 01/19/20 13:32, Patchwork wrote:
>>>>>>> == Series Details ==
>>>>>>>
>>>>>>> Series: Open file with O_CLOEXEC to avoid fd leak (rev3)
>>>>>>> Revision: 3
>>>>>>> URL   : https://patchwork.openembedded.org/series/22123/
>>>>>>> State : failure
>>>>>>>
>>>>>>> == Summary ==
>>>>>>>
>>>>>>>
>>>>>>> Thank you for submitting this patch series to OpenEmbedded Core.
>> This
>>>> is
>>>>>>> an automated response. Several tests have been executed on the
>>>> proposed
>>>>>>> series by patchtest resulting in the following failures:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> * Issue             Series does not apply on top of target branch
>>>> [test_series_merge_on_head]
>>>>>>>       Suggested fix    Rebase your series on top of targeted branch
>>>>>>>       Targeted branch  master (currently at 9d7a521971)
>>>>>>
>>>>>> Have already rebased on the master branch of
>>>>>> http://git.yoctoproject.org/cgit/cgit.cgi/pseudo/, why still issue
>> out
>>>>>> the above issue? Any hint?
>>>>>
>>>>> It's assuming that patches sent to this list are for OE-Core (which
>> they
>>>>> generally are). I wasn't aware but apparently the documented place to
>>>>> send pseudo patches is this list, so I think in this case you can just
>>>>> ignore patchtest.
>>>>
>>>> Okay, many thanks Paul for your hint!
>>>>
>>>> Thanks,
>>>>
>>>>>
>>>>> Cheers,
>>>>> Paul
>>>
>>> But it is probably a good idea to include a "[pseudo]" tag in the
>> subject
>>> when sending patches related to pseudo to this list, as the expectation
>>> otherwise is that they are for OE-Core.
>>
>> Thanks Peter! And already add the "pseudo_util.c" tag in the subject in
>> the v3, please check the mail with the subject "[OE-core] [PATCH v3]
>> pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak".
>
> That is not the same. The "pseudo_util.c:" is part of the commit subject
> and will end up in the Git repository. A "[pseudo]" tag is for anyone
> seeing the mail (possibly including patchwork and patchtest), letting
> them know that this commit is about pseudo, not OE-Core (similar to the
> "[PATCH v3]" tag, which is also information about the commit).

Got it! V4 is incoming.

Thanks,

>
>> Thanks,
>>
>>> //Peter
>
> //Peter
>


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

end of thread, other threads:[~2020-01-20  3:27 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-19  3:50 [PATCH] Open file with O_CLOEXEC to avoid fd leak mingli.yu
2020-01-19  4:02 ` ✗ patchtest: failure for " Patchwork
2020-01-19  4:12 ` [PATCH v2] " mingli.yu
2020-01-19  4:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev2) Patchwork
2020-01-19  5:15 ` [PATCH v3] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
2020-01-19  5:32 ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Patchwork
2020-01-19  5:41   ` Yu, Mingli
2020-01-20  1:29     ` Paul Eggleton
2020-01-20  1:34       ` Yu, Mingli
2020-01-20  2:28         ` Peter Kjellerstedt
2020-01-20  3:04           ` Yu, Mingli
2020-01-20  3:15             ` Peter Kjellerstedt
2020-01-20  3:27               ` [pseudo v4] pseudo_util.c: Open file with O_CLOEXEC to avoid fd leak mingli.yu
2020-01-20  3:27               ` ✗ patchtest: failure for Open file with O_CLOEXEC to avoid fd leak (rev3) Yu, Mingli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.