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

Diff for /src/usr.bin/rsync/main.c between version 1.9 and 1.10

version 1.9, 2019/02/12 14:09:59 version 1.10, 2019/02/12 17:58:35
Line 301 
Line 301 
   
         /* Global pledge. */          /* Global pledge. */
   
         if (pledge("stdio rpath wpath cpath inet fattr dns proc exec unveil",          if (pledge("stdio rpath wpath cpath inet fattr dns getpw proc exec unveil",
             NULL) == -1)              NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
   
         memset(&opts, 0, sizeof(struct opts));          memset(&opts, 0, sizeof(struct opts));
   
         while ((c = getopt_long(argc, argv, "e:lnprtv", lopts, NULL)) != -1) {          while ((c = getopt_long(argc, argv, "e:glnprtv", lopts, NULL)) != -1) {
                 switch (c) {                  switch (c) {
                 case 'e':                  case 'e':
                         opts.ssh_prog = optarg;                          opts.ssh_prog = optarg;
                         /* Ignore. */                          /* Ignore. */
                         break;                          break;
                   case 'g':
                           opts.preserve_gids = 1;
                           break;
                 case 'l':                  case 'l':
                         opts.preserve_links = 1;                          opts.preserve_links = 1;
                         break;                          break;
Line 384 
Line 387 
   
         if (fargs->remote) {          if (fargs->remote) {
                 assert(fargs->mode == FARGS_RECEIVER);                  assert(fargs->mode == FARGS_RECEIVER);
                 if (pledge("stdio rpath wpath cpath inet fattr dns unveil",                  if (pledge("stdio rpath wpath cpath inet fattr dns getpw unveil",
                     NULL) == -1)                      NULL) == -1)
                         err(EXIT_FAILURE, "pledge");                          err(EXIT_FAILURE, "pledge");
                 c = rsync_socket(&opts, fargs);                  c = rsync_socket(&opts, fargs);
Line 394 
Line 397 
   
         /* Drop the dns/inet possibility. */          /* Drop the dns/inet possibility. */
   
         if (pledge("stdio rpath wpath cpath fattr proc exec unveil",          if (pledge("stdio rpath wpath cpath fattr getpw proc exec unveil",
             NULL) == -1)              NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
   
Line 411 
Line 414 
   
         /* Drop the fork possibility. */          /* Drop the fork possibility. */
   
         if (pledge("stdio rpath wpath cpath fattr exec unveil", NULL) == -1)          if (pledge("stdio rpath wpath cpath fattr getpw exec unveil", NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
   
         if (child == 0) {          if (child == 0) {
Line 425 
Line 428 
   
         close(fds[1]);          close(fds[1]);
         fds[1] = -1;          fds[1] = -1;
         if (pledge("stdio rpath wpath cpath fattr unveil", NULL) == -1)          if (pledge("stdio rpath wpath cpath fattr getpw unveil", NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
         c = rsync_client(&opts, fds[0], fargs);          c = rsync_client(&opts, fds[0], fargs);
         fargs_free(fargs);          fargs_free(fargs);
Line 450 
Line 453 
                 close(fds[0]);                  close(fds[0]);
         return c ? EXIT_SUCCESS : EXIT_FAILURE;          return c ? EXIT_SUCCESS : EXIT_FAILURE;
 usage:  usage:
         fprintf(stderr, "usage: %s [-lnprtv] "          fprintf(stderr, "usage: %s [-glnprtv] "
                 "[-e ssh-prog] [--delete] [--rsync-path=prog] src ... dst\n",                  "[-e ssh-prog] [--delete] [--rsync-path=prog] src ... dst\n",
                 getprogname());                  getprogname());
         return EXIT_FAILURE;          return EXIT_FAILURE;

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10