diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | ssh-agent.c | 12 |
2 files changed, 15 insertions, 1 deletions
@@ -10,6 +10,8 @@ | |||
10 | [servconf.c] | 10 | [servconf.c] |
11 | remove "\n" from fatal() | 11 | remove "\n" from fatal() |
12 | - (bal) Updated Cygwin README by Corinna Vinschen <vinschen@redhat.com> | 12 | - (bal) Updated Cygwin README by Corinna Vinschen <vinschen@redhat.com> |
13 | - (bal) Avoid socket file security issues in ssh-agent for Cygwin. | ||
14 | Patch by Egor Duda <deo@logos-m.ru> | ||
13 | 15 | ||
14 | 20010503 | 16 | 20010503 |
15 | - OpenBSD CVS Sync | 17 | - OpenBSD CVS Sync |
@@ -5321,4 +5323,4 @@ | |||
5321 | - Wrote replacements for strlcpy and mkdtemp | 5323 | - Wrote replacements for strlcpy and mkdtemp |
5322 | - Released 1.0pre1 | 5324 | - Released 1.0pre1 |
5323 | 5325 | ||
5324 | $Id: ChangeLog,v 1.1194 2001/05/03 22:45:21 mouring Exp $ | 5326 | $Id: ChangeLog,v 1.1195 2001/05/03 22:59:24 mouring Exp $ |
diff --git a/ssh-agent.c b/ssh-agent.c index e8362ded0..07dafaa57 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -714,6 +714,9 @@ main(int ac, char **av) | |||
714 | #ifdef HAVE_SETRLIMIT | 714 | #ifdef HAVE_SETRLIMIT |
715 | struct rlimit rlim; | 715 | struct rlimit rlim; |
716 | #endif | 716 | #endif |
717 | #ifdef HAVE_CYGWIN | ||
718 | int prev_mask; | ||
719 | #endif | ||
717 | pid_t pid; | 720 | pid_t pid; |
718 | char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid]; | 721 | char *shell, *format, *pidstr, pidstrbuf[1 + 3 * sizeof pid]; |
719 | extern int optind; | 722 | extern int optind; |
@@ -805,10 +808,19 @@ main(int ac, char **av) | |||
805 | memset(&sunaddr, 0, sizeof(sunaddr)); | 808 | memset(&sunaddr, 0, sizeof(sunaddr)); |
806 | sunaddr.sun_family = AF_UNIX; | 809 | sunaddr.sun_family = AF_UNIX; |
807 | strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path)); | 810 | strlcpy(sunaddr.sun_path, socket_name, sizeof(sunaddr.sun_path)); |
811 | #ifdef HAVE_CYGWIN | ||
812 | prev_mask = umask(0177); | ||
813 | #endif | ||
808 | if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) { | 814 | if (bind(sock, (struct sockaddr *) & sunaddr, sizeof(sunaddr)) < 0) { |
809 | perror("bind"); | 815 | perror("bind"); |
816 | #ifdef HAVE_CYGWIN | ||
817 | umask(prev_mask); | ||
818 | #endif | ||
810 | cleanup_exit(1); | 819 | cleanup_exit(1); |
811 | } | 820 | } |
821 | #ifdef HAVE_CYGWIN | ||
822 | umask(prev_mask); | ||
823 | #endif | ||
812 | if (listen(sock, 5) < 0) { | 824 | if (listen(sock, 5) < 0) { |
813 | perror("listen"); | 825 | perror("listen"); |
814 | cleanup_exit(1); | 826 | cleanup_exit(1); |