(recv_conn): use getnameinfo_verified
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7526 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		| @@ -116,6 +116,7 @@ recv_conn (int sock, kx_context *kc, | |||||||
|      struct passwd *passwd; |      struct passwd *passwd; | ||||||
|      struct sockaddr_in thisaddr, thataddr; |      struct sockaddr_in thisaddr, thataddr; | ||||||
|      char remotehost[MaxHostNameLen]; |      char remotehost[MaxHostNameLen]; | ||||||
|  |      char remoteaddr[INET6_ADDRSTRLEN]; | ||||||
|      int ret = 1; |      int ret = 1; | ||||||
|      int flags; |      int flags; | ||||||
|      int len; |      int len; | ||||||
| @@ -137,7 +138,7 @@ recv_conn (int sock, kx_context *kc, | |||||||
|      kc->thisaddr = thisaddr; |      kc->thisaddr = thisaddr; | ||||||
|      kc->thataddr = thataddr; |      kc->thataddr = thataddr; | ||||||
|  |  | ||||||
|      getnameinfo (&thataddr, addrlen, remotehost, sizeof(remotehost), |      getnameinfo_verified (&thataddr, addrlen, remotehost, sizeof(remotehost), | ||||||
| 			   NULL, 0, 0); | 			   NULL, 0, 0); | ||||||
|  |  | ||||||
|      if (net_read (sock, msg, 4) != 4) { |      if (net_read (sock, msg, 4) != 4) { | ||||||
| @@ -224,9 +225,11 @@ recv_conn (int sock, kx_context *kc, | |||||||
| 	 syslog(LOG_ERR, "setting uid/groups: %m"); | 	 syslog(LOG_ERR, "setting uid/groups: %m"); | ||||||
| 	 fatal (kc, sock, "cannot set uid"); | 	 fatal (kc, sock, "cannot set uid"); | ||||||
|      } |      } | ||||||
|  |      inet_ntop (thataddr.sin_family, | ||||||
|  | 		&thataddr.sin_addr, remoteaddr, sizeof(remoteaddr)); | ||||||
|  |  | ||||||
|      syslog (LOG_INFO, "from %s(%s): %s -> %s", |      syslog (LOG_INFO, "from %s(%s): %s -> %s", | ||||||
| 	     remotehost, | 	     remotehost, remoteaddr, | ||||||
| 	     inet_ntoa(thataddr.sin_addr), |  | ||||||
| 	     kc->user, user); | 	     kc->user, user); | ||||||
|      umask(077); |      umask(077); | ||||||
|      if (!(flags & PASSIVE)) { |      if (!(flags & PASSIVE)) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Assar Westerlund
					Assar Westerlund