]> granicus.if.org Git - sudo/commitdiff
now uses shost if FQDN
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 11 Mar 1996 01:15:08 +0000 (01:15 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 11 Mar 1996 01:15:08 +0000 (01:15 +0000)
parse.yacc
visudo.c

index cd1740e0be5c03143e74fc53a0c029880978bbcd..f06a71d7f9759c304b24a51c23df6174feeec2f1 100644 (file)
@@ -51,13 +51,17 @@ static char rcsid[] = "$Id$";
 #include <search.h>
 #endif /* HAVE_LSEARCH */
 
-#include "sudo.h"
 #include <options.h>
+#include "sudo.h"
 
 #ifndef HAVE_LSEARCH
 #include "emul/search.h"
 #endif /* HAVE_LSEARCH */
 
+#ifndef HAVE_STRCASECMP
+#define strcasecmp(a,b)                strcmp(a,b)
+#endif /* !HAVE_STRCASECMP */
+
 extern int sudolineno, parse_error;
 int errorlineno = -1;
 int clearaliases = 1;
@@ -195,7 +199,11 @@ hostspec   :       ALL {
                            (void) free($1);
                        }
                |       NAME {
-                           if (strcmp(host, $1) == 0)
+#ifdef FQDN
+                           if (strcasecmp(shost, $1) == 0)
+#else
+                           if (strcasecmp(host, $1) == 0)
+#endif /* FQDN */
                                host_matches = TRUE;
                            (void) free($1);
                        }
@@ -205,13 +213,8 @@ hostspec   :       ALL {
                            (void) free($1);
                        }
                |       fqdn {
-#ifdef HAVE_STRCASECMP
                            if (strcasecmp($1, host) == 0)
                                host_matches = TRUE;
-#else
-                           if (strcmp($1, host) == 0)
-                               host_matches = TRUE;
-#endif /* HAVE_STRCASECMP */
                            (void) free($1);
                        }
                ;
index 1dcf1148440f52c4ee4943bd9d4e4728f1e284b9..31f4fdf485dc856a003b75c0f684d4290a14e7a6 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -110,6 +110,9 @@ int parse_error = FALSE;
  * For the parsing routines
  */
 char host[] = "";
+#ifdef FQDN
+char shost[] = "";
+#endif /* FQDN */
 char *cmnd = "";
 struct passwd *user_pw_ent;