summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Shadura <andrewsh@debian.org>2016-04-28 09:41:28 +0200
committerAndrew Shadura <andrewsh@debian.org>2016-04-28 10:01:12 +0200
commitc69e6fedb5b1c629854214d97e68c27bde731be6 (patch)
treeaafff527bac102a2892a56ef78f4241f210a05b1
parent5c4507ce311ad7ec79bbf6fec0d2dd9da22e69c1 (diff)
Generate a patch for the extra commit applied.
-rw-r--r--debian/patches/0001-add-wrapper-for-bind.patch94
-rw-r--r--debian/patches/series1
2 files changed, 95 insertions, 0 deletions
diff --git a/debian/patches/0001-add-wrapper-for-bind.patch b/debian/patches/0001-add-wrapper-for-bind.patch
new file mode 100644
index 0000000..af9ce35
--- /dev/null
+++ b/debian/patches/0001-add-wrapper-for-bind.patch
@@ -0,0 +1,94 @@
+From b4da1dfc79a38d318305342fc23255340f913456 Mon Sep 17 00:00:00 2001
+From: Peter Seebach <peter.seebach@windriver.com>
+Date: Thu, 10 Mar 2016 15:52:28 -0600
+Subject: [PATCH] add wrapper for bind
+
+Since the pseudo socket is actually created by a call to bind, the
+bind call could create a file, which means it needs to record a
+database entry.
+---
+ ChangeLog.txt | 3 +++
+ ports/unix/guts/bind.c | 36 ++++++++++++++++++++++++++++++++++++
+ ports/unix/wrapfuncs.in | 1 +
+ pseudo_wrappers.c | 2 ++
+ 4 files changed, 42 insertions(+)
+ create mode 100644 ports/unix/guts/bind.c
+
+diff --git a/ChangeLog.txt b/ChangeLog.txt
+index eb72127..0dc2b08 100644
+--- a/ChangeLog.txt
++++ b/ChangeLog.txt
+@@ -1,3 +1,6 @@
++2016-03-10:
++ * (seebs) make bind work (so userspace NFS server can handle pseudo)
++
+ 2016-02-09:
+ * (seebs) 1.7.5 release
+
+diff --git a/ports/unix/guts/bind.c b/ports/unix/guts/bind.c
+new file mode 100644
+index 0000000..46164be
+--- /dev/null
++++ b/ports/unix/guts/bind.c
+@@ -0,0 +1,36 @@
++/*
++ * Copyright (c) 2016 Wind River Systems; see
++ * guts/COPYRIGHT for information.
++ *
++ * int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen)
++ * int rc = -1;
++ */
++
++ /* I'm not trying to handle broken umasks for this operation right
++ * now. Be good!
++ */
++ rc = real_bind(sockfd, addr, addrlen);
++ /* we have created a thing! we need to record it in the
++ * database.
++ */
++ if (addr && addr->sa_family == AF_UNIX && rc >= 0) {
++ struct sockaddr_un *addr_un = (struct sockaddr_un *) addr;
++ /* Linux supports a special hackery where the name starts
++ * with a nul byte, I don't care about those
++ * probably.
++ */
++ if (addr_un->sun_path[0]) {
++ /* we have to find the path, which is
++ * relative to cwd, so we can create the database
++ * entry.
++ */
++ char *path = pseudo_root_path(__func__, __LINE__, AT_FDCWD, addr_un->sun_path, AT_SYMLINK_NOFOLLOW);
++ PSEUDO_STATBUF buf;
++ base_stat(path, &buf);
++ pseudo_client_op(OP_MKNOD, 0, -1, -1, path, &buf);
++ }
++ }
++
++/* return rc;
++ * }
++ */
+diff --git a/ports/unix/wrapfuncs.in b/ports/unix/wrapfuncs.in
+index 5f30ae6..1245593 100644
+--- a/ports/unix/wrapfuncs.in
++++ b/ports/unix/wrapfuncs.in
+@@ -68,3 +68,4 @@ int syncfs(int fd); /* async_skip=0 */
+ int sync_file_range(int fd, off64_t offset, off64_t nbytes, unsigned int flags); /* async_skip=0 */
+ int msync(void *addr, size_t length, int flags); /* async_skip=0 */
+ mode_t umask(mode_t mask);
++int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen);
+diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
+index 34d7f23..9acb65d 100644
+--- a/pseudo_wrappers.c
++++ b/pseudo_wrappers.c
+@@ -28,6 +28,8 @@
+ #include <signal.h>
+
+ #include <sys/types.h>
++#include <sys/socket.h>
++#include <sys/un.h>
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <sys/stat.h>
+--
+2.7.4
+
diff --git a/debian/patches/series b/debian/patches/series
index e6917ae..5b010d0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
0000-manpage.patch
+0001-add-wrapper-for-bind.patch