If the daemon is receiving, only run the post-exec code from
authorWayne Davison <wayned@samba.org>
Fri, 10 Jun 2005 21:35:12 +0000 (21:35 +0000)
committerWayne Davison <wayned@samba.org>
Fri, 10 Jun 2005 21:35:12 +0000 (21:35 +0000)
the generator process.

pre-post-exec.diff

index 704cd80..9a940f8 100644 (file)
@@ -9,13 +9,15 @@ The post-exec command runs inside any chroot() as the module user.
 
 You'll want to run "make proto" after applying this patch.
 
---- cleanup.c  5 Mar 2005 18:58:38 -0000       1.30
-+++ cleanup.c  10 Jun 2005 21:25:24 -0000
-@@ -21,9 +21,11 @@
+--- orig/cleanup.c     2005-03-05 18:58:38
++++ cleanup.c  2005-06-10 21:32:40
+@@ -21,9 +21,13 @@
  
  #include "rsync.h"
  
 +extern int am_daemon;
++extern int am_sender;
++extern int am_generator;
  extern int io_error;
  extern int keep_partial;
  extern int log_got_error;
@@ -23,11 +25,11 @@ You'll want to run "make proto" after applying this patch.
  extern char *partial_dir;
  
  /**
-@@ -152,6 +154,16 @@ void _exit_cleanup(int code, const char 
+@@ -152,6 +156,16 @@ void _exit_cleanup(int code, const char 
                        ocode, safe_fname(file), line, code);
        }
  
-+      if (am_daemon) {
++      if (am_daemon && (am_sender || am_generator)) {
 +              char *p = lp_post_exec(module_id);
 +              if (p && *p) {
 +                      char *arg;
@@ -40,8 +42,8 @@ You'll want to run "make proto" after applying this patch.
        close_all();
        exit(code);
  }
---- clientserver.c     10 Jun 2005 16:57:43 -0000      1.159
-+++ clientserver.c     10 Jun 2005 21:25:25 -0000
+--- orig/clientserver.c        2005-06-10 21:33:27
++++ clientserver.c     2005-06-10 21:25:25
 @@ -347,6 +347,10 @@ static int rsync_module(int f_in, int f_
  
        log_init();
@@ -53,8 +55,8 @@ You'll want to run "make proto" after applying this patch.
        if (use_chroot) {
                /*
                 * XXX: The 'use chroot' flag is a fairly reliable
---- loadparm.c 10 Jun 2005 16:57:43 -0000      1.59
-+++ loadparm.c 10 Jun 2005 21:25:25 -0000
+--- orig/loadparm.c    2005-06-10 21:33:28
++++ loadparm.c 2005-06-10 21:25:25
 @@ -140,6 +140,8 @@ typedef struct
        char *log_format;
        char *refuse_options;