delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/03/13/06:11:27

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
From: Fabien Steinmetz <fabienst AT yahoo DOT fr>
To: cygwin AT cygwin DOT com
Subject: dansguardian/cygwin and IPC/BSD sockets. Doesn't write to log
Date: Sun, 13 Mar 2005 12:11:18 +0100
User-Agent: KMail/1.7.1
MIME-Version: 1.0
Message-Id: <200503131211.18527.fabienst@yahoo.fr>
X-IsSubscribed: yes

Hello,

I'm trying to make dansguardian (www.danguardian.org v.2.8.0.4) run on 
Cygwin/WindowsXP.
I modified the "configure" script so that dansguardian gets compiled. 
Currently everything works ok (i.e. filtering...), _except_ writing into the 
log file and the url cache.

Dansguardian uses IPC and a pipe to write to files. From what I read in 
various mailing lists and forums, I understood that :
- It should be possible to use the original code of the program writen for 
Linux/Posix and that cugwin would manage everything to make BSD sockets work 
on windows
- Another solution would be to change the code of the program (dansguardian) 
and use winsock2 instead of BSD socket. Thus having a win32 implementation of 
sockets. I would like to avoid rewriting (part of) the code.

So as I read there still could be problems with the cygwin "implemantation" of 
BSD sockets I thought it would be a good place to report my issues here.


Dansguardian reports the following errors (found in windows' journal)
"Error connecting via ipc to log"
"Error connecting via ipc to url cache"

I had a look at the code of dansguardian to find where the issue comes from.

I found that I have an errno 14 (ie EFAULT "Bad Address") in the following 
function of file "UDSocket.cpp". This occurs after calling 'connect

======= EXTRACT OF FILE "UDSocket.cpp" ==========
int UDSocket::connect(const char* path) {  // to make a connection to a serv
    #ifdef DGDEBUG
        std::cout << "uds connect:" << path << std::endl;
    #endif
    isused = true;
    strcpy(my_adr_un.sun_path, path);
    #ifdef __BSD
    // __BSD IS NOT DEFINED IN MY CONFIG. SHOULD IT BE DEFINED ?
        #ifdef SCM_RIGHTS     /* 4.3BSD Reno and later */
            my_adr_un_length = sizeof(my_adr_un.sun_len) + 
sizeof(my_adr_un.sun_family) + strlen(my_adr_un.sun_path) + 1;
            my_adr_un.sun_len = my_adr_un_length ;
        #endif
    #else
        my_adr_un_length = sizeof(my_adr_un.sun_family) + 
strlen(my_adr_un.sun_path);
    #endif
    int ret_value = ::connect(sck_un, (struct sockaddr *) &my_adr_un, 
my_adr_un_length);
    //HERE I HAVE ERRNO 14 !
    //std::cout << "connect ret value:" << ret_value << std::endl;
    //std::cout << "connect ret value errno:" << errno << std::endl;

    return ret_value;
}
======= EXTRACT OF FILE "UDSocket.cpp" ==========

The output of function above is :
  uds connect:/tmp/.dguardianipc
  connect ret value:-1
  connect ret value errno:14

  
Any idea on why I have errno 14 and how to solve it ?
  

My Config : 
- Cygwin 1.5.13-1 on windows XP (home or pro)
- Squid NT 2.5.stable9 
(http://www.acmeconsulting.it/pagine/opensource/squid/squidnt25.htm)
- The filesystem is NTFS and /tmp has the good permissions (1777)


Thanks for your help.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019