Package: portreserve
Version: 0.0.0-3
Severity: normal
Tags: patch

It is possible to define services by creating files in /etc/portreserve/
which contain a name listed in /etc/services.
However it is not possible to create a service using the port number.
This is due to a call to getservbyport (port, NULL) failing since port
is in host byte order, but geservbyport expects network byte order. To
fix it, convert the "port" to network byte order.
        getservbyport (htons(port), NULL);

--- portreserve-0.0.0-3/src/portreserve.c
+++ portreserve/src/portreserve.c
@@ -131,7 +131,7 @@ reserve (const char *file)
                int port = strtol (service, &endptr, 10);
                if (service == endptr)
                        return -1;
-               serv = getservbyport (port, NULL);
+               serv = getservbyport (htons(port), NULL);
                if (!serv)
                        return -1;
        }



-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.17-fce-it87
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages portreserve depends on:
ii  libc6                       2.3.6.ds1-13 GNU C Library: Shared libraries

portreserve recommends no packages.

-- no debconf information



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

Reply via email to