All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexis Lothoré via buildroot" <buildroot@buildroot.org>
To: buildroot@buildroot.org
Cc: Bernd Kuhls <bernd@kuhls.net>,
	Nicolas Carrier <nicolas.carrier@nav-timing.safrangroup.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: [Buildroot] [PATCH 3/3] package/pppd: create rundir when it is missing
Date: Fri, 29 Mar 2024 15:31:38 +0100	[thread overview]
Message-ID: <20240329143138.214780-4-alexis.lothore@bootlin.com> (raw)
In-Reply-To: <20240329143138.214780-1-alexis.lothore@bootlin.com>

From: Alexis Lothoré <alexis.lothore@bootlin.com>

pppd fails to start on buildroot 2024.02, because of non-existing directory
pppd in /var/run

Upstream: https://github.com/ppp-project/ppp/commit/3a4fec968174fd6f387d5ec872a56343f256f645
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
Backport to: 2024.02.x
---
 ...0007-try-to-create-rundir-if-missing.patch | 50 +++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/pppd/0007-try-to-create-rundir-if-missing.patch

diff --git a/package/pppd/0007-try-to-create-rundir-if-missing.patch b/package/pppd/0007-try-to-create-rundir-if-missing.patch
new file mode 100644
index 000000000000..4c4c61ec2b33
--- /dev/null
+++ b/package/pppd/0007-try-to-create-rundir-if-missing.patch
@@ -0,0 +1,50 @@
+From 3a4fec968174fd6f387d5ec872a56343f256f645 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Alexis=20Lothor=C3=A9?= <alexis.lothore@bootlin.com>
+Date: Thu, 3 Aug 2023 16:37:27 +0900
+Subject: [PATCH 3/3] try to create rundir if missing
+
+From: Dominique Martinet <dominique.martinet@atmark-techno.com>
+
+Runtime dir changed from /run to /run/pppd in commit 66a8c74c3f73 ("Let
+./configure control the paths for pppd") and is likely to not exist on
+some distros, in which case the pppdb will not be created.
+
+See: #419 (lock directory moved in ppp-2.5.0)
+Upstream: https://github.com/ppp-project/ppp/commit/3a4fec968174fd6f387d5ec872a56343f256f645
+Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
+---
+ pppd/tdb.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/pppd/tdb.c b/pppd/tdb.c
+index 8a563f88b9a6..62644171aa6e 100644
+--- a/pppd/tdb.c
++++ b/pppd/tdb.c
+@@ -60,8 +60,11 @@
+ #include <sys/mman.h>
+ #include <sys/stat.h>
+ #include <signal.h>
++
++#include "pppd-private.h"
+ #include "tdb.h"
+ #include "spinlock.h"
++#include "pathnames.h"
+ 
+ #define TDB_MAGIC_FOOD "TDB file\n"
+ #define TDB_VERSION (0x26011967 + 6)
+@@ -1728,7 +1731,12 @@ TDB_CONTEXT *tdb_open_ex(const char *name, int hash_size, int tdb_flags,
+ 		goto internal;
+ 	}
+ 
++again:
+ 	if ((tdb->fd = open(name, open_flags, mode)) == -1) {
++		if ((open_flags & O_CREAT) && errno == ENOENT &&
++			mkdir_recursive(PPP_PATH_VARRUN) == 0)
++			goto again;
++
+ 		TDB_LOG((tdb, 5, "tdb_open_ex: could not open file %s: %s\n",
+ 			 name, strerror(errno)));
+ 		goto fail;	/* errno set by open(2) */
+-- 
+2.43.1
+
-- 
2.43.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-03-29 14:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-29 14:31 [Buildroot] [PATCH 0/3] package/pppd: fix pppd startup with upstream patches Alexis Lothoré via buildroot
2024-03-29 14:31 ` [Buildroot] [PATCH 1/3] package/pppd: revert lock path Alexis Lothoré via buildroot
2024-03-29 14:31 ` [Buildroot] [PATCH 2/3] package/pppd: add mkdir recursive Alexis Lothoré via buildroot
2024-03-29 14:31 ` Alexis Lothoré via buildroot [this message]
2024-04-10 21:20 ` [Buildroot] [PATCH 0/3] package/pppd: fix pppd startup with upstream patches Thomas Petazzoni via buildroot
2024-04-11  8:49   ` Alexis Lothoré via buildroot

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=20240329143138.214780-4-alexis.lothore@bootlin.com \
    --to=buildroot@buildroot.org \
    --cc=alexis.lothore@bootlin.com \
    --cc=bernd@kuhls.net \
    --cc=nicolas.carrier@nav-timing.safrangroup.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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 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.