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

Diff for /src/usr.bin/wall/ttymsg.c between version 1.17 and 1.18

version 1.17, 2015/11/05 22:20:11 version 1.18, 2019/05/16 06:23:15
Line 87 
Line 87 
                 return (errbuf);                  return (errbuf);
         }          }
   
         if (getuid()) {  
                 if (stat(device, &st) < 0)  
                         return (NULL);  
                 if ((st.st_mode & S_IWGRP) == 0)  
                         return (NULL);  
         }  
   
         /*          /*
          * open will fail on slip lines or exclusive-use lines           * open will fail on slip lines or exclusive-use lines
          * if not running as root; not an error.           * if not running as root; not an error.
Line 104 
Line 97 
                 (void) snprintf(errbuf, sizeof(errbuf),                  (void) snprintf(errbuf, sizeof(errbuf),
                     "%s: %s", device, strerror(errno));                      "%s: %s", device, strerror(errno));
                 return (errbuf);                  return (errbuf);
           }
   
           if (getuid()) {
                   if (fstat(fd, &st) < 0 ||
                       (st.st_mode & S_IWGRP) == 0) {
                           close(fd);
                           return (NULL);
                   }
         }          }
   
         for (cnt = left = 0; cnt < iovcnt; ++cnt)          for (cnt = left = 0; cnt < iovcnt; ++cnt)

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18