OpenLDAP
Up to top level
Build   Contrib   Development   Documentation   Historical   Incoming   Software Bugs   Software Enhancements   Web  

Logged in as guest

Viewing Software Bugs/6037
Full headers

From: h.b.furuseth@usit.uio.no
Subject: errno in signal handlers
Compose comment
Download message
State:
0 replies:
0 followups:

Major security issue: yes  no

Notes:

Notification:


Date: Thu, 26 Mar 2009 20:34:47 +0000
From: h.b.furuseth@usit.uio.no
To: openldap-its@OpenLDAP.org
Subject: errno in signal handlers
Full_Name: Hallvard B Furuseth
Version: HEAD, RE24
OS: 
URL: 
Submission from: (NULL) (129.240.6.233)
Submitted by: hallvard


Signal handlers slapd/daemon.c:slap_sig_shutdown()/slap_sig_wake() need
to save/restore errno, since they call functions that can modify errno.

And/or possibly they need sock_errno() - sock_errset() from ac/socket.h,
since they use tcp_write()?  I don't know if that's safe inside signal
handlers, or if Windows itself saves/restores this code around signal
handlers.


slapd/main.c:wait4child() can loop forever after EINTR, since it checks
for errno even when the waitpid returns 0.  I don't know if there is
a good reason it does that.  Some of the commits have my name on them
but I think I copied it from elsewhere.


Anyway, I'm doing the minimal changes now: save/restore errno, and
set errno=0 in each loop iteration instead of before the loop.
Anyone with better ideas can take it from there.
Up to top level
Build   Contrib   Development   Documentation   Historical   Incoming   Software Bugs   Software Enhancements   Web  

Logged in as guest


The OpenLDAP Issue Tracking System uses a hacked version of JitterBug

______________
© Copyright 2009, OpenLDAP Foundation, info@OpenLDAP.org