Re: [PATCH 0/2] git-credential-cache--daemon on Cygwin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 22, 2011 at 06:23:25PM +0100, Ramsay Jones wrote:

> I had a quick look, and found that unix_stream_listen() was failing to
> bind() to a stale unix socket. The code looked OK to me, and should have
> handled this just fine, but didn't ...
> 
> On a hunch, I found that the following "belt-n-braces" approach fixed the
> the test for me:
> 
> -- >8 --
> diff --git a/unix-socket.c b/unix-socket.c
> index cf9890f..d974e01 100644
> --- a/unix-socket.c
> +++ b/unix-socket.c
> @@ -42,7 +42,9 @@ int unix_stream_listen(const char *path)
>  	fd = unix_stream_socket();
>  
>  	if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
> +		close(fd);
>  		unlink(path);
> +		fd = unix_stream_socket();
>  		if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
>  			close(fd);
>  			return -1;
> -- 8< --

Wow, that seems horribly broken on the part of cygwin.

I think your solution to just unlink first() is the right way to go.  I
have a few comments, though so I'll respond to each of the patches
individually.

> Assuming that a modified http-auth-keyring series will make a return to pu
> sometime, could you please squash these patches into (the patch corresponding to)
> commit 2d6874d (credentials: add "cache" helper, 18-07-2011). Thanks!

I'm planning a reroll, so I'll squash them (or something similar) in.

> Also, note that this series breaks the build on MinGW. The patch to fix the build
> is rather simple, but the result doesn't work, of course, because winsock does
> not know about AF_UNIX (or AF_LOCAL). I started to code an win32 emulation of unix
> sockets, but stopped working on it when this branch dropped from next. If you
> intend to re-submit this work, then I can pick this up again.

Right. I sort of expected that, and figured we could just drop the cache
helper on mingw until somebody felt like writing such an emulation
layer.

It's definitely coming back, so if you feel like working on it, please
do. Also note that if it would be easier to have an alternate
abstraction for inter-process communication on windows, I'm open to
doing that in the cache daemon.

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]