Guest User

Untitled

a guest
Jun 21st, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. Index: sendmail.c
  2. ===================================================================
  3. RCS file: /repository/php-src/win32/sendmail.c,v
  4. retrieving revision 1.65.2.2.2.1
  5. diff -u -r1.65.2.2.2.1 sendmail.c
  6. --- sendmail.c 24 Feb 2007 02:17:28 -0000 1.65.2.2.2.1
  7. +++ sendmail.c 23 Jun 2009 03:12:09 -0000
  8. @@ -769,12 +769,25 @@
  9. short portnum;
  10.  
  11. /* Create Socket */
  12. - if ((sc = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET)
  13. + if ((sc = socket(PF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
  14. return (FAILED_TO_OBTAIN_SOCKET_HANDLE);
  15. + }
  16.  
  17. /* Get our own host name */
  18. - if (gethostname(LocalHost, HOST_NAME_LEN))
  19. + if (gethostname(LocalHost, HOST_NAME_LEN)) {
  20. return (FAILED_TO_GET_HOSTNAME);
  21. + }
  22. +
  23. + /* Get the FQDN, see bug #38091 */
  24. + if (!isdigit(LocalHost[0])) {
  25. + struct hostent *ent = gethostbyname(LocalHost);
  26. +
  27. + if (!ent) {
  28. + return (FAILED_TO_GET_HOSTNAME);
  29. + }
  30. +
  31. + strcpy(LocalHost, ent->h_name);
  32. + }
  33.  
  34. /* Resolve the servers IP */
  35. /*
Add Comment
Please, Sign In to add comment