Fixed failing hunks.
[rsync/rsync-patches.git] / write-only.diff
CommitLineData
8a529471
WD
1After applying this patch and running configure, you MUST run this
2command before "make":
3
4 make proto
5
6peter pan (lanwanhr@yahoo.com) writes:
4aa43585
WD
7
8I've added a write only option to rsyncd.conf which is essentially the opposite
9of read only. This means that although it's possible someone on our allowed IP
10range could overwrite (or delete) files on the rsync share, they would not be
11allowed to download any files (my primary concern).
12
4aa43585
WD
13
14--- loadparm.c 4 Feb 2004 07:31:29 -0000 1.50
fe6407b5 15+++ loadparm.c 15 May 2004 20:50:11 -0000
4aa43585
WD
16@@ -119,6 +119,7 @@ typedef struct
17 char *comment;
18 char *lock_file;
19 BOOL read_only;
20+ BOOL write_only;
21 BOOL list;
22 BOOL use_chroot;
23 BOOL transfer_logging;
24@@ -151,6 +152,7 @@ static service sDefault =
25 NULL, /* comment */
26 DEFAULT_LOCK_FILE, /* lock file */
27 True, /* read only */
28+ False, /* write only */
29 True, /* list */
30 True, /* use chroot */
31 False, /* transfer logging */
32@@ -277,6 +279,7 @@ static struct parm_struct parm_table[] =
33 {"lock file", P_STRING, P_LOCAL, &sDefault.lock_file, NULL, 0},
34 {"path", P_PATH, P_LOCAL, &sDefault.path, NULL, 0},
35 {"read only", P_BOOL, P_LOCAL, &sDefault.read_only, NULL, 0},
36+ {"write only", P_BOOL, P_LOCAL, &sDefault.write_only, NULL, 0},
37 {"list", P_BOOL, P_LOCAL, &sDefault.list, NULL, 0},
38 {"use chroot", P_BOOL, P_LOCAL, &sDefault.use_chroot, NULL, 0},
39 {"ignore nonreadable",P_BOOL, P_LOCAL, &sDefault.ignore_nonreadable, NULL, 0},
40@@ -356,6 +359,7 @@ FN_LOCAL_STRING(lp_comment, comment)
41 FN_LOCAL_STRING(lp_path, path)
42 FN_LOCAL_STRING(lp_lock_file, lock_file)
43 FN_LOCAL_BOOL(lp_read_only, read_only)
44+FN_LOCAL_BOOL(lp_write_only, write_only)
45 FN_LOCAL_BOOL(lp_list, list)
46 FN_LOCAL_BOOL(lp_use_chroot, use_chroot)
47 FN_LOCAL_BOOL(lp_transfer_logging, transfer_logging)
fe6407b5
WD
48--- main.c 15 May 2004 19:31:10 -0000 1.194
49+++ main.c 15 May 2004 20:50:11 -0000
50@@ -369,6 +369,12 @@ static void do_server_sender(int f_in, i
4aa43585
WD
51 (long)getpid());
52 }
53
54+ if (am_daemon && lp_write_only(module_id) && !am_sender) {
55+ rprintf(FERROR, "ERROR: module is write only\n");
56+ exit_cleanup(RERR_SYNTAX);
57+ return;
58+ }
59+
60 if (!relative_paths && !push_dir(dir)) {
fe6407b5
WD
61 rsyserr(FERROR, errno, "push_dir#3 %s failed",
62 full_fname(dir));