]> granicus.if.org Git - sudo/commitdiff
In cb_fqdn() just return if the fqdn flag is set to false.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 Jul 2016 20:52:33 +0000 (14:52 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 Jul 2016 20:52:33 +0000 (14:52 -0600)
plugins/sudoers/sudoers.c

index aa0fcfb089a5b89c48ab6494e4537f28ffc25938..216eeafb75eb0b755d4fcf1223beefd2284fb40c 100644 (file)
@@ -1054,12 +1054,16 @@ resolve_host(const char *host, char **longp, char **shortp)
  * Sets user_host, user_shost, user_runhost and user_srunhost.
  */
 static bool
-cb_fqdn(const union sudo_defs_val *unused)
+cb_fqdn(const union sudo_defs_val *sd_un)
 {
     bool remote;
     char *lhost, *shost;
     debug_decl(cb_fqdn, SUDOERS_DEBUG_PLUGIN)
 
+    /* Nothing to do if fqdn flag is disabled. */
+    if (sd_un != NULL && !sd_un->flag)
+       debug_return_bool(true);
+
     /* If the -h flag was given we need to resolve both host and runhost. */
     remote = strcmp(user_runhost, user_host) != 0;