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

Diff for /src/usr.bin/ssh/scp.c between version 1.157 and 1.158

version 1.157, 2007/06/12 08:24:20 version 1.158, 2007/06/12 13:54:28
Line 90 
Line 90 
 #include <string.h>  #include <string.h>
 #include <time.h>  #include <time.h>
 #include <unistd.h>  #include <unistd.h>
   #include <vis.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "atomicio.h"  #include "atomicio.h"
Line 569 
Line 570 
         off_t i, amt, statbytes;          off_t i, amt, statbytes;
         size_t result;          size_t result;
         int fd = -1, haderr, indx;          int fd = -1, haderr, indx;
         char *last, *name, buf[2048];          char *last, *name, buf[2048], encname[MAXPATHLEN];
         int len;          int len;
   
         for (indx = 0; indx < argc; ++indx) {          for (indx = 0; indx < argc; ++indx) {
Line 578 
Line 579 
                 len = strlen(name);                  len = strlen(name);
                 while (len > 1 && name[len-1] == '/')                  while (len > 1 && name[len-1] == '/')
                         name[--len] = '\0';                          name[--len] = '\0';
                 if (strchr(name, '\n') != NULL) {  
                         run_err("%s: skipping, filename contains a newline",  
                             name);  
                         goto next;  
                 }  
                 if ((fd = open(name, O_RDONLY|O_NONBLOCK, 0)) < 0)                  if ((fd = open(name, O_RDONLY|O_NONBLOCK, 0)) < 0)
                         goto syserr;                          goto syserr;
                   if (strchr(name, '\n') != NULL) {
                           strnvis(encname, name, sizeof(encname), VIS_NL);
                           name = encname;
                   }
                 if (fstat(fd, &stb) < 0) {                  if (fstat(fd, &stb) < 0) {
 syserr:                 run_err("%s: %s", name, strerror(errno));  syserr:                 run_err("%s: %s", name, strerror(errno));
                         goto next;                          goto next;

Legend:
Removed from v.1.157  
changed lines
  Added in v.1.158