[BACK]Return to testsudoers.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Diff for /src/usr.bin/sudo/Attic/testsudoers.c between version 1.4 and 1.5

version 1.4, 2000/03/27 03:44:39 version 1.5, 2002/01/03 03:49:16
Line 1 
Line 1 
 /*  /*
  * Copyright (c) 1996, 1998-2000 Todd C. Miller <Todd.Miller@courtesan.com>   * Copyright (c) 1996, 1998-2001 Todd C. Miller <Todd.Miller@courtesan.com>
  * All rights reserved.   * All rights reserved.
  *   *
  * This code is derived from software contributed by Chris Jepeway   * This code is derived from software contributed by Chris Jepeway
Line 37 
Line 37 
   
 #include "config.h"  #include "config.h"
   
   #include <sys/param.h>
   #include <sys/types.h>
   #include <sys/stat.h>
   #include <sys/socket.h>
 #include <stdio.h>  #include <stdio.h>
 #ifdef STDC_HEADERS  #ifdef STDC_HEADERS
 # include <stdlib.h>  # include <stdlib.h>
   # include <stddef.h>
   #else
   # ifdef HAVE_STDLIB_H
   #  include <stdlib.h>
   # endif
 #endif /* STDC_HEADERS */  #endif /* STDC_HEADERS */
 #ifdef HAVE_UNISTD_H  
 # include <unistd.h>  
 #endif /* HAVE_UNISTD_H */  
 #ifdef HAVE_STRING_H  #ifdef HAVE_STRING_H
 # include <string.h>  # include <string.h>
   #else
   # ifdef HAVE_STRINGS_H
   #  include <strings.h>
   # endif
 #endif /* HAVE_STRING_H */  #endif /* HAVE_STRING_H */
 #ifdef HAVE_STRINGS_H  #ifdef HAVE_UNISTD_H
 # include <strings.h>  # include <unistd.h>
 #endif /* HAVE_STRINGS_H */  #endif /* HAVE_UNISTD_H */
 #ifdef HAVE_FNMATCH  #ifdef HAVE_FNMATCH
 # include <fnmatch.h>  # include <fnmatch.h>
 #endif /* HAVE_FNMATCH_H */  #endif /* HAVE_FNMATCH_H */
Line 59 
Line 69 
 #include <ctype.h>  #include <ctype.h>
 #include <pwd.h>  #include <pwd.h>
 #include <grp.h>  #include <grp.h>
 #include <sys/param.h>  
 #include <sys/types.h>  
 #include <sys/socket.h>  
 #include <netinet/in.h>  #include <netinet/in.h>
 #include <arpa/inet.h>  #include <arpa/inet.h>
 #include <netdb.h>  #include <netdb.h>
 #include <sys/stat.h>  
 #include <dirent.h>  #include <dirent.h>
   
 #include "sudo.h"  #include "sudo.h"
Line 77 
Line 83 
 #endif /* HAVE_FNMATCH */  #endif /* HAVE_FNMATCH */
   
 #ifndef lint  #ifndef lint
 static const char rcsid[] = "$Sudo: testsudoers.c,v 1.71 2000/03/23 04:38:22 millert Exp $";  static const char rcsid[] = "$Sudo: testsudoers.c,v 1.75 2001/12/15 02:27:17 millert Exp $";
 #endif /* lint */  #endif /* lint */
   
   
 /*  /*
    * Prototypes
    */
   void init_parser        __P((void));
   void dumpaliases        __P((void));
   void set_perms_dummy    __P((int, int));
   
   /*
  * Globals   * Globals
  */   */
 char **Argv, **NewArgv;  char **Argv, **NewArgv;
Line 89 
Line 103 
 int num_interfaces;  int num_interfaces;
 struct interface *interfaces;  struct interface *interfaces;
 struct sudo_user sudo_user;  struct sudo_user sudo_user;
   void (*set_perms) __P((int, int)) = set_perms_dummy;
 extern int clearaliases;  extern int clearaliases;
 extern int pedantic;  extern int pedantic;
   
 /*  /*
  * Prototypes for external functions  
  */  
 void init_parser        __P((void));  
 void dumpaliases        __P((void));  
   
 /*  
  * Returns TRUE if "s" has shell meta characters in it,   * Returns TRUE if "s" has shell meta characters in it,
  * else returns FALSE.   * else returns FALSE.
  */   */
Line 190 
Line 199 
         addr.s_addr = inet_addr(n);          addr.s_addr = inet_addr(n);
         if (strchr(m, '.'))          if (strchr(m, '.'))
             mask.s_addr = inet_addr(m);              mask.s_addr = inet_addr(m);
         else          else {
             mask.s_addr = (1 << atoi(m)) - 1;   /* XXX - better way? */              i = 32 - atoi(m);
               mask.s_addr = 0xffffffff;
               mask.s_addr >>= i;
               mask.s_addr <<= i;
               mask.s_addr = htonl(mask.s_addr);
           }
         *(m - 1) = '/';          *(m - 1) = '/';
   
         for (i = 0; i < num_interfaces; i++)          for (i = 0; i < num_interfaces; i++)
Line 298 
Line 312 
 }  }
   
 void  void
 set_perms(i, j)  set_perms_dummy(i, j)
     int i, j;      int i, j;
 {  {
     return;      return;
Line 306 
Line 320 
   
 void  void
 set_fqdn()  set_fqdn()
   {
       return;
   }
   
   void
   init_envtables()
 {  {
     return;      return;
 }  }

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5