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

Diff for /src/usr.bin/ssh/authfile.c between version 1.37 and 1.38

version 1.37, 2001/06/23 15:12:17 version 1.38, 2001/09/23 11:09:13
Line 486 
Line 486 
 {  {
         struct stat st;          struct stat st;
   
         /* check owner and modes */          if (fstat(fd, &st) < 0)
         if (fstat(fd, &st) < 0 ||                  return 0;
             (st.st_uid != 0 && getuid() != 0 && st.st_uid != getuid()) ||          /*
             (st.st_mode & 077) != 0) {           * if a key owned by the user is accessed, then we check the
                 close(fd);           * permissions of the file. if the key owned by a different user,
            * then we don't care.
            */
           if ((st.st_uid == getuid()) && (st.st_mode & 077) != 0) {
                 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");                  error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                 error("@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @");                  error("@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @");
                 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");                  error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
                 error("Bad ownership or mode(0%3.3o) for '%s'.",                  error("Permissions 0%3.3o for '%s' are too open.",
                     st.st_mode & 0777, filename);                      st.st_mode & 0777, filename);
                 error("It is recommended that your private key files are NOT accessible by others.");                  error("It is recommended that your private key files are NOT accessible by others.");
                 error("This private key will be ignored.");                  error("This private key will be ignored.");

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38