[PATCH] Fix "permission denied" on rename() under Cygwin

Michael Bunk bunk at iat.uni-leipzig.de
Fri Dec 28 15:13:37 CET 2007


Hello,

Nagios 3.0RC1 doesn't work on Cygwin.  rename() with a new filename, which is 
already held open, results in a "Permission Denied".  This situation appears 
with the current code while reaping check results.

Attached patch simply closes the new file just opened with mkstemp() - before 
renaming instead of afterwards.  Securitywise this is a bad solution, because 
it opens a race condition, but at least Nagios works.

Please incorporate the bugfix included in the attached patch in a secure form, 
so that Nagios will be usable under Cygwin (if other Cygwin issues are 
resolved as well).

Best regards,
 Michael Bunk
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-3.0rc1-fix-permission-denied-on-renaming-file.patch
Type: application/octet-stream
Size: 762 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20071228/485a88cf/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4189 bytes
Desc: not available
URL: <https://www.monitoring-lists.org/archive/developers/attachments/20071228/485a88cf/attachment.bin>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list