commit - f173a974bee5181d8131519ed07b3b5261bf6366
commit + 30796698a9fca0037ea48f70ceafac1e783d06fb
blob - 407da1a3b0837ac2bd99c16054175a4b4070e006
blob + aa754eb482ae5c38f224adee20c9ac129751f19e
--- src/ngircd/conn.c
+++ src/ngircd/conn.c
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* they don't hold connections open that the main process wants to close.
*/
GLOBAL void
-Conn_CloseAllSockets(void)
+Conn_CloseAllSockets(int ExceptOf)
{
CONN_ID idx;
for(idx = 0; idx < Pool_Size; idx++) {
- if(My_Connections[idx].sock > NONE)
+ if(My_Connections[idx].sock > NONE &&
+ My_Connections[idx].sock != ExceptOf)
close(My_Connections[idx].sock);
}
}
blob - c813729f9331e1c3897ed32f44505f851f782604
blob + 251da2a07ddff28452d68559a35f039b6e14c676
--- src/ngircd/conn.h
+++ src/ngircd/conn.h
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton <alex@barton.de>
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
GLOBAL void Conn_Init PARAMS((void ));
GLOBAL void Conn_Exit PARAMS(( void ));
-GLOBAL void Conn_CloseAllSockets PARAMS((void));
+GLOBAL void Conn_CloseAllSockets PARAMS((int ExceptOf));
GLOBAL unsigned int Conn_InitListeners PARAMS(( void ));
GLOBAL void Conn_ExitListeners PARAMS(( void ));
blob - 0577cd9c0a94877532d7d594a2bb780e62c96598
blob + 884a06becee921df8f4ab42248e619853492cf85
--- src/ngircd/irc-login.c
+++ src/ngircd/irc-login.c
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
} else {
/* Sub process */
Log_Init_Subprocess("Auth");
+ Conn_CloseAllSockets(NONE);
result = PAM_Authenticate(Client);
if (write(pipefd[1], &result, sizeof(result)) != sizeof(result))
Log_Subprocess(LOG_ERR,
blob - fd2df1d947c51a773a9447a04e159e4a15afd8a4
blob + 7addb47ef30c804e889b6a49d390e2505ae8e1b2
--- src/ngircd/proc.c
+++ src/ngircd/proc.c
signal(SIGALRM, Proc_GenericSignalHandler);
close(pipefds[0]);
alarm(timeout);
- Conn_CloseAllSockets();
return 0;
}
blob - 9b17af9cb202209b4b5e79c53c50d316a2df3105
blob + c7e600381e81b571ded2cd343887529418e7d59c
--- src/ngircd/resolve.c
+++ src/ngircd/resolve.c
/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2009 by Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
} else if( pid == 0 ) {
/* Sub process */
Log_Init_Subprocess("Resolver");
- Do_ResolveAddr( Addr, identsock, pipefd[1]);
+ Conn_CloseAllSockets(identsock);
+ Do_ResolveAddr(Addr, identsock, pipefd[1]);
Log_Exit_Subprocess("Resolver");
exit(0);
}
} else if( pid == 0 ) {
/* Sub process */
Log_Init_Subprocess("Resolver");
+ Conn_CloseAllSockets(NONE);
Do_ResolveName(Host, pipefd[1]);
Log_Exit_Subprocess("Resolver");
exit(0);