Package: portmap
Version: 6.0-5.1

Here is the patch I used in my portmap NMU that I just uploaded.

diff -u portmap-6.0/debian/changelog portmap-6.0/debian/changelog
--- portmap-6.0/debian/changelog
+++ portmap-6.0/debian/changelog
@@ -1,3 +1,25 @@
+portmap (6.0-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Avoid useless 1 second sleep during boot, while still doing
+    it when needed during restarts (Closes: #412636).  Patch
+    from Petter Reinholdtsen.
+  * New patch 02-448470-pidfile.diff to write pid to
+    /var/run/portmap.pid (Closes: #448470).  Patch
+    from Petter Reinholdtsen.
+  * New patch 03-356784-lotsofinterfaces.diff to handle more
+    than 256 network interfaces (Closes: #356784).  Patch
+    from Steven Wilton.
+  * Updated upstream URL and name in copyright file (Closes: #454208).
+  * Change init.d script to use the omitpid feature in sendsigs to
+    allow it to stop later during shutdown (Closes: #468665).  Patch
+    from Petter Reinholdtsen.
+  * Fix bashism in postinst script (Closes: #472236).  Patch
+    from Raphael Geissert.
+  * Updated Dutch debconf translation from Vincent Zweije (Closes: #463798).
+
+ -- Petter Reinholdtsen <[EMAIL PROTECTED]>  Sat, 24 May 2008 17:28:21 +0200
+
 portmap (6.0-5) unstable; urgency=medium
 
   [ Anibal Monsalve Salazar ]
diff -u portmap-6.0/debian/postinst portmap-6.0/debian/postinst
--- portmap-6.0/debian/postinst
+++ portmap-6.0/debian/postinst
@@ -21,7 +21,7 @@
 if [ -e "$CONFFILE" ]; then
        sed -i -e 's/ARGS/OPTIONS/g' "$CONFFILE"
 else
-       echo -e "# By default, listen only on the loopback 
interface\nOPTIONS=\"-i 127.0.0.1\"" > "$CONFFILE"
+       printf "# By default, listen only on the loopback 
interface\nOPTIONS=\"-i 127.0.0.1\"\n" > "$CONFFILE"
 fi
 
 # Keep track of changes to the portmapper
diff -u portmap-6.0/debian/copyright portmap-6.0/debian/copyright
--- portmap-6.0/debian/copyright
+++ portmap-6.0/debian/copyright
@@ -6,9 +6,10 @@
 
 It is now maintained by Anibal Monsalve Salazar <[EMAIL PROTECTED]>
 
-Upstream location: ftp://ftp.porcupine.org/pub/security/
+Upstream location: http://neil.brown.name/portmap/
 
 Upstream Author: Wietse Venema
+Upstream maintainer: Neil Brown
 
 Copyright:
 
diff -u portmap-6.0/debian/init.d portmap-6.0/debian/init.d
--- portmap-6.0/debian/init.d
+++ portmap-6.0/debian/init.d
@@ -39,19 +39,24 @@
        start-stop-daemon --start --quiet --oknodo --exec /sbin/portmap -- 
$OPTIONS
        log_end_msg $?
 
-       sleep 1 # needs a short pause or pmap_set won't work. :(
        if [ -f /var/run/portmap.upgrade-state ]; then
          log_begin_msg "Restoring old RPC service information..."
+         sleep 1 # needs a short pause or pmap_set won't work. :(
          pmap_set </var/run/portmap.upgrade-state
          log_end_msg $?
          rm -f /var/run/portmap.upgrade-state
        else
          if [ -f /var/run/portmap.state ]; then
+           sleep 1 # needs a short pause or pmap_set won't work. :(
            pmap_set </var/run/portmap.state
            rm -f /var/run/portmap.state
          fi
        fi
 
+       mkdir -p /lib/init/rw/sendsigs.omit.d
+       rm -f /lib/init/rw/sendsigs.omit.d/portmap
+       ln -s /var/run/portmap.pid /lib/init/rw/sendsigs.omit.d/portmap
+
        ;;
     stop)
        log_begin_msg "Stopping portmap daemon..."
diff -u portmap-6.0/debian/patches/series portmap-6.0/debian/patches/series
--- portmap-6.0/debian/patches/series
+++ portmap-6.0/debian/patches/series
@@ -2,1 +3,3 @@
+02-448470-pidfile.diff
+03-356784-lotsofinterfaces.diff
--- portmap-6.0.orig/debian/patches/02-448470-pidfile.diff
+++ portmap-6.0/debian/patches/02-448470-pidfile.diff
@@ -0,1 +1,155 @@
+This patch implement pidfile support in portmap.  Upstream was notified about
+this patch 2008-05-24.
+
+--- portmap-6.0.orig/portmap.c
++++ portmap-6.0/portmap.c
+@@ -98,6 +98,8 @@
+
+ #include <stdlib.h>
+ #include <pwd.h>
++#include <stdarg.h>
++#include <sys/stat.h>
+
+ #ifndef LOG_PERROR
+ #define LOG_PERROR 0
+@@ -169,6 +171,126 @@
+        int priv;
+ };
+
++#ifndef PIDFILE
++#  define PIDFILE "/var/run/portmap.pid"
++#endif
++
++/*
++ * Copied from the atd source
++ */
++static int
++lock_fd(int fd)
++{
++    struct flock lock;
++
++    lock.l_type = F_WRLCK;
++    lock.l_whence = SEEK_SET;
++    lock.l_start = 0;
++    lock.l_len = 0;
++
++    return fcntl(fd, F_SETLK, &lock);
++}
++
++void
++perr(const char *fmt,...)
++{
++    char buf[1024];
++    va_list args;
++
++    va_start(args, fmt);
++    vsnprintf(buf, sizeof(buf), fmt, args);
++    va_end(args);
++
++    if (debugging) {
++       perror(buf);
++    } else
++       syslog(LOG_ERR, "%s: %m", buf);
++
++    exit(EXIT_FAILURE);
++}
++
++void
++pabort(const char *fmt,...)
++{
++    char buf[1024];
++    va_list args;
++
++    va_start(args, fmt);
++    vsnprintf(buf, sizeof(buf), fmt, args);
++    va_end(args);
++
++    if (debugging) {
++       fprintf(stderr, "%s\n", buf);
++    } else
++       syslog(LOG_ERR, "%s", buf);
++
++    exit(EXIT_FAILURE);
++}
++
++FILE *
++save_pidfile(void) {
++    pid_t pid;
++    int fd;
++    FILE *fp;
++    fd = open(PIDFILE, O_RDWR | O_CREAT | O_EXCL,
++             S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
++
++    if (fd == -1) {
++
++       if (errno != EEXIST)
++           perr("Cannot open " PIDFILE);
++
++       if ((fd = open(PIDFILE, O_RDWR)) < 0)
++           perr("Cannot open " PIDFILE);
++
++       fp = fdopen(fd, "rw");
++       if (fp == NULL) {
++           perr("Cannot open " PIDFILE " for reading");
++       }
++       pid = -1;
++       if ((fscanf(fp, "%d", &pid) != 1) || (pid == getpid())
++           || (lock_fd(fileno(fp)) == 0)) {
++           int rc;
++
++           syslog(LOG_NOTICE, "Removing stale lockfile for pid %d", pid);
++
++           rc = unlink(PIDFILE);
++
++           if (rc == -1) {
++               perr("Cannot unlink " PIDFILE);
++           }
++       } else {
++           pabort("Another atd already running with pid %d", pid);
++       }
++       fclose(fp);
++
++       unlink(PIDFILE);
++       fd = open(PIDFILE, O_RDWR | O_CREAT | O_EXCL,
++                 S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH);
++
++
++       if (fd == -1)
++           perr("Cannot open " PIDFILE " the second time round");
++
++    }
++
++    if (lock_fd(fd) == -1)
++       perr("Cannot lock " PIDFILE);
++
++    fp = fdopen(fd, "w");
++    if (fp == NULL)
++       perr("Special weirdness: fdopen failed");
++
++    fprintf(fp, "%d\n", getpid());
++
++    /* We do NOT close fd, since we want to keep the lock. However, we don't
++     * want to keep the file descriptor in case of an exec().
++     */
++    fflush(fp);
++    fcntl(fd, F_SETFD, (long) 1);
++    return fp;
++}
++
+ int
+ main(int argc, char **argv)
+ {
+@@ -252,6 +374,8 @@
+                exit(1);
+        }
+
++       save_pidfile();
++
+ #ifdef LOG_DAEMON
+        openlog("portmap", LOG_PID|LOG_NDELAY | ( foreground ? LOG_PERROR : 0),
+            FACILITY);
+
+
+
+
--- portmap-6.0.orig/debian/patches/03-356784-lotsofinterfaces.diff
+++ portmap-6.0/debian/patches/03-356784-lotsofinterfaces.diff
@@ -0,0 +1,54 @@
+--- portmap/from_local.c.orig  2006-03-14 10:03:44.000000000 +0800
++++ portmap/from_local.c       2006-03-14 10:07:08.000000000 +0800
+@@ -107,7 +107,7 @@
+     struct ifreq *ifr;
+     struct ifreq *the_end;
+     int     sock;
+-    char    buf[BUFSIZ];
++    char    *buf=NULL;
+ 
+     /*
+      * Get list of network interfaces. We use a huge buffer to allow for the
+@@ -118,13 +118,27 @@
+       perror("socket");
+       return (0);
+     }
+-    ifc.ifc_len = sizeof(buf);
+-    ifc.ifc_buf = buf;
+-    if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) < 0) {
+-      perror("SIOCGIFCONF");
+-      (void) close(sock);
+-      return (0);
+-    }
++
++    num_local=0;
++    do {
++      num_local++;
++      buf=realloc(buf,num_local * BUFSIZ);
++      if(buf == NULL) {
++          perror("portmap: out of memory");
++          (void) close(sock);
++          num_local=0;
++          return (0);
++      }
++      ifc.ifc_len = (num_local * BUFSIZ);
++      ifc.ifc_buf = buf;
++      if (ioctl(sock, SIOCGIFCONF, (char *) &ifc) < 0) {
++          perror("SIOCGIFCONF");
++          (void) close(sock);
++          free(buf);
++          num_local=0;
++          return (0);
++      }
++    } while (ifc.ifc_len > ((num_local * BUFSIZ)-sizeof(struct ifreq)));
+     /* Get IP address of each active IP network interface. */
+ 
+     the_end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len);
+@@ -153,6 +167,7 @@
+ #endif
+     }
+     (void) close(sock);
++    free(buf);
+     return (num_local);
+ }
+ 
diff -u portmap-6.0/debian/po/nl.po portmap-6.0/debian/po/nl.po
--- portmap-6.0/debian/po/nl.po
+++ portmap-6.0/debian/po/nl.po
@@ -1,10 +1,14 @@
+# Dutch portmap po-debconf translation,
+# Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the portmap package.
+# Vincent Zweije <[EMAIL PROTECTED]>, 2008.
 #
 msgid ""
 msgstr ""
-"Project-Id-Version: portmap 5-19\n"
+"Project-Id-Version: portmap 6.0-5\n"
 "Report-Msgid-Bugs-To: [EMAIL PROTECTED]"
 "POT-Creation-Date: 2007-09-19 06:50+0200\n"
-"PO-Revision-Date: 2006-05-04 04:38+0100\n"
+"PO-Revision-Date: 2008-01-13 21:35+0000\n"
 "Last-Translator: Vincent Zweije <[EMAIL PROTECTED]>\n"
 "Language-Team: Debian-Dutch <[EMAIL PROTECTED]>\n"
 "MIME-Version: 1.0\n"
@@ -23,45 +27,30 @@
-#, fuzzy
-#| msgid ""
-#| "Portmap by default listens to all IP addresses. However, if you are not "
-#| "providing network RPC services to remote clients (you are if you are "
-#| "setting up a NFS or NIS server) you can safely bind it to the loopback  "
-#| "IP address (127.0.0.1)"
 msgid ""
 "By default, portmap listens to all IP addresses. However, if this machine "
 "does not provide network RPC services (such as NIS or NFS) to remote "
 "clients, you can safely bind it to the loopback IP address (127.0.0.1)."
 msgstr ""
-"Standaard luistert portmap op alle interfaces. Als u echter geen RPC-"
-"diensten aanbiedt aan andere servers, zoals NFS- of NIS-diensten, dan kunt u "
-"portmap zonder problemen beperken tot het loopback-interface op adres "
-"127.0.0.1."
+"Standaard luistert portmap op alle interfaces. Als deze computer echter "
+"geen RPC-diensten aanbiedt (zoals NIS- of NFS) aan andere computers, dan "
+"kunt u portmap zonder problemen beperken tot het loopback-interface op "
+"adres 127.0.0.1."
 
 #. Type: boolean
 #. Description
 #: ../templates:2001
-#, fuzzy
-#| msgid ""
-#| "This will allow RPC local services (like FAM) to work properly, while "
-#| "preventing remote systems from accessing your RPC services."
 msgid ""
 "This will allow RPC local services (like FAM) to work properly, while "
 "preventing remote systems from accessing the RPC services."
 msgstr ""
 "Hierdoor kunnen lokale RPC-diensten, zoals FAM, goed werken, terwijl wordt "
-"voorkomen dat andere systemen verbinding maken met uw RPC-diensten."
+"voorkomen dat andere systemen verbinding maken met de RPC-diensten."
 
 #. Type: boolean
 #. Description
 #: ../templates:2001
-#, fuzzy
-#| msgid ""
-#| "You can also change this configuration by editing the OPTIONS line in "
-#| "the /etc/default/portmap file. If you just don't specify the -i option it "
-#| "will bind to all interfaces."
 msgid ""
 "This configuration can be changed by editing the OPTIONS line in the /etc/"
 "default/portmap file and adapting the use of the -i option to your needs."
 msgstr ""
-"U kunt deze instelling ook aanpassen door de OPTIONS regel in /etc/default/"
-"portmap te wijzigen. Als u de -i optie weglaat, dan luistert portmap op alle "
-"interfaces."
+"Deze instelling kan worden gewijzigd met de OPTIONS regel in bestand "
+"/etc/default/portmap, door het gebruik van de -i optie aan uw behoefte aan "
+"te passen."



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to