]> git.ozlabs.org Git - ppp.git/commitdiff
pppd: Make sure that the linkpidfile is always created (#185)
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 31 Dec 2020 04:30:58 +0000 (05:30 +0100)
committerGitHub <noreply@github.com>
Thu, 31 Dec 2020 04:30:58 +0000 (15:30 +1100)
From https://bugs.debian.org/284382

When pppd detaches from the parent normally, that is, without nodetach
or updetach set, the linkpidfile is not created even when linkname is
set.

This is because the create_linkpidfile call in detach() is only made
if the linkpidfile is filled in.  However, linkpidfile is never filled
in until create_linkpidfile has been called.

IMHO the call should be made uncondtionally in detach() since
create_linkpidfile does its own check on linkname anyway.

Please note that the version of pppd in woody always wrote the
linkpidfile after detaching.  It did so in main() however.  That
call has now been removed which is why I'm seeing this problem.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Co-authored-by: Herbert Xu <herbert@gondor.apana.org.au>
pppd/main.c

index 2b5393624f7800e55d50beed334a85453422e312..aaaa5c8f8f7bcb8ba91733c2eb35ed7c97a66230 100644 (file)
@@ -766,8 +766,7 @@ detach(void)
        /* update pid files if they have been written already */
        if (pidfilename[0])
            create_pidfile(pid);
-       if (linkpidfile[0])
-           create_linkpidfile(pid);
+       create_linkpidfile(pid);
        exit(0);                /* parent dies */
     }
     setsid();