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

Diff for /src/usr.bin/nc/netcat.c between version 1.213 and 1.214

version 1.213, 2020/01/06 15:19:12 version 1.214, 2020/01/06 19:39:58
Line 371 
Line 371 
                         err(1, "unveil");                          err(1, "unveil");
                 if (oflag && unveil(oflag, "r") == -1)                  if (oflag && unveil(oflag, "r") == -1)
                         err(1, "unveil");                          err(1, "unveil");
           } else if (family == AF_UNIX && uflag && lflag && !kflag) {
                   /*
                    * After recvfrom(2) from client, the server connects
                    * to the client socket.  As the client path is determined
                    * during runtime, we cannot unveil(2).
                    */
         } else {          } else {
                 if (family == AF_UNIX) {                  if (family == AF_UNIX) {
                         if (unveil(host, "rwc") == -1)                          if (unveil(host, "rwc") == -1)
                                 err(1, "unveil");                                  err(1, "unveil");
                         if (uflag && !lflag) {                          if (uflag && !kflag) {
                                 if (unveil(sflag ? sflag : "/tmp", "rwc") == -1)                                  if (sflag) {
                                         err(1, "unveil");                                          if (unveil(sflag, "rwc") == -1)
                                                   err(1, "unveil");
                                   } else {
                                           if (unveil("/tmp", "rwc") == -1)
                                                   err(1, "unveil");
                                   }
                         }                          }
                 } else {                  } else {
                         /* no filesystem visibility */                          /* no filesystem visibility */
Line 569 
Line 580 
                         if (s == -1)                          if (s == -1)
                                 err(1, NULL);                                  err(1, NULL);
                         if (uflag && kflag) {                          if (uflag && kflag) {
                                   if (family == AF_UNIX) {
                                           if (pledge("stdio unix", NULL) == -1)
                                                   err(1, "pledge");
                                   }
                                 /*                                  /*
                                  * For UDP and -k, don't connect the socket,                                   * For UDP and -k, don't connect the socket,
                                  * let it receive datagrams from multiple                                   * let it receive datagrams from multiple
Line 595 
Line 610 
                                 if (rv == -1)                                  if (rv == -1)
                                         err(1, "connect");                                          err(1, "connect");
   
                                   if (family == AF_UNIX) {
                                           if (pledge("stdio unix", NULL) == -1)
                                                   err(1, "pledge");
                                   }
                                 if (vflag)                                  if (vflag)
                                         report_sock("Connection received",                                          report_sock("Connection received",
                                             (struct sockaddr *)&z, len,                                              (struct sockaddr *)&z, len,

Legend:
Removed from v.1.213  
changed lines
  Added in v.1.214