On Sun, Jun 18, 2006 at 02:57:55PM +1000, Anibal Monsalve Salazar wrote:
>Please find attached gidentd_0.4.5-7.2.interdiff.

It's attached this time.

Best Regards,

Aníbal Monsalve Salazar
-- 
http://v7w.com/anibal
interdiff -z -p1 gidentd_0.4.5-7.1.diff.gz gidentd_0.4.5-7.2.diff.gz
diff -u gidentd-0.4.5/debian/control gidentd-0.4.5/debian/control
--- gidentd-0.4.5/debian/control
+++ gidentd-0.4.5/debian/control
@@ -6,12 +6,12 @@
-Standards-Version: 3.5.9
+Standards-Version: 3.7.2
 
 Package: gidentd
 Architecture: any
 Replaces: ident-server
 Provides: ident-server
-Depends: ${shlibs:Depends}, debconf (>= 1.2.33)
+Depends: ${shlibs:Depends}, netbase, debconf (>= 1.2.33) | debconf-2.0
 Conflicts: ident-server
 Description: RFC1413 compliant IPv4/IPv6 ident daemon
  gidentd is a fully functional, RFC1413 compliant ident daemon,
  written by Joern Heissler. It provides IPv4/IPv6 functionality.
- Its possible to run the gidentd from inetd or as standalone daemon.
+ It's possible to run the gidentd from inetd or as standalone daemon.
diff -u gidentd-0.4.5/debian/changelog gidentd-0.4.5/debian/changelog
--- gidentd-0.4.5/debian/changelog
+++ gidentd-0.4.5/debian/changelog
@@ -1,3 +1,26 @@
+gidentd (0.4.5-7.2) unstable; urgency=low
+
+  * NMU
+  * Fixed "FTBFS on GNU/kFreeBSD", closes: #316927.
+    Patch by Robert Millan <[EMAIL PROTECTED]>.
+  * Fixed "gidentd opens /proc/net/tcp and /proc/net/tcp6 immediately
+    at startup while still running as root", closes: #231436.
+    Patch by Timo Sirainen <[EMAIL PROTECTED]>.
+  * Set Standards-Version to 3.7.2.
+  * Fixed "maintainer-script-calls-init-script-directly preinst:9".
+  * Fixed old-fsf-address-in-copyright-file.
+  * Fixed "Please switch to gettext-based debconf templates",
+    closes: #194259. Patch by Christian Perrier <[EMAIL PROTECTED]>.
+  * Fixed "package description typo(s) and the like",
+    closes: #277218. Patch by Florian Zumbiehl <[EMAIL PROTECTED]>.
+  * Added Swedish debconf templates translation, closes: #331366.
+    Patch by Daniel Nylander <[EMAIL PROTECTED]>.
+  * Fixed "gidentd depends on debconf without | debconf-2.0 alternate; blocks
+    cdebconf transition".
+  * Fixed "maintainer-script-needs-depends-on-netbase preinst".
+
+ -- Anibal Monsalve Salazar <[EMAIL PROTECTED]>  Sun, 18 Jun 2006 10:02:38 
+1000
+ 
 gidentd (0.4.5-7.1) unstable; urgency=low
 
   * NMU
diff -u gidentd-0.4.5/debian/copyright gidentd-0.4.5/debian/copyright
--- gidentd-0.4.5/debian/copyright
+++ gidentd-0.4.5/debian/copyright
@@ -20,8 +20,8 @@
 
    You should have received a copy of the GNU General Public License
    along with this package; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-   02111-1307, USA.
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+   MA 02110-1301, USA.
 
 On Debian systems, the complete text of the GNU General Public License
 can be found in `/usr/share/common-licenses/GPL'.
@@ -39,7 +39,7 @@
 
 
  Copyright (C) 2000,2001,2002  Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+     51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
diff -u gidentd-0.4.5/debian/gidentd.preinst 
gidentd-0.4.5/debian/gidentd.preinst
--- gidentd-0.4.5/debian/gidentd.preinst
+++ gidentd-0.4.5/debian/gidentd.preinst
@@ -6,7 +6,7 @@
   /usr/sbin/update-inetd --disable auth
   /usr/sbin/update-inetd --remove 'auth    stream  tcp     nowait.400      
root /usr/sbin/tcpd /usr/sbin/gidentd -i'
 
-  /etc/init.d/gidentd stop > /dev/null 2>&1
+  invoke-rc.d gidentd stop > /dev/null 2>&1
   update-rc.d -f gidentd remove >/dev/null 2>&1
 fi
 
diff -u gidentd-0.4.5/debian/gidentd.templates 
gidentd-0.4.5/debian/gidentd.templates
--- gidentd-0.4.5/debian/gidentd.templates
+++ gidentd-0.4.5/debian/gidentd.templates
@@ -3,7 +3,3 @@
-Description: gidentd runs in daemon mode now as default
- Since 0.4.5-5, gidentd runs in daemon mode as default. 
- The installation-scripts did all changes necessary for that.
-Description-da: gidentd kører nu i daemon-mode som standard
- Siden 0.4.5-5 kører gidentd i daemon mode som standard.
- Installationsskripterne lavede alle nødvendige ændringer for
- det.
+_Description: gidentd runs in daemon mode now as default
+ Since 0.4.5-5, gidentd runs in daemon mode as default. The
+ installation-scripts did all changes necessary for that.
diff -u gidentd-0.4.5/debian/patches/00list gidentd-0.4.5/debian/patches/00list
--- gidentd-0.4.5/debian/patches/00list
+++ gidentd-0.4.5/debian/patches/00list
@@ -1,0 +2,2 @@
+02_231436.dpatch
+03_316927.dpatch
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/po/da.po
+++ gidentd-0.4.5/debian/po/da.po
@@ -0,0 +1,38 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2003-05-22 08:56+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
+"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Description
+#: ../gidentd.templates:3
+msgid "gidentd runs in daemon mode now as default"
+msgstr "gidentd kører nu i daemon-mode som standard"
+
+#. Description
+#: ../gidentd.templates:3
+msgid ""
+"Since 0.4.5-5, gidentd runs in daemon mode as default. The installation-"
+"scripts did all changes necessary for that."
+msgstr ""
+"Siden 0.4.5-5 kører gidentd i daemon mode som standard. "
+"Installationsskripterne lavede alle nødvendige ændringer for det."
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/po/POTFILES.in
+++ gidentd-0.4.5/debian/po/POTFILES.in
@@ -0,0 +1 @@
+[type: gettext/rfc822deb] gidentd.templates
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/po/templates.pot
+++ gidentd-0.4.5/debian/po/templates.pot
@@ -0,0 +1,36 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2003-05-22 08:56+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
+"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Description
+#: ../gidentd.templates:3
+msgid "gidentd runs in daemon mode now as default"
+msgstr ""
+
+#. Description
+#: ../gidentd.templates:3
+msgid ""
+"Since 0.4.5-5, gidentd runs in daemon mode as default. The installation-"
+"scripts did all changes necessary for that."
+msgstr ""
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/po/sv.po
+++ gidentd-0.4.5/debian/po/sv.po
@@ -0,0 +1,39 @@
+#
+#    Translators, if you are not familiar with the PO format, gettext
+#    documentation is worth reading, especially sections dedicated to
+#    this format, e.g. by running:
+#         info -n '(gettext)PO Files'
+#         info -n '(gettext)Header Entry'
+#
+#    Some information specific to po-debconf are available at
+#            /usr/share/doc/po-debconf/README-trans
+#         or http://www.debian.org/intl/l10n/po-debconf/README-trans
+#
+#    Developers do not need to manually edit POT or PO files.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"POT-Creation-Date: 2003-05-22 08:56+0200\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <[EMAIL PROTECTED]>\n"
+"Language-Team: LANGUAGE <[EMAIL PROTECTED]>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#. Description
+#: ../gidentd.templates:3
+msgid "gidentd runs in daemon mode now as default"
+msgstr "gident kör i daemonläget nu som standard"
+
+#. Description
+#: ../gidentd.templates:3
+msgid ""
+"Since 0.4.5-5, gidentd runs in daemon mode as default. The installation-"
+"scripts did all changes necessary for that."
+msgstr ""
+"Sedan 0.4.5-5 kör gidentd i daemonläget som standard. "
+"Installationskriptet har gjort alla ändringar som är "
+"nödvändiga för det."
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/patches/02_231436.dpatch
+++ gidentd-0.4.5/debian/patches/02_231436.dpatch
@@ -0,0 +1,168 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 02_231436.dpatch by  Anibal Monsalve Salazar <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: do not open /proc/net/tcp and /proc/net/tcp6 immediately at startup 
+## DP: while still running as root
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1;;
+esac
+
+exit 0
+
+diff -ru gidentd-0.4.5.orig/gidentd.c gidentd-0.4.5/gidentd.c
+--- gidentd-0.4.5.orig/gidentd.c       2001-12-22 12:44:40.000000000 +0200
++++ gidentd-0.4.5/gidentd.c    2004-02-06 17:58:05.000000000 +0200
+@@ -8,6 +8,30 @@
+ #include <pwd.h>
+ #include <sys/types.h>
+ 
++#include <stdio.h>
++#include <string.h>
++#include <errno.h>
++#include <unistd.h>
++#include <pwd.h>
++#include <sys/types.h>
++
++FILE *fnet, *fnet6;
++
++static int open_proc_files(void)
++{
++      if (!(fnet = fopen("/proc/net/tcp", "r"))) {
++              Log("Unable to open /proc/net/tcp: %s", strerror(errno));
++              return(-1);
++      }
++      if (!(fnet6 = fopen("/proc/net/tcp6", "r"))) {
++              Log("Unable to open /proc/net/tcp6: %s", strerror(errno));
++              return(-1);
++      }
++      setbuf(fnet, NULL);
++      setbuf(fnet6, NULL);
++      return 0;
++}
++
+ int main(int argc, char **argv)
+ {
+       GetConfig(argc, argv);
+@@ -16,16 +40,24 @@
+       
+       if(inetd) SetInetdSocket(); // get ready for inetd use
+       LogOpen(config.logfile); // open logfile
+-      if(inetd) CloseFiles(2); // close open files
+-      else {
++      if(inetd) {
++              CloseFiles(2); // close open files
++              if (open_proc_files() < 0)
++                      return 1;
++      } else {
+               Log("gidentd v%s started in daemon mode.", VERSION);
+               BgProcess(); // close open files && become daemon
+               OpenListenSock(config.port, config.forcev4); // open listening 
sock
+-              setuid(getpwnam("nobody")->pw_uid);
+-              if (getuid() == 0) {
+-                      Log("Couldn't setuid() to non-root user.  Exiting.");
+-                      exit(1);
+-              }
++ 
++              if (open_proc_files() < 0)
++                      return 1;
++ 
++              setgid(getpwnam("nobody")->pw_gid);
++              setuid(getpwnam("nobody")->pw_uid);
++              if (getuid() == 0 || getgid() == 0) {
++                      Log("Couldn't setuid() to non-root user.  Exiting.");
++                      return(1);
++              }
+       }
+       SetSigs(); // set signal handler
+       
+diff -ru gidentd-0.4.5.orig/parse.c gidentd-0.4.5/parse.c
+--- gidentd-0.4.5.orig/parse.c 2001-12-02 14:37:18.000000000 +0200
++++ gidentd-0.4.5/parse.c      2004-02-06 17:46:38.000000000 +0200
+@@ -59,59 +59,47 @@
+ 
+ int tcp4(void)
+ {
+-      FILE *fd;
++      extern FILE *fnet;
+       char line[1024];
+       char buf[34];
+       char *p;
+       
+-      if(!(fd=fopen("/proc/net/tcp","r"))) {
+-              Log("Unable to open /proc/net/tcp: %s", strerror(errno));
+-              return(-1);
+-      }
+       snprintf(buf, 34, ": %08X:%04X %08X:%04X 01 ", conn.lh.s6_addr32[3], 
req.lp, conn.rh.s6_addr32[3], req.rp);
+-      while(fgets(line, 1024, fd)) {
++      fseek(fnet, 0, SEEK_SET);
++      while(fgets(line, 1024, fnet)) {
+               if(strstr(line, buf)) {
+                       if(!(p=tokget(line, 7))) {
+                               Log("something's wrong with /proc/net/tcp");
+-                              fclose(fd);
+                               return(-1);
+                       }
+-                      fclose(fd);
+                       return(atoi(p));
+               }                       
+       }
+-      fclose(fd);
+       return(-2);
+ }
+ 
+ int tcp6(void)
+ {
+-      FILE *fd;
++      extern FILE *fnet6;
+       char line[1024];
+       char buf[82];
+       char *p;
+ 
+-      if(!(fd=fopen("/proc/net/tcp6", "r"))) {
+-              Log("Unable to open /proc/net/tcp6: %s", strerror(errno));
+-              return(-1);
+-      }
+       snprintf(buf, 82, ": %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X 01 ",
+                       conn.lh.s6_addr32[0], conn.lh.s6_addr32[1], 
conn.lh.s6_addr32[2],
+                       conn.lh.s6_addr32[3], req.lp, conn.rh.s6_addr32[0], 
+                       conn.rh.s6_addr32[1], conn.rh.s6_addr32[2], 
conn.rh.s6_addr32[3],   
+                       req.rp);
+-      while(fgets(line, 1024, fd)) {
++      fseek(fnet6, 0, SEEK_SET);
++      while(fgets(line, 1024, fnet6)) {
+               if(strstr(line, buf)) {
+                       if(!(p=tokget(line, 7))) {
+                               Log("something's wrong with /proc/net/tcp6");
+-                              fclose(fd);
+                               return(-1);
+                       }
+-                      fclose(fd);
+                       return(atoi(p));
+               }                       
+       }
+-      fclose(fd);
+       return(-2);
+ }
+ 
+diff -ru gidentd-0.4.5.orig/socket.c gidentd-0.4.5/socket.c
+--- gidentd-0.4.5.orig/socket.c        2001-12-23 13:56:36.000000000 +0200
++++ gidentd-0.4.5/socket.c     2004-02-06 17:49:28.000000000 +0200
+@@ -139,7 +139,7 @@
+ {
+       static char buf[1024];
+       static char line[64];
+-      static int len;
++      static int len = 0;
+       int x;
+       char *p;
+       int l;
only in patch2:
unchanged:
--- gidentd-0.4.5.orig/debian/patches/03_316927.dpatch
+++ gidentd-0.4.5/debian/patches/03_316927.dpatch
@@ -0,0 +1,51 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 316927.dpatch by  Anibal Monsalve Salazar <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: FTBFS on GNU/kFreeBSD
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+    -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+    -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+    *)
+        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+        exit 1;;
+esac
+
+exit 0
+
+diff -ur gidentd-0.4.5.old/system.c gidentd-0.4.5/system.c
+--- gidentd-0.4.5.old/system.c 2001-12-23 01:57:50.000000000 +0100
++++ gidentd-0.4.5/system.c     2005-07-04 22:35:31.000000000 +0200
+@@ -5,7 +5,6 @@
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
+-#include <linux/limits.h>
+ #include <signal.h>
+ #include <wait.h>
+ #include <pwd.h>
+@@ -35,12 +34,18 @@
+       return(0);
+ }
+ 
++#if defined(_SC_OPEN_MAX)
++# define maxfd sysconf (_SC_OPEN_MAX)
++#elif defined(OPEN_MAX)
++# define maxfd OPEN_MAX
++#endif
++
+ // close open files
+ void CloseFiles(int f)
+ {
+       int i;
+ 
+-      for(i=f; i<NR_OPEN; i++) close(i);
++      for(i=f; i<maxfd; i++) close(i);
+ }
+ 
+ // delete my pidfile

Attachment: signature.asc
Description: Digital signature

Reply via email to