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

Diff for /src/usr.bin/ssh/sshpty.c between version 1.3 and 1.3.2.2

version 1.3, 2001/07/22 21:32:27 version 1.3.2.2, 2002/06/26 18:22:37
Line 131 
Line 131 
         *ttyfd = open(name, O_RDWR | O_NOCTTY);          *ttyfd = open(name, O_RDWR | O_NOCTTY);
         if (*ttyfd < 0) {          if (*ttyfd < 0) {
                 error("Could not open pty slave side %.100s: %.100s",                  error("Could not open pty slave side %.100s: %.100s",
                       name, strerror(errno));                      name, strerror(errno));
                 close(*ptyfd);                  close(*ptyfd);
                 return 0;                  return 0;
         }          }
Line 224 
Line 224 
         fd = open(_PATH_TTY, O_WRONLY);          fd = open(_PATH_TTY, O_WRONLY);
         if (fd < 0)          if (fd < 0)
                 error("open /dev/tty failed - could not set controlling tty: %.100s",                  error("open /dev/tty failed - could not set controlling tty: %.100s",
                       strerror(errno));                      strerror(errno));
         else {          else
                 close(fd);                  close(fd);
         }  
 }  }
   
 /* Changes the window size associated with the pty. */  /* Changes the window size associated with the pty. */
   
 void  void
 pty_change_window_size(int ptyfd, int row, int col,  pty_change_window_size(int ptyfd, int row, int col,
                        int xpixel, int ypixel)          int xpixel, int ypixel)
 {  {
         struct winsize w;          struct winsize w;
   
         w.ws_row = row;          w.ws_row = row;
         w.ws_col = col;          w.ws_col = col;
         w.ws_xpixel = xpixel;          w.ws_xpixel = xpixel;
Line 273 
Line 273 
   
         if (st.st_uid != pw->pw_uid || st.st_gid != gid) {          if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
                 if (chown(ttyname, pw->pw_uid, gid) < 0) {                  if (chown(ttyname, pw->pw_uid, gid) < 0) {
                         if (errno == EROFS &&                          if (errno == EROFS &&
                            (st.st_uid == pw->pw_uid || st.st_uid == 0))                              (st.st_uid == pw->pw_uid || st.st_uid == 0))
                                 error("chown(%.100s, %d, %d) failed: %.100s",                                  error("chown(%.100s, %u, %u) failed: %.100s",
                                       ttyname, pw->pw_uid, gid,                                      ttyname, (u_int)pw->pw_uid, (u_int)gid,
                                       strerror(errno));                                      strerror(errno));
                         else                          else
                                 fatal("chown(%.100s, %d, %d) failed: %.100s",                                  fatal("chown(%.100s, %u, %u) failed: %.100s",
                                       ttyname, pw->pw_uid, gid,                                      ttyname, (u_int)pw->pw_uid, (u_int)gid,
                                       strerror(errno));                                      strerror(errno));
                 }                  }
         }          }
   
Line 290 
Line 290 
                         if (errno == EROFS &&                          if (errno == EROFS &&
                             (st.st_mode & (S_IRGRP | S_IROTH)) == 0)                              (st.st_mode & (S_IRGRP | S_IROTH)) == 0)
                                 error("chmod(%.100s, 0%o) failed: %.100s",                                  error("chmod(%.100s, 0%o) failed: %.100s",
                                       ttyname, mode, strerror(errno));                                      ttyname, mode, strerror(errno));
                         else                          else
                                 fatal("chmod(%.100s, 0%o) failed: %.100s",                                  fatal("chmod(%.100s, 0%o) failed: %.100s",
                                       ttyname, mode, strerror(errno));                                      ttyname, mode, strerror(errno));
                 }                  }
         }          }
 }  }

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.2