Package: rpcbind
Version: 0.2.1-6.1
Severity: normal
Tags: patch pending

Dear maintainer,

I've prepared an NMU for rpcbind (versioned as 0.2.3-0.1). The diff
is attached to this message.

Regards.
diff -Nru rpcbind-0.2.1/debian/changelog rpcbind-0.2.3/debian/changelog
--- rpcbind-0.2.1/debian/changelog      2015-09-24 17:11:52.000000000 +0200
+++ rpcbind-0.2.3/debian/changelog      2015-11-10 13:51:46.000000000 +0100
@@ -1,3 +1,21 @@
+rpcbind (0.2.3-0.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * New upstream release
+    - Enable systemd socket activation support (Closes: #679716)
+  * Override init.d-script-not-included-in-package and
+    init.d-script-not-marked-as-conffile lintian warnings/errors
+  * Add systemd and tmpfiles.d files (Closes: #748074)
+  * Add 07-Delete-the-unix-socket-only-if-we-have-created-it.patch: rpcbind
+    daemon shouldn't try to remove its socket if it as been socket activated
+  * Include some upstart jobs changes from Ubuntu (Closes: #747134)
+    - debian/rpcbind.rpcbind-boot.upstart: document that this job emits the
+      start-rpcbind event.
+    - Don't pass -w to rpcbind on boot up, since the files won't be there to
+      be read.
+
+ -- Laurent Bigonville <bi...@debian.org>  Tue, 10 Nov 2015 13:36:12 +0100
+
 rpcbind (0.2.1-6.1) unstable; urgency=high
 
   * Non-maintainer upload.
diff -Nru rpcbind-0.2.1/debian/control rpcbind-0.2.3/debian/control
--- rpcbind-0.2.1/debian/control        2015-09-24 17:11:52.000000000 +0200
+++ rpcbind-0.2.3/debian/control        2015-11-05 16:35:47.000000000 +0100
@@ -2,7 +2,7 @@
 Section: net
 Priority: standard
 Maintainer: Anibal Monsalve Salazar <ani...@debian.org>
-Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), autotools-dev, 
pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev
+Build-Depends: dpkg-dev (>= 1.16.1~), debhelper (>= 9), dh-systemd (>= 1.5), 
autotools-dev, pkg-config, libtirpc-dev (>= 0.2.4-2~), libwrap0-dev, 
libsystemd-dev [linux-any]
 Standards-Version: 3.9.5
 Homepage: http://sourceforge.net/projects/rpcbind/
 
diff -Nru 
rpcbind-0.2.1/debian/patches/07-Delete-the-unix-socket-only-if-we-have-created-it.patch
 
rpcbind-0.2.3/debian/patches/07-Delete-the-unix-socket-only-if-we-have-created-it.patch
--- 
rpcbind-0.2.1/debian/patches/07-Delete-the-unix-socket-only-if-we-have-created-it.patch
     1970-01-01 01:00:00.000000000 +0100
+++ 
rpcbind-0.2.3/debian/patches/07-Delete-the-unix-socket-only-if-we-have-created-it.patch
     2015-11-10 13:00:38.000000000 +0100
@@ -0,0 +1,48 @@
+From a9b7ffb4061dcddaa4f2387124fc8efc932c6074 Mon Sep 17 00:00:00 2001
+From: Laurent Bigonville <bi...@bigon.be>
+Date: Mon, 9 Nov 2015 22:14:26 +0100
+Subject: [PATCH] Delete the unix socket only if we have created it
+
+If systemd has created the unix socket on our behalf, we shouldn't try
+to delete it.
+
+https://bugzilla.redhat.com/show_bug.cgi?id=1279076
+
+Signed-off-by: Laurent Bigonville <bi...@bigon.be>
+---
+ src/rpcbind.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/rpcbind.c b/src/rpcbind.c
+index 045daa1..c4265cd 100644
+--- a/src/rpcbind.c
++++ b/src/rpcbind.c
+@@ -87,6 +87,7 @@ static inline void __nss_configure_lookup(const char *db, 
const char *s) {}
+ int debugging = 0;    /* Tell me what's going on */
+ int doabort = 0;      /* When debugging, do an abort on errors */
+ int dofork = 1;               /* fork? */
++int createdsocket = 0;  /* Did I create the socket or systemd did it for me? 
*/
+ 
+ rpcblist_ptr list_rbl;        /* A list of version 3/4 rpcbind services */
+ 
+@@ -445,6 +446,7 @@ init_transport(struct netconfig *nconf)
+               memset(&sun, 0, sizeof sun);
+               sun.sun_family = AF_LOCAL;
+               unlink(_PATH_RPCBINDSOCK);
++              createdsocket = 1; /* We are now in the process of creating the 
unix socket */
+               strcpy(sun.sun_path, _PATH_RPCBINDSOCK);
+               addrlen = SUN_LEN(&sun);
+               sa = (struct sockaddr *)&sun;
+@@ -846,7 +848,8 @@ static void
+ terminate(int dummy /*__unused*/)
+ {
+       close(rpcbindlockfd);
+-      unlink(_PATH_RPCBINDSOCK);
++      if(createdsocket)
++              unlink(_PATH_RPCBINDSOCK);
+       unlink(RPCBINDDLOCK);
+ #ifdef WARMSTART
+       write_warmstart();      /* Dump yourself */
+-- 
+2.6.2
+
diff -Nru rpcbind-0.2.1/debian/patches/series 
rpcbind-0.2.3/debian/patches/series
--- rpcbind-0.2.1/debian/patches/series 2015-09-24 17:11:52.000000000 +0200
+++ rpcbind-0.2.3/debian/patches/series 2015-11-10 13:01:01.000000000 +0100
@@ -3,3 +3,4 @@
 04-610718-non-linux.patch
 run-migration
 CVE-2015-7236.patch
+07-Delete-the-unix-socket-only-if-we-have-created-it.patch
diff -Nru rpcbind-0.2.1/debian/rpcbind.lintian-overrides 
rpcbind-0.2.3/debian/rpcbind.lintian-overrides
--- rpcbind-0.2.1/debian/rpcbind.lintian-overrides      1970-01-01 
01:00:00.000000000 +0100
+++ rpcbind-0.2.3/debian/rpcbind.lintian-overrides      2015-11-10 
13:30:28.000000000 +0100
@@ -0,0 +1,6 @@
+# dh_installinit wrongly add snippets for upstart jobs that have no LSB
+# initscript counterpart
+rpcbind: init.d-script-not-marked-as-conffile etc/init.d/portmap-wait
+rpcbind: init.d-script-not-included-in-package etc/init.d/portmap-wait
+rpcbind: init.d-script-not-marked-as-conffile etc/init.d/rpcbind-boot
+rpcbind: init.d-script-not-included-in-package etc/init.d/rpcbind-boot
diff -Nru rpcbind-0.2.1/debian/rpcbind.rpcbind-boot.upstart 
rpcbind-0.2.3/debian/rpcbind.rpcbind-boot.upstart
--- rpcbind-0.2.1/debian/rpcbind.rpcbind-boot.upstart   2015-09-24 
17:11:52.000000000 +0200
+++ rpcbind-0.2.3/debian/rpcbind.rpcbind-boot.upstart   2015-11-05 
17:54:19.000000000 +0100
@@ -3,6 +3,8 @@
 description "Upstart job to start rpcbind on boot only"
 author "Clint Byrum"
 
+emits start-rpcbind
+
 start on virtual-filesystems and net-device-up IFACE=lo
 
 task
diff -Nru rpcbind-0.2.1/debian/rpcbind.service 
rpcbind-0.2.3/debian/rpcbind.service
--- rpcbind-0.2.1/debian/rpcbind.service        1970-01-01 01:00:00.000000000 
+0100
+++ rpcbind-0.2.3/debian/rpcbind.service        2015-11-05 17:23:45.000000000 
+0100
@@ -0,0 +1,19 @@
+[Unit]
+Description=RPC bind portmap service
+After=systemd-tmpfiles-setup.service
+Wants=remote-fs-pre.target
+Before=remote-fs-pre.target
+Requires=rpcbind.socket
+DefaultDependencies=no
+
+[Service]
+Environment="OPTIONS=-w"
+ExecStart=/sbin/rpcbind $OPTIONS
+EnvironmentFile=-/etc/rpcbind.conf
+EnvironmentFile=-/etc/default/rpcbind
+Type=forking
+KillMode=process
+Restart=on-failure
+
+[Install]
+Also=rpcbind.socket
diff -Nru rpcbind-0.2.1/debian/rpcbind.socket 
rpcbind-0.2.3/debian/rpcbind.socket
--- rpcbind-0.2.1/debian/rpcbind.socket 1970-01-01 01:00:00.000000000 +0100
+++ rpcbind-0.2.3/debian/rpcbind.socket 2015-11-05 17:36:03.000000000 +0100
@@ -0,0 +1,8 @@
+[Unit]
+Description=RPCbind Server Activation Socket
+
+[Socket]
+ListenStream=/run/rpcbind.sock
+
+[Install]
+WantedBy=sockets.target
diff -Nru rpcbind-0.2.1/debian/rpcbind.tmpfile 
rpcbind-0.2.3/debian/rpcbind.tmpfile
--- rpcbind-0.2.1/debian/rpcbind.tmpfile        1970-01-01 01:00:00.000000000 
+0100
+++ rpcbind-0.2.3/debian/rpcbind.tmpfile        2015-11-05 16:45:48.000000000 
+0100
@@ -0,0 +1,4 @@
+#Type  Path                            Mode    UID     GID     Age     
Arguments
+d      /run/rpcbind                    0755    root    root    -       -
+f      /run/rpcbind/rpcbind.xdr        0600    root    root    -       -
+f      /run/rpcbind/portmap.xdr        0600    root    root    -       -
diff -Nru rpcbind-0.2.1/debian/rpcbind.upstart 
rpcbind-0.2.3/debian/rpcbind.upstart
--- rpcbind-0.2.1/debian/rpcbind.upstart        2015-09-24 17:11:52.000000000 
+0200
+++ rpcbind-0.2.3/debian/rpcbind.upstart        2015-11-05 17:54:19.000000000 
+0100
@@ -24,7 +24,10 @@
 pre-start exec mkdir -p /run/rpcbind
 
 script
-       OPTIONS="-w"
+       OPTIONS=
+       if [ -z "$ON_BOOT" ]; then
+               OPTIONS=-w
+       fi
        if [ -f /etc/default/rpcbind ]; then
                . /etc/default/rpcbind
        elif [ -f /etc/rpcbind.conf ]; then
diff -Nru rpcbind-0.2.1/debian/rules rpcbind-0.2.3/debian/rules
--- rpcbind-0.2.1/debian/rules  2015-09-24 17:11:52.000000000 +0200
+++ rpcbind-0.2.3/debian/rules  2015-11-10 13:32:42.000000000 +0100
@@ -20,11 +20,17 @@
 
 LDFLAGS += -Wl,-z,defs
 
+ifeq (linux,$(DEB_HOST_ARCH_OS))
+       CONFIGURE_EXTRA_FLAGS += --with-systemdsystemunitdir=/lib/systemd/system
+else
+       CONFIGURE_EXTRA_FLAGS += --with-systemdsystemunitdir=no
+endif
+
 config.status: configure
        dh_testdir
        # Add here commands to configure the package.
        cp -f /usr/share/misc/config.sub /usr/share/misc/config.guess .
-       ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" 
--enable-warmstarts --enable-libwrap --with-statedir=/run/rpcbind 
--with-rpcuser=root
+       ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man 
--infodir=\$${prefix}/share/info CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" 
--enable-warmstarts --enable-libwrap --with-statedir=/run/rpcbind 
--with-rpcuser=root $(CONFIGURE_EXTRA_FLAGS)
 
 build: build-arch build-indep
 build-arch: build-stamp
@@ -69,12 +75,16 @@
        dh_testdir
        dh_testroot
        dh_installchangelogs ChangeLog
+       dh_lintian
        dh_installdocs
        dh_installexamples
        dh_installman man/rpcinfo.7
+       dh_link lib/systemd/system/rpcbind.service 
lib/systemd/system/portmap.service
+       dh_systemd_enable
        dh_installinit --no-start --name rpcbind-boot
        dh_installinit --no-start --name portmap-wait
        dh_installinit
+       dh_systemd_start
        dh_link
        dh_strip
        dh_compress

Reply via email to