Merge commit 'upstream/1.7.0'
[debian/sudo] / sudo.c
diff --git a/sudo.c b/sudo.c
index 7191ee14a68ecfb5f57d02bf3d72557cd4a06856..a842fc3951a0244d8c7b83d3ba5a26eca65b6bc6 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -590,6 +590,7 @@ init_vars(sudo_mode, envp)
      * "host" is the (possibly fully-qualified) hostname and
      * "shost" is the unqualified form of the hostname.
      */
+    sudo_user.host_fqdn_queried = FALSE;
     nohostname = gethostname(thost, sizeof(thost));
     if (nohostname)
        user_host = user_shost = "localhost";
@@ -600,13 +601,7 @@ init_vars(sudo_mode, envp)
            /* Defer call to set_fqdn() until log_error() is safe. */
            user_shost = user_host;
        } else {
-           if ((p = strchr(user_host, '.'))) {
-               *p = '\0';
-               user_shost = estrdup(user_host);
-               *p = '.';
-           } else {
-               user_shost = user_host;
-           }
+           user_shost = user_host;
        }
     }
 
@@ -1299,6 +1294,7 @@ set_fqdn()
     } else {
        user_shost = user_host;
     }
+    sudo_user.host_fqdn_queried = TRUE;
 }
 
 /*