diff --git a/winsup/cygserver/ChangeLog b/winsup/cygserver/ChangeLog index 696057060..653f531fb 100644 --- a/winsup/cygserver/ChangeLog +++ b/winsup/cygserver/ChangeLog @@ -7,6 +7,22 @@ * client.cc: Throughout, fix debug output of signed byte count value. +2014-05-19 Corinna Vinschen + + * bsd_mutex.cc (msleep_sync_array::~msleep_sync_array): New destructor + to make Coverity happy (CID 59838). + +2014-05-19 Corinna Vinschen + + * bsd_helper.cc (ipcexit_creat_hookthread): Delete shs to make + Coverity happy (CID 59993). + * transport_pipes.cc (transport_layer_pipes::listen): Make listen_pipe + and connect_pipe statics to make Coverity happy (CID 60010/60011). + +2014-04-16 Corinna Vinschen + + * cygserver-config: Use numeric id 18 instead of "system" in chown. + 2014-04-07 Corinna Vinschen * process.cc (process::process): Only notice that signal_arrived is diff --git a/winsup/cygserver/bsd_helper.cc b/winsup/cygserver/bsd_helper.cc index ae4e07e11..524817f1d 100644 --- a/winsup/cygserver/bsd_helper.cc +++ b/winsup/cygserver/bsd_helper.cc @@ -210,6 +210,7 @@ ipcexit_creat_hookthread (struct thread *td) HANDLE thread = CreateThread (NULL, 0, ipcexit_hookthread, shs, 0, &tid); if (!thread) { + delete shs; log (LOG_CRIT, "failed to create thread, error = %u", GetLastError ()); return cygwin_internal (CW_GET_ERRNO_FROM_WINERROR, GetLastError (), ENOMEM); diff --git a/winsup/cygserver/bsd_mutex.cc b/winsup/cygserver/bsd_mutex.cc index 02896bb6d..66c4b2398 100644 --- a/winsup/cygserver/bsd_mutex.cc +++ b/winsup/cygserver/bsd_mutex.cc @@ -227,6 +227,8 @@ public: panic ("Allocating msleep records failed: %d", errno); } + ~msleep_sync_array () { delete a; } + HANDLE enter (void *ident) { HANDLE evt = NULL; diff --git a/winsup/cygserver/cygserver-config b/winsup/cygserver/cygserver-config index f9515e71e..b8f441c3d 100755 --- a/winsup/cygserver/cygserver-config +++ b/winsup/cygserver/cygserver-config @@ -157,7 +157,7 @@ then exit 1 fi chmod 664 "${SYSCONFDIR}/cygserver.conf" - chown system.544 "${SYSCONFDIR}/cygserver.conf" + chown 18.544 "${SYSCONFDIR}/cygserver.conf" fi # On NT ask if cygserver should be installed as service @@ -189,7 +189,7 @@ then echo "To start it, call \`net start cygserver' or \`cygrunsrv -S cygserver'." fi touch "${LOCALSTATEDIR}/log/cygserver.log" - chown system.544 "${LOCALSTATEDIR}/log/cygserver.log" + chown 18.544 "${LOCALSTATEDIR}/log/cygserver.log" fi fi diff --git a/winsup/cygserver/transport_pipes.cc b/winsup/cygserver/transport_pipes.cc index 8f3760741..fd5ef0914 100644 --- a/winsup/cygserver/transport_pipes.cc +++ b/winsup/cygserver/transport_pipes.cc @@ -83,6 +83,9 @@ transport_layer_pipes::~transport_layer_pipes () #ifndef __INSIDE_CYGWIN__ +static HANDLE listen_pipe; +static HANDLE connect_pipe; + int transport_layer_pipes::listen () { @@ -94,16 +97,19 @@ transport_layer_pipes::listen () debug ("Try to create named pipe: %ls", _pipe_name); - HANDLE listen_pipe = + /* We have to create the first instance of the listening pipe here, and + we also have to create at least one instance of the client side to avoid + a race condition. + See https://cygwin.com/ml/cygwin/2012-11/threads.html#00144 */ + listen_pipe = CreateNamedPipeW (_pipe_name, PIPE_ACCESS_DUPLEX | FILE_FLAG_FIRST_PIPE_INSTANCE, PIPE_TYPE_BYTE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES, 0, 0, 1000, &sec_all_nih); if (listen_pipe != INVALID_HANDLE_VALUE) { - HANDLE connect_pipe = - CreateFileW (_pipe_name, GENERIC_READ | GENERIC_WRITE, 0, &sec_all_nih, - OPEN_EXISTING, 0, NULL); + connect_pipe = CreateFileW (_pipe_name, GENERIC_READ | GENERIC_WRITE, 0, + &sec_all_nih, OPEN_EXISTING, 0, NULL); if (connect_pipe == INVALID_HANDLE_VALUE) { CloseHandle (listen_pipe);