Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-14 Thread Brandon Williams
On 03/13, Devin Lehmacher wrote: > > Best practice for submitting patches would be to ensure that each patch > > compiles without errors (with the DEVELOPER=1 flag set) and that the > > entire test suite passes with no errors; this is to maintain > > bisect-ability. Only after you've done this

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-14 Thread Devin Lehmacher
> Also I think you would want to use S_ISFIFO() and/or S_ISSOCK() > macros (I do not offhand recall which one credential cache daemon > uses), not the S_IFxxx constant. Huh. These macros are not on the man page for lstat. > Having said that, I do not think ~/.git-credential-cache/socket is > the

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-14 Thread Junio C Hamano
Junio C Hamano writes: > Devin Lehmacher writes: > >> diff --git a/credential-cache.c b/credential-cache.c >> index db1343b46..63236adc2 100644 >> --- a/credential-cache.c >> +++ b/credential-cache.c >> @@ -83,12 +83,18 @@ static void do_cache(const char

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Junio C Hamano
Devin Lehmacher writes: > diff --git a/credential-cache.c b/credential-cache.c > index db1343b46..63236adc2 100644 > --- a/credential-cache.c > +++ b/credential-cache.c > @@ -83,12 +83,18 @@ static void do_cache(const char *socket, const char > *action, int timeout, >

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
> Best practice for submitting patches would be to ensure that each patch > compiles without errors (with the DEVELOPER=1 flag set) and that the > entire test suite passes with no errors; this is to maintain > bisect-ability. Only after you've done this should you send your > patches to the

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Brandon Williams
On 03/13, Devin Lehmacher wrote: > > +static int is_socket(char *path) { > > + struct stat sb; > > + int ret = lstat(path, ); > > + return ret && S_IFSOCK(sb.st_mode); > > +} > > This patch won’t even compile. S_IFSOCK(sb.st_mode) should have been S_IFSOCK > & sb.st_mode. > > (I guess I

Re: [GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
> +static int is_socket(char *path) { > + struct stat sb; > + int ret = lstat(path, ); > + return ret && S_IFSOCK(sb.st_mode); > +} This patch won’t even compile. S_IFSOCK(sb.st_mode) should have been S_IFSOCK & sb.st_mode. (I guess I should have compiled first) After making that

[GSoC][PATCH/RFC v3 3/3] credential-cache: only use user_socket if a socket

2017-03-13 Thread Devin Lehmacher
Create function is_socket. Make get_socket_path return check if ~/.git-credential-cache/socket is a socket and not just a file. If file_exists behavior could change in an unexpected way. Additionally a file at ~/.git-credential-cache/socket could cause false positives which would otherwise lead to