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

Diff for /src/usr.bin/ftp/fetch.c between version 1.190 and 1.191

version 1.190, 2020/02/19 07:29:53 version 1.191, 2020/02/19 12:39:38
Line 373 
Line 373 
                 errx(1, "%s: URL not permitted", newline);                  errx(1, "%s: URL not permitted", newline);
   
         path = strchr(host, '/');               /* Find path */          path = strchr(host, '/');               /* Find path */
   
   #ifndef NOSSL
           /*
            * Look for auth header in host.
            * Basic auth from RFC 2617, valid characters for path are in
            * RFC 3986 section 3.3.
            */
           if (ishttpurl || ishttpsurl) {
                   p = strchr(host, '@');
                   if (p != NULL && (path == NULL || p < path)) {
                           *p++ = '\0';
                           credentials = recode_credentials(host);
   
                           /* Overwrite userinfo */
                           memmove(host, p, strlen(p) + 1);
                           path = strchr(host, '/');
                   }
           }
   #endif /* !NOSSL */
   
         if (EMPTYSTRING(path)) {          if (EMPTYSTRING(path)) {
                 if (outfile) {                          /* No slash, but */                  if (outfile) {                          /* No slash, but */
                         path = strchr(host,'\0');       /* we have outfile. */                          path = strchr(host,'\0');       /* we have outfile. */
Line 392 
Line 412 
         }          }
   
 noslash:  noslash:
   
 #ifndef NOSSL  
         /*  
          * Look for auth header in host, since now host does not  
          * contain the path. Basic auth from RFC 2617, valid  
          * characters for path are in RFC 3986 section 3.3.  
          */  
         if (ishttpurl || ishttpsurl) {  
                 if ((p = strchr(host, '@')) != NULL) {  
                         *p = '\0';  
                         credentials = recode_credentials(host);  
                         host = p + 1;  
                 }  
         }  
 #endif  /* NOSSL */  
   
         if (outfile)          if (outfile)
                 savefile = outfile;                  savefile = outfile;
         else {          else {

Legend:
Removed from v.1.190  
changed lines
  Added in v.1.191