1 From: peter pan <lanwanhr@yahoo.com>
2 Subject: [PATCH] write only
3 Date: Thu, 12 Feb 2004 04:08:00 -0800 (PST)
5 I've added a write only option to rsyncd.conf which is essentially the opposite
6 of read only. This means that although it's possible someone on our allowed IP
7 range could overwrite (or delete) files on the rsync share, they would not be
8 allowed to download any files (my primary concern).
12 [Updated to CVS version by Wayne Davison.]
15 --- loadparm.c 4 Feb 2004 07:31:29 -0000 1.50
16 +++ loadparm.c 22 Apr 2004 23:49:29 -0000
17 @@ -119,6 +119,7 @@ typedef struct
24 BOOL transfer_logging;
25 @@ -151,6 +152,7 @@ static service sDefault =
27 DEFAULT_LOCK_FILE, /* lock file */
29 + False, /* write only */
31 True, /* use chroot */
32 False, /* transfer logging */
33 @@ -277,6 +279,7 @@ static struct parm_struct parm_table[] =
34 {"lock file", P_STRING, P_LOCAL, &sDefault.lock_file, NULL, 0},
35 {"path", P_PATH, P_LOCAL, &sDefault.path, NULL, 0},
36 {"read only", P_BOOL, P_LOCAL, &sDefault.read_only, NULL, 0},
37 + {"write only", P_BOOL, P_LOCAL, &sDefault.write_only, NULL, 0},
38 {"list", P_BOOL, P_LOCAL, &sDefault.list, NULL, 0},
39 {"use chroot", P_BOOL, P_LOCAL, &sDefault.use_chroot, NULL, 0},
40 {"ignore nonreadable",P_BOOL, P_LOCAL, &sDefault.ignore_nonreadable, NULL, 0},
41 @@ -356,6 +359,7 @@ FN_LOCAL_STRING(lp_comment, comment)
42 FN_LOCAL_STRING(lp_path, path)
43 FN_LOCAL_STRING(lp_lock_file, lock_file)
44 FN_LOCAL_BOOL(lp_read_only, read_only)
45 +FN_LOCAL_BOOL(lp_write_only, write_only)
46 FN_LOCAL_BOOL(lp_list, list)
47 FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
48 FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
49 --- main.c 10 Feb 2004 03:54:47 -0000 1.192
50 +++ main.c 22 Apr 2004 23:49:29 -0000
51 @@ -370,6 +370,12 @@ static void do_server_sender(int f_in, i
55 + if (am_daemon && lp_write_only(module_id) && !am_sender) {
56 + rprintf(FERROR, "ERROR: module is write only\n");
57 + exit_cleanup(RERR_SYNTAX);
61 if (!relative_paths && !push_dir(dir)) {
62 rprintf(FERROR, "push_dir %s failed: %s (3)\n",
63 full_fname(dir), strerror(errno));
64 --- proto.h 22 Apr 2004 09:58:09 -0000 1.189
65 +++ proto.h 22 Apr 2004 23:49:29 -0000
66 @@ -132,6 +132,7 @@ char *lp_comment(int );
68 char *lp_lock_file(int );
69 BOOL lp_read_only(int );
70 +BOOL lp_write_only(int );
72 BOOL lp_use_chroot(int );
73 BOOL lp_transfer_logging(int );