[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.18 and 1.19

version 1.18, 2019/02/16 10:44:01 version 1.19, 2019/02/16 10:48:05
Line 299 
Line 299 
                 { "recursive",  no_argument,    &opts.recursive,        1 },                  { "recursive",  no_argument,    &opts.recursive,        1 },
                 { "times",      no_argument,    &opts.preserve_times,   1 },                  { "times",      no_argument,    &opts.preserve_times,   1 },
                 { "group",      no_argument,    &opts.preserve_gids,    1 },                  { "group",      no_argument,    &opts.preserve_gids,    1 },
                   { "devices",    no_argument,    &opts.devices,          1 },
                   { "no-devices", no_argument,    &opts.devices,          0 },
                   { "specials",   no_argument,    &opts.specials,         1 },
                   { "no-specials",        no_argument,    &opts.specials, 0 },
                 { "version",    no_argument,    NULL,                   2 },                  { "version",    no_argument,    NULL,                   2 },
                 { NULL,         0,              NULL,                   0 }};                  { NULL,         0,              NULL,                   0 }};
   
         /* Global pledge. */          /* Global pledge. */
   
         if (pledge("stdio rpath wpath cpath inet fattr chown dns getpw proc exec unveil",          if (pledge("stdio unix rpath wpath cpath dpath inet fattr chown 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:glnoprtv", lopts, NULL)) != -1) {          while ((c = getopt_long(argc, argv, "Dae:glnoprtv", lopts, NULL)) != -1) {
                 switch (c) {                  switch (c) {
                   case 'D':
                           opts.devices = 1;
                           opts.specials = 1;
                           break;
                   case 'a':
                           opts.recursive = 1;
                           opts.preserve_links = 1;
                           opts.preserve_perms = 1;
                           opts.preserve_times = 1;
                           opts.preserve_gids = 1;
                           opts.preserve_uids = 1;
                           opts.devices = 1;
                           opts.specials = 1;
                           break;
                 case 'e':                  case 'e':
                         opts.ssh_prog = optarg;                          opts.ssh_prog = optarg;
                         /* Ignore. */                          /* Ignore. */
Line 370 
Line 388 
          */           */
   
         if (opts.server) {          if (opts.server) {
                 if (pledge("stdio rpath wpath cpath fattr chown getpw unveil", NULL) == -1)                  if (pledge("stdio unix rpath wpath cpath dpath fattr chown getpw unveil", NULL) == -1)
                         err(EXIT_FAILURE, "pledge");                          err(EXIT_FAILURE, "pledge");
                 c = rsync_server(&opts, (size_t)argc, argv);                  c = rsync_server(&opts, (size_t)argc, argv);
                 return c ? EXIT_SUCCESS : EXIT_FAILURE;                  return c ? EXIT_SUCCESS : EXIT_FAILURE;
Line 397 
Line 415 
   
         if (fargs->remote) {          if (fargs->remote) {
                 assert(fargs->mode == FARGS_RECEIVER);                  assert(fargs->mode == FARGS_RECEIVER);
                 if (pledge("stdio rpath wpath cpath inet fattr chown dns getpw unveil",                  if (pledge("stdio unix rpath wpath cpath dpath inet fattr chown 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 407 
Line 425 
   
         /* Drop the dns/inet possibility. */          /* Drop the dns/inet possibility. */
   
         if (pledge("stdio rpath wpath cpath fattr chown getpw proc exec unveil",          if (pledge("stdio unix rpath wpath cpath dpath fattr chown getpw proc exec unveil",
             NULL) == -1)              NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
   
Line 424 
Line 442 
   
         /* Drop the fork possibility. */          /* Drop the fork possibility. */
   
         if (pledge("stdio rpath wpath cpath fattr chown getpw exec unveil", NULL) == -1)          if (pledge("stdio unix rpath wpath cpath dpath fattr chown getpw exec unveil", NULL) == -1)
                 err(EXIT_FAILURE, "pledge");                  err(EXIT_FAILURE, "pledge");
   
         if (child == 0) {          if (child == 0) {
Line 438 
Line 456 
   
         close(fds[1]);          close(fds[1]);
         fds[1] = -1;          fds[1] = -1;
         if (pledge("stdio rpath wpath cpath fattr chown getpw unveil", NULL) == -1)          if (pledge("stdio unix rpath wpath cpath dpath fattr chown 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 463 
Line 481 
                 close(fds[0]);                  close(fds[0]);
         return c ? EXIT_SUCCESS : EXIT_FAILURE;          return c ? EXIT_SUCCESS : EXIT_FAILURE;
 usage:  usage:
         fprintf(stderr, "usage: %s [-glnoprtv] "          fprintf(stderr, "usage: %s [-Daglnoprtv] "
                 "[-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.18  
changed lines
  Added in v.1.19