aboutsummaryrefslogtreecommitdiffstats
path: root/testing/nldev/0002-Preserve-the-PATH-environment-variable.patch
diff options
context:
space:
mode:
authorSören Tempel <soeren+git@soeren-tempel.net>2016-03-09 12:31:29 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2016-04-06 19:58:22 +0000
commit23f8cfc9a8aab476eb97c6ec252fcdb6577220d7 (patch)
tree387c52e8e4764829a081dd01dae6289d1cf95f24 /testing/nldev/0002-Preserve-the-PATH-environment-variable.patch
parent11949c75677ef1619799f96485a8599eb81415f3 (diff)
downloadaports-23f8cfc9a8aab476eb97c6ec252fcdb6577220d7.tar.bz2
aports-23f8cfc9a8aab476eb97c6ec252fcdb6577220d7.tar.xz
testing/nldev: new aport
Diffstat (limited to 'testing/nldev/0002-Preserve-the-PATH-environment-variable.patch')
-rw-r--r--testing/nldev/0002-Preserve-the-PATH-environment-variable.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/nldev/0002-Preserve-the-PATH-environment-variable.patch b/testing/nldev/0002-Preserve-the-PATH-environment-variable.patch
new file mode 100644
index 0000000000..d6c4ffec67
--- /dev/null
+++ b/testing/nldev/0002-Preserve-the-PATH-environment-variable.patch
@@ -0,0 +1,46 @@
+From 980c9181b9bf44be6007462ef54568759aabbc5a Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?S=C3=B6ren=20Tempel?= <soeren+git@soeren-tempel.net>
+Date: Wed, 10 Feb 2016 23:26:23 +0100
+Subject: [PATCH 2/4] Preserve the PATH environment variable
+
+No idea why this wasn't done before...
+---
+ nldev.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/nldev.c b/nldev.c
+index 9153fd2..deabf10 100644
+--- a/nldev.c
++++ b/nldev.c
+@@ -193,7 +193,7 @@ main(int argc, char *argv[])
+ struct msghdr hdr;
+ struct iovec iov;
+ char buf[4097], *subsystem, *runpath, *key, *value,
+- cbuf[CMSG_SPACE(sizeof(struct ucred))];
++ *origpath, cbuf[CMSG_SPACE(sizeof(struct ucred))];
+ struct cmsghdr *chdr;
+ struct ucred *cred;
+ int i, len, slen, showudev, showkernel;
+@@ -203,6 +203,10 @@ main(int argc, char *argv[])
+ subsystem = NULL;
+ runpath = "/bin/mdev";
+
++ origpath = getenv("PATH");
++ if (!origpath || strlen(origpath) <= 0)
++ origpath = "/sbin:/bin";
++
+ ARGBEGIN {
+ case 'b':
+ dofork = 1;
+@@ -242,7 +246,7 @@ main(int argc, char *argv[])
+ buf[sizeof(buf)-1] = '\0';
+ while (poll(&fds, 1, -1) > -1) {
+ clearenv();
+- setenv("PATH", "/sbin:/bin", 1);
++ setenv("PATH", origpath, 1);
+
+ iov.iov_base = &buf;
+ iov.iov_len = sizeof(buf);
+--
+2.7.2
+