patch for openssh
Hi, I tried to find the bug which prevents me from using pam_ssh, but I was not able to find it so far (output from xdm: "xdm error (pid 2530): Unknown session exit code 2816 from process 2727", I assume proc 2727 is "ssh-agent"). But I think I found some other bugs, please have a look at the attached diff. Bye, Alexander. -- The dark ages were caused by the Y1K problem. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = 7423 F3E6 3A7E B334 A9CC B10A 1F5F 130A A638 6E7E Index: authfd.c === RCS file: /big/FreeBSD-CVS/src/crypto/openssh/authfd.c,v retrieving revision 1.6 diff -u -r1.6 authfd.c --- authfd.c2000/09/10 09:35:37 1.6 +++ authfd.c2000/09/16 15:27:25 @@ -178,7 +178,7 @@ if (sock < 0) return NULL; - auth = xmalloc(sizeof(*auth)); + auth = xmalloc(sizeof(AuthenticationConnection)); auth->fd = sock; buffer_init(&auth->identities); auth->howmany = 0; Index: ssh-agent.c === RCS file: /big/FreeBSD-CVS/src/crypto/openssh/ssh-agent.c,v retrieving revision 1.7 diff -u -r1.7 ssh-agent.c --- ssh-agent.c 2000/09/10 09:35:38 1.7 +++ ssh-agent.c 2000/09/16 15:57:22 @@ -571,7 +571,7 @@ break; case AUTH_SOCKET: if (FD_ISSET(sockets[i].fd, readset)) { - slen = sizeof(sunaddr); + slen = SUN_LEN(&sunaddr)+1; sock = accept(sockets[i].fd, (struct sockaddr *) & sunaddr, &slen); if (sock < 0) { perror("accept from AUTH_SOCKET"); @@ -741,7 +741,8 @@ memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path)); - if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) { + sunaddr.sun_len = SUN_LEN(&sunaddr)+1; + if (bind(sock, (struct sockaddr *) & sunaddr, sunaddr.sun_len) < 0) { perror("bind"); cleanup_exit(1); }
Re: patch for openssh
On 16 Sep, To: [EMAIL PROTECTED] wrote: > But I think I found some other bugs, please have a look at the attached > diff. Oops, sorry, wrong diff. Bye, Alexander. -- To boldly go where I surely don't belong. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = 7423 F3E6 3A7E B334 A9CC B10A 1F5F 130A A638 6E7E Index: authfd.c === RCS file: /big/FreeBSD-CVS/src/crypto/openssh/authfd.c,v retrieving revision 1.6 diff -u -r1.6 authfd.c --- authfd.c2000/09/10 09:35:37 1.6 +++ authfd.c2000/09/16 15:27:25 @@ -178,7 +178,7 @@ if (sock < 0) return NULL; - auth = xmalloc(sizeof(*auth)); + auth = xmalloc(sizeof(AuthenticationConnection)); auth->fd = sock; buffer_init(&auth->identities); auth->howmany = 0; Index: ssh-agent.c === RCS file: /big/FreeBSD-CVS/src/crypto/openssh/ssh-agent.c,v retrieving revision 1.7 diff -u -r1.7 ssh-agent.c --- ssh-agent.c 2000/09/10 09:35:38 1.7 +++ ssh-agent.c 2000/09/17 09:24:21 @@ -577,6 +577,8 @@ perror("accept from AUTH_SOCKET"); break; } + slen -= sizeof(sunaddr.sun_len) + +sizeof(sunaddr.sun_family); + sunaddr.sun_path[slen] = 0; new_socket(AUTH_CONNECTION, sock); } break; @@ -741,7 +743,8 @@ memset(&sunaddr, 0, sizeof(sunaddr)); sunaddr.sun_family = AF_UNIX; strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path)); - if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) { + sunaddr.sun_len = SUN_LEN(&sunaddr)+1; + if (bind(sock, (struct sockaddr *) & sunaddr, sunaddr.sun_len) < 0) { perror("bind"); cleanup_exit(1); }
Re: patch for openssh
In article <[EMAIL PROTECTED]>, Alexander Leidinger <[EMAIL PROTECTED]> wrote: > > Index: authfd.c > === > RCS file: /big/FreeBSD-CVS/src/crypto/openssh/authfd.c,v > retrieving revision 1.6 > diff -u -r1.6 authfd.c > --- authfd.c 2000/09/10 09:35:37 1.6 > +++ authfd.c 2000/09/16 15:27:25 > @@ -178,7 +178,7 @@ > if (sock < 0) > return NULL; > > - auth = xmalloc(sizeof(*auth)); > + auth = xmalloc(sizeof(AuthenticationConnection)); > auth->fd = sock; > buffer_init(&auth->identities); > auth->howmany = 0; What is the point of that change? Functionally it makes no difference at all, since "*auth" is an AuthenticationConnection. It makes the code harder to maintain in case the type of "auth" is changed in the future. John -- John Polstra [EMAIL PROTECTED] John D. Polstra & Co., Inc.Seattle, Washington USA "Disappointment is a good sign of basic intelligence." -- Chögyam Trungpa To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message
Re: patch for openssh
On 17 Sep, John Polstra wrote: > What is the point of that change? Functionally it makes no difference > at all, since "*auth" is an AuthenticationConnection. It makes the I was a little bit confused at that time. Yes, it's more of a bikeshed decision, IMHO it makes it less difficult to read (you didn't have to search for the type). > code harder to maintain in case the type of "auth" is changed in the > future. This depends on the type of change someone makes. If you didn't change the typedef of "AuthenticationConnection" but the type of "auth", you normaly have to go through the code and ensure every invariant is still valid (I classify this as a major code change, but this is a bikeshed argument too). Bye, Alexander. -- The three Rs of Microsoft support: Retry, Reboot, Reinstall. http://www.Leidinger.net Alexander @ Leidinger.net GPG fingerprint = 7423 F3E6 3A7E B334 A9CC B10A 1F5F 130A A638 6E7E To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message