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

Diff for /src/usr.bin/file/file.c between version 1.60 and 1.61

version 1.60, 2017/06/28 13:37:56 version 1.61, 2017/06/28 15:40:54
Line 104 
Line 104 
         int                      opt, idx;          int                      opt, idx;
         char                    *home, *magicpath;          char                    *home, *magicpath;
         struct passwd           *pw;          struct passwd           *pw;
         FILE                    *magicfp;          FILE                    *magicfp = NULL;
         struct magic            *m;          struct magic            *m;
         struct input_file       *inf = NULL;          struct input_file       *inf = NULL;
         size_t                   len, width = 0;          size_t                   len, width = 0;
   
         tzset();          if (pledge("stdio rpath getpw id", NULL) == -1)
                   err(1, "pledge");
   
         for (;;) {          for (;;) {
                 opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL);                  opt = getopt_long(argc, argv, "bchiLsW", longopts, NULL);
Line 149 
Line 150 
         } else if (argc == 0)          } else if (argc == 0)
                 usage();                  usage();
   
         magicfp = NULL;  
         if (geteuid() != 0 && !issetugid()) {          if (geteuid() != 0 && !issetugid()) {
                 home = getenv("HOME");                  home = getenv("HOME");
                 if (home == NULL || *home == '\0') {                  if (home == NULL || *home == '\0') {
Line 182 
Line 182 
                         prepare_input(&inf[idx], argv[idx]);                          prepare_input(&inf[idx], argv[idx]);
                 }                  }
         }          }
   
           tzset();
   
         if (pledge("stdio getpw id", NULL) == -1)          if (pledge("stdio getpw id", NULL) == -1)
                 err(1, "pledge");                  err(1, "pledge");

Legend:
Removed from v.1.60  
changed lines
  Added in v.1.61