diff mbox series

procd: jail/jail: correctly check for null pointer

Message ID mailman.36240.1667917624.4154159.openwrt-devel@lists.openwrt.org
State New
Headers show
Series procd: jail/jail: correctly check for null pointer | expand

Commit Message

Philipp Meier Nov. 8, 2022, 2:26 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Author: Philipp Meier <philipp.meier@westermo.com>
Date:   Tue Nov 8 14:38:37 2022 +0100

    procd: jail/jail: correctly check for null pointer
    
    Handle case where opts.sysctl is not used.
    
    Signed-off-by: Philipp Meier <philipp.meier@westermo.com>

Comments

Daniel Golle Nov. 8, 2022, 2:52 p.m. UTC | #1
On Tue, Nov 08, 2022 at 02:26:47PM +0000, Philipp Meier via openwrt-devel wrote:
> The sender domain has a DMARC Reject/Quarantine policy which disallows
> sending mailing list messages using the original "From" header.
> 
> To mitigate this problem, the original message has been wrapped
> automatically by the mailing list software.

> Date: Tue, 8 Nov 2022 14:26:47 +0000
> From: Philipp Meier <Philipp.Meier@westermo.com>
> To: John Crispin <john@phrozen.org>
> CC: "openwrt-devel@lists.openwrt.org" <openwrt-devel@lists.openwrt.org>
> Subject: [PATCH] procd: jail/jail: correctly check for null pointer
> 
> Author: Philipp Meier <philipp.meier@westermo.com>
> Date:   Tue Nov 8 14:38:37 2022 +0100

This looks like the output of `git show`.
Please use `git format-patch` or `git send-email` in future.

> 
>     procd: jail/jail: correctly check for null pointer
>     
>     Handle case where opts.sysctl is not used.
>     
>     Signed-off-by: Philipp Meier <philipp.meier@westermo.com>

I've cleaned and picked up your patch, thank you!

> 
> diff --git a/jail/jail.c b/jail/jail.c
> index ce6b268..31b64e5 100644
> --- a/jail/jail.c
> +++ b/jail/jail.c
> @@ -215,6 +215,10 @@ static void free_hooklist(struct hook_execvpe **hooklist)
>  
>  static void free_sysctl(void) {
>         struct sysctl_val *cur;
> +
> +       if (!opts.sysctl)
> +               return;
> +

The patch somehow got white-space mangled (tabs got converted to spaces),
probably by copy & pasting it into some MUA. If you really have no way to
use `git send-email` and also importing a draft email created using
`git format-patch` cannot work for you, please attach the file created
by `git format-patch`. Using copy & paste will *always* create a lot of
extra work, because one then has to apply the patch manually (which is also
error-prone and should be avoided).

>         cur = *opts.sysctl;
>  
>         while (cur) {
> 

> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel@lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
Philipp Meier Nov. 8, 2022, 3:10 p.m. UTC | #2
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
> From: Daniel Golle <daniel@makrotopia.org> 
> Sent: Dienstag, 8. November 2022 15:52
> To: Philipp Meier <Philipp.Meier@westermo.com>
> Cc: John Crispin <john@phrozen.org>; openwrt-devel@lists.openwrt.org
> Subject: Re: [PATCH] procd: jail/jail: correctly check for null pointer
> 
> On Tue, Nov 08, 2022 at 02:26:47PM +0000, Philipp Meier via openwrt-devel wrote:
> > The sender domain has a DMARC Reject/Quarantine policy which disallows 
> > sending mailing list messages using the original "From" header.
> > 
> > To mitigate this problem, the original message has been wrapped 
> > automatically by the mailing list software.
> 
> > Date: Tue, 8 Nov 2022 14:26:47 +0000
> > From: Philipp Meier <Philipp.Meier@westermo.com>
> > To: John Crispin <john@phrozen.org>
> > CC: "openwrt-devel@lists.openwrt.org" 
> > <openwrt-devel@lists.openwrt.org>
> > Subject: [PATCH] procd: jail/jail: correctly check for null pointer
> > 
> > Author: Philipp Meier <philipp.meier@westermo.com>
> > Date:   Tue Nov 8 14:38:37 2022 +0100
> 
> This looks like the output of `git show`.
> Please use `git format-patch` or `git send-email` in future.
> 

Thank you for your answer.
I now installed and configured git send-email and will send future patches
using git send-email.

> > 
> >     procd: jail/jail: correctly check for null pointer
> >     
> >     Handle case where opts.sysctl is not used.
> >     
> >     Signed-off-by: Philipp Meier <philipp.meier@westermo.com>
> 
> I've cleaned and picked up your patch, thank you!

Great - thanks a lot for your work!

> 
> > 
> > diff --git a/jail/jail.c b/jail/jail.c index ce6b268..31b64e5 100644
> > --- a/jail/jail.c
> > +++ b/jail/jail.c
> > @@ -215,6 +215,10 @@ static void free_hooklist(struct hook_execvpe 
> > **hooklist)
> >  
> >  static void free_sysctl(void) {
> >         struct sysctl_val *cur;
> > +
> > +       if (!opts.sysctl)
> > +               return;
> > +
> 
> The patch somehow got white-space mangled (tabs got converted to spaces), probably by copy & pasting it into some MUA. If you really have no way to use `git send-email` and also importing a draft email created using `git format-patch` cannot work for you, please attach the file created by `git format-patch`. Using copy & paste will *always* create a lot of extra work, because one then has to apply the patch manually (which is also error-prone and should be avoided).
> 

Yes - that's what happens when using Outlook as mail client. I will use git send-email in the future.

> >         cur = *opts.sysctl;
> >  
> >         while (cur) {
> > 
> 
> > _______________________________________________
> > openwrt-devel mailing list
> > openwrt-devel@lists.openwrt.org
> > https://urldefense.com/v3/__https://lists.openwrt.org/mailman/listinfo
> > /openwrt-devel__;!!I9LPvj3b!B9nUxWG0wOvj2BfVsj-Nm0EMfbYQanCQCLSEl4e89dRBsMRNtfwqbhKvcKa7o3FGRHhEt9C5ZoOnxlr3Oc8yVd4$
diff mbox series

Patch

diff --git a/jail/jail.c b/jail/jail.c
index ce6b268..31b64e5 100644
--- a/jail/jail.c
+++ b/jail/jail.c
@@ -215,6 +215,10 @@  static void free_hooklist(struct hook_execvpe **hooklist)
 
 static void free_sysctl(void) {
        struct sysctl_val *cur;
+
+       if (!opts.sysctl)
+               return;
+
        cur = *opts.sysctl;
 
        while (cur) {