Your message dated Fri, 22 Jun 2012 09:50:36 +0000
with message-id <[email protected]>
and subject line Bug#601253: fixed in weborf 0.13-3
has caused the Debian Bug report #601253,
regarding xinetd: getpeername works as random generator rather than giving the 
wanted result
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
601253: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=601253
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: xinetd
Version: 1:2.3.14-7
Severity: important
Tags: upstream ipv6

I have written the following simple server, that sends to the client the address
of the client itself.
It can work as stand-alone and with xinetd (by passing some random argument on 
its
command line).

#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

void write_client_addr(int fd) {

    struct sockaddr_in6 addr;//Local and remote address
    socklen_t addr_l=sizeof(struct sockaddr_in6);
    char addrbuff[256];
    char outputbuff[256];
    int outputsize;

    getpeername(fd, (struct sockaddr *)&addr, &addr_l);
    inet_ntop(AF_INET6, &addr.sin6_addr, addrbuff, INET6_ADDRSTRLEN);
    
    outputsize=snprintf(outputbuff,256,"Your address is %s\n",addrbuff);
    write(fd,outputbuff,outputsize);

}

int main(int argc, char *argv[]) {
    int client_fd=0;

    if (argc==1) {
        unsigned short int port=1942;
        struct sockaddr_in6 locAddr,farAddr;    //Local and remote address
        socklen_t ipAddrL,farAddrL;

        int s = socket(PF_INET6, SOCK_STREAM, 0);
        
        //Makes port reusable immediately after termination.
        int val = 1;
        setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &val, sizeof(val));

        farAddrL= ipAddrL =  sizeof(struct sockaddr_in6);
        //Bind
        memset(&locAddr, 0, sizeof(locAddr));
        locAddr.sin6_family = AF_INET6;
        locAddr.sin6_port = htons(port);
        locAddr.sin6_addr = in6addr_any;
        bind(s, (struct sockaddr *) &locAddr, sizeof(locAddr));

        listen(s, 10); //Listen to the socket


        client_fd=accept(s, (struct sockaddr *) &farAddr, &farAddrL);
    }
    write_client_addr(client_fd);
}


If i compile and run that code, and i issue
$ ncat -6 ::ffff:127.0.0.1 1942
The result is:
Your address is ::ffff:127.0.0.1

as expected. It also works connecting to ::1.

Now let's see what happens using it with xinetd:

service www
{
socket_type = stream
wait = no
instances = 5
server = /tmp/a.out
server_args = -T
port = 80
cps = 100 4
flags = IPv6
}


Running:
# ncat -6 ip6-localhost 80
Your address is ::1

And this works.. but running:
# ncat -6 ::ffff:127.0.0.1 80
Your address is ::1036:905a:ff7f:0

And the result changes everytime.

I've flagged this bug as important because my real-life problem allows or 
denies access basing on the IP address
so it is not so convenient for me that it happens to be a random number.

Using only IPv4 will work fine.

Bye

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'experimental'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.35.7-calipso (SMP w/2 CPU cores; PREEMPT)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages xinetd depends on:
ii  libc6                         2.11.2-6   Embedded GNU C Library: Shared lib
ii  libwrap0                      7.6.q-19   Wietse Venema's TCP wrappers libra
ii  netbase                       4.43       Basic TCP/IP networking system
ii  update-inetd                  4.38       inetd configuration file updater

Versions of packages xinetd recommends:
ii  logrotate                     3.7.8-6    Log rotation utility
ii  rsyslog [system-log-daemon]   4.6.4-1    enhanced multi-threaded syslogd

xinetd suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
Source: weborf
Source-Version: 0.13-3

We believe that the bug you reported is fixed in the latest version of
weborf, which is due to be installed in the Debian FTP archive:

qweborf_0.13-3_all.deb
  to main/w/weborf/qweborf_0.13-3_all.deb
weborf-daemon_0.13-3_all.deb
  to main/w/weborf/weborf-daemon_0.13-3_all.deb
weborf_0.13-3.debian.tar.gz
  to main/w/weborf/weborf_0.13-3.debian.tar.gz
weborf_0.13-3.dsc
  to main/w/weborf/weborf_0.13-3.dsc
weborf_0.13-3_amd64.deb
  to main/w/weborf/weborf_0.13-3_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Salvo 'LtWorf' Tomaselli <[email protected]> (supplier of updated weborf 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Thu, 21 Jun 2012 17:35:43 +0200
Source: weborf
Binary: weborf weborf-daemon qweborf
Architecture: source amd64 all
Version: 0.13-3
Distribution: unstable
Urgency: low
Maintainer: Salvo 'LtWorf' Tomaselli <[email protected]>
Changed-By: Salvo 'LtWorf' Tomaselli <[email protected]>
Description: 
 qweborf    - Shares files using the HTTP protocol
 weborf     - Fast and small webserver meant to be run without root privileges
 weborf-daemon - init script for weborf
Closes: 601253 677083
Changes: 
 weborf (0.13-3) unstable; urgency=low
 .
   * Fixed typo in the description (Closes: #677083)
   * Correctly handles IPv4 clients in log files when started by
     xinetd (Closes: #601253)
   * Updated Standards-Version
   * Build-depends on hardening-wrapper
Checksums-Sha1: 
 77c1dbd5532707c617cfe2154dee9f2f9811b75c 1240 weborf_0.13-3.dsc
 b5f2ffde4819d22209092e2be6b9c7a0ff0750fe 4657 weborf_0.13-3.debian.tar.gz
 7623501311a36b4708c2f6861bd751e44d946fd4 38736 weborf_0.13-3_amd64.deb
 5999b6caf2b04a943e607436f1c91049badd31a8 11438 weborf-daemon_0.13-3_all.deb
 eb6be3e04b4096c1ff711c0597ca679c1cb38099 17404 qweborf_0.13-3_all.deb
Checksums-Sha256: 
 f77767528bb422a01ba768b6e314bfebabca69894714429f865472e436c83a3e 1240 
weborf_0.13-3.dsc
 c2d21f6be39ab2a4c59825f4f684122d8e73b51e45ad1a779f7acdf08919bf55 4657 
weborf_0.13-3.debian.tar.gz
 6f891d3a52490dac427f8df0f0ab234bd2884f92508ad17393b8fe9dfee247a8 38736 
weborf_0.13-3_amd64.deb
 64e7b26fafec763faa8cb3288daad007aa86401bdb6f1d0ac9b90ca12a1565d6 11438 
weborf-daemon_0.13-3_all.deb
 979f71ae1f6413402a2606ad842432607d276e11aa1f18bea2fad775ad4d4cfe 17404 
qweborf_0.13-3_all.deb
Files: 
 86fdcac4ed395b4f757af3ac19a31ccb 1240 httpd optional weborf_0.13-3.dsc
 f3351f83144d1771e1c83b55679a1d91 4657 httpd optional 
weborf_0.13-3.debian.tar.gz
 36000f80ce1f49605a5de3feaec146f3 38736 httpd optional weborf_0.13-3_amd64.deb
 f0ae562dd6ab2ae42acdf253425346e8 11438 httpd optional 
weborf-daemon_0.13-3_all.deb
 80c25ce1e81864a7790e221a2cf88574 17404 httpd optional qweborf_0.13-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk/kOx4ACgkQ5/8uW2NPmiBwdACcDArggxI6SzOEHJnAabqvstn5
BncAoKtxTdPXu0L/9hAlvP4AUJguLcY3
=o6gw
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to