Shell scripts should explicitly "exit 0" for portability. Thanks Jos.
[rsync/rsync.git] / TODO
CommitLineData
46ef7d1d 1-*- indented-text -*-
a0365806 2
259c3e72
MP
3BUGS ---------------------------------------------------------------
4
5There seems to be a bug with hardlinks
6
7 mbp/2 build$ ls -l /tmp/a /tmp/b -i
8 /tmp/a:
9 total 32
10 2568307 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a1
11 2568307 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a2
12 2568307 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a3
13 2568310 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a4
14 2568310 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a5
15 2568310 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b1
16 2568310 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b2
17 2568310 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b3
18
19 /tmp/b:
20 total 32
21 2568309 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a1
22 2568309 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a2
23 2568309 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a3
24 2568311 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a4
25 2568311 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a5
26 2568311 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b1
27 2568311 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b2
28 2568311 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b3
29 mbp/2 build$ rm -r /tmp/b && ./rsync -avH /tmp/a/ /tmp/b
30 building file list ... done
31 created directory /tmp/b
32 ./
33 a1
34 a4
35 a2 => a1
36 a3 => a2
37 wrote 350 bytes read 52 bytes 804.00 bytes/sec
38 total size is 232 speedup is 0.58
39 mbp/2 build$ rm -r /tmp/b
40 mbp/2 build$ ls -l /tmp/b
41 ls: /tmp/b: No such file or directory
42 mbp/2 build$ rm -r /tmp/b && ./rsync -avH /tmp/a/ /tmp/b
43 rm: cannot remove `/tmp/b': No such file or directory
44 mbp/2 build$ rm -f -r /tmp/b && ./rsync -avH /tmp/a/ /tmp/b
45 building file list ... done
46 created directory /tmp/b
47 ./
48 a1
49 a4
50 a2 => a1
51 a3 => a2
52 wrote 350 bytes read 52 bytes 804.00 bytes/sec
53 total size is 232 speedup is 0.58
54 mbp/2 build$ ls -l /tmp/b
55 total 32
56 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a1
57 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a2
58 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a3
59 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a4
60 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a5
61 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b1
62 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b2
63 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b3
64 mbp/2 build$ ls -l /tmp/a
65 total 32
66 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a1
67 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a2
68 -rw-rw-r-- 3 mbp mbp 29 Mar 25 17:30 a3
69 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a4
70 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 a5
71 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b1
72 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b2
73 -rw-rw-r-- 5 mbp mbp 29 Mar 25 17:30 b3
46ef7d1d 74
33d213bb
MP
75
76IMPORTANT ------------------------------------------------------------
77
33d213bb 78
a2d2e5c0
MP
79use chroot
80
81 If the platform doesn't support it, then don't even try.
82
83 If running as non-root, then don't fail, just give a warning.
84 (There was a thread about this a while ago?)
85
86 http://lists.samba.org/pipermail/rsync/2001-August/thread.html
87 http://lists.samba.org/pipermail/rsync/2001-September/thread.html
88
89--files-from
90
91 Avoids traversal. Better option than a pile of --include statements
92 for people who want to generate the file list using a find(1)
93 command or a script.
94
8f4455f2
MP
95File list structure in memory
96
97 Rather than one big array, perhaps have a tree in memory mirroring
98 the directory tree.
99
100 This might make sorting much faster! (I'm not sure it's a big CPU
101 problem, mind you.)
102
103 It might also reduce memory use in storing repeated directory names
104 -- again I'm not sure this is a problem.
0e5a1f83 105
a2d2e5c0
MP
106Performance
107
108 Traverse just one directory at a time. Tridge says it's possible.
a6a3c3df
MP
109
110 At the moment rsync reads the whole file list into memory at the
111 start, which makes us use a lot of memory and also not pipeline
112 network access as much as we could.
113
0e5a1f83
MP
114
115Handling duplicate names
116
b3e6c815 117 We need to be careful of duplicate names getting into the file list.
d2e9d069
MP
118 See clean_flist(). This could happen if multiple arguments include
119 the same file. Bad.
b3e6c815
MP
120
121 I think duplicates are only a problem if they're both flowing
122 through the pipeline at the same time. For example we might have
123 updated the first occurrence after reading the checksums for the
124 second. So possibly we just need to make sure that we don't have
125 both in the pipeline at the same time.
126
127 Possibly if we did one directory at a time that would be sufficient.
128
129 Alternatively we could pre-process the arguments to make sure no
58379559
MP
130 duplicates will ever be inserted. There could be some bad cases
131 when we're collapsing symlinks.
b3e6c815
MP
132
133 We could have a hash table.
134
d2e9d069
MP
135 The root of the problem is that we do not want more than one file
136 list entry referring to the same file. At first glance there are
137 several ways this could happen: symlinks, hardlinks, and repeated
138 names on the command line.
139
140 If names are repeated on the command line, they may be present in
141 different forms, perhaps by traversing directory paths in different
142 ways, traversing paths including symlinks. Also we need to allow
143 for expansion of globs by rsync.
144
145 At the moment, clean_flist() requires having the entire file list in
146 memory. Duplicate names are detected just by a string comparison.
147
148 We don't need to worry about hard links causing duplicates because
149 files are never updated in place. Similarly for symlinks.
150
151 I think even if we're using a different symlink mode we don't need
152 to worry.
153
0e5a1f83
MP
154 Unless we're really clever this will introduce a protocol
155 incompatibility, so we need to be able to accept the old format as
156 well.
157
158
a6a3c3df
MP
159Memory accounting
160
161 At exit, show how much memory was used for the file list, etc.
162
b3e6c815
MP
163 Also we do a wierd exponential-growth allocation in flist.c. I'm
164 not sure this makes sense with modern mallocs. At any rate it will
165 make us allocate a huge amount of memory for large file lists.
166
0e5a1f83 167
a6a3c3df
MP
168Hard-link handling
169
170 At the moment hardlink handling is very expensive, so it's off by
171 default. It does not need to be so.
172
0e5a1f83
MP
173 Since most of the solutions are rather intertwined with the file
174 list it is probably better to fix that first, although fixing
175 hardlinks is possibly simpler.
176
a6a3c3df
MP
177 We can rule out hardlinked directories since they will probably
178 screw us up in all kinds of ways. They simply should not be used.
179
180 At the moment rsync only cares about hardlinks to regular files. I
181 guess you could also use them for sockets, devices and other beasts,
182 but I have not seen them.
183
184 When trying to reproduce hard links, we only need to worry about
185 files that have more than one name (nlinks>1 && !S_ISDIR).
186
187 The basic point of this is to discover alternate names that refer to
188 the same file. All operations, including creating the file and
189 writing modifications to it need only to be done for the first name.
190 For all later names, we just create the link and then leave it
191 alone.
192
193 If hard links are to be preserved:
194
195 Before the generator/receiver fork, the list of files is received
196 from the sender (recv_file_list), and a table for detecting hard
197 links is built.
198
199 The generator looks for hard links within the file list and does
200 not send checksums for them, though it does send other metadata.
201
202 The sender sends the device number and inode with file entries, so
203 that files are uniquely identified.
204
205 The receiver goes through and creates hard links (do_hard_links)
206 after all data has been written, but before directory permissions
207 are set.
208
209 At the moment device and inum are sent as 4-byte integers, which
210 will probably cause problems on large filesystems. On Linux the
211 kernel uses 64-bit ino_t's internally, and people will soon have
212 filesystems big enough to use them. We ought to follow NFS4 in
213 using 64-bit device and inode identification, perhaps with a
214 protocol version bump.
215
216 Once we've seen all the names for a particular file, we no longer
217 need to think about it and we can deallocate the memory.
218
219 We can also have the case where there are links to a file that are
220 not in the tree being transferred. There's nothing we can do about
221 that. Because we rename the destination into place after writing,
222 any hardlinks to the old file are always going to be orphaned. In
223 fact that is almost necessary because otherwise we'd get really
224 confused if we were generating checksums for one name of a file and
225 modifying another.
226
227 At the moment the code seems to make a whole second copy of the file
228 list, which seems unnecessary.
229
230 We should have a test case that exercises hard links. Since it
231 might be hard to compare ./tls output where the inodes change we
232 might need a little program to check whether several names refer to
233 the same file.
a2d2e5c0
MP
234
235IPv6
236
c33e3e39
MP
237 Implement suggestions from http://www.kame.net/newsletter/19980604/
238 and ftp://ftp.iij.ad.jp/pub/RFC/rfc2553.txt
239
240 If a host has multiple addresses, then listen try to connect to all
241 in order until we get through. (getaddrinfo may return multiple
c10b0bdd 242 addresses.) This is kind of implemented already.
c33e3e39
MP
243
244 Possibly also when starting as a server we may need to listen on
245 multiple passive addresses. This might be a bit harder, because we
246 may need to select on all of them. Hm.
247
a2d2e5c0
MP
248 Define a syntax for IPv6 literal addresses. Since they include
249 colons, they tend to break most naming systems, including ours.
250 Based on the HTTP IPv6 syntax, I think we should use
251
252 rsync://[::1]/foo/bar
253 [::1]::bar
254
255 which should just take a small change to the parser code.
256
b17dd0c4 257
5aafd07b
MP
258Errors
259
260 If we hang or get SIGINT, then explain where we were up to. Perhaps
261 have a static buffer that contains the current function name, or
262 some kind of description of what we were trying to do. This is a
263 little easier on people than needing to run strace/truss.
264
265 "The dungeon collapses! You are killed." Rather than "unexpected
266 eof" give a message that is more detailed if possible and also more
267 helpful.
268
89b0a3d9
MP
269 If we get an error writing to a socket, then we should perhaps
270 continue trying to read to see if an error message comes across
271 explaining why the socket is closed. I'm not sure if this would
272 work, but it would certainly make our messages more helpful.
273
b17dd0c4
MP
274 What happens if a directory is missing -x attributes. Do we lose
275 our load? (Debian #28416) Probably fixed now, but a test case
276 would be good.
277
278
5575de14
MP
279File attributes
280
281 Device major/minor numbers should be at least 32 bits each. See
282 http://lists.samba.org/pipermail/rsync/2001-November/005357.html
283
284 Transfer ACLs. Need to think of a standard representation.
285 Probably better not to even try to convert between NT and POSIX.
286 Possibly can share some code with Samba.
5aafd07b 287
28a69e25
MP
288Empty directories
289
290 With the current common --include '*/' --exclude '*' pattern, people
291 can end up with many empty directories. We might avoid this by
292 lazily creating such directories.
293
c6e27b60 294
28a69e25
MP
295zlib
296
c6e27b60
MP
297 Perhaps don't use our own zlib.
298
299 Advantages:
300
301 - will automatically be up to date with bugfixes in zlib
302
303 - can leave it out for small rsync on e.g. recovery disks
304
305 - can use a shared library
306
307 - avoids people breaking rsync by trying to do this themselves and
308 messing up
309
310 Should we ship zlib for systems that don't have it, or require
311 people to install it separately?
312
313 Apparently this will make us incompatible with versions of rsync
314 that use the patched version of rsync. Probably the simplest way to
315 do this is to just disable gzip (with a warning) when talking to old
316 versions.
317
28a69e25
MP
318
319logging
320
321 Perhaps flush stdout after each filename, so that people trying to
322 monitor progress in a log file can do so more easily. See
323 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=48108
324
430d841a
MP
325 At the connections that just get a list of modules are not logged,
326 but they should be.
327
db1babe6
MP
328 If a child of the rsync daemon dies with a signal, we should notice
329 that when we reap it and log a message.
330
a5c48193
MP
331 Keep stderr and stdout properly separated (Debian #23626)
332
6479c2ed
MP
333 Use a separate function for reporting errors; prefix it with
334 "rsync:" or "rsync(remote)", or perhaps even "rsync(local
335 generator): ".
336
db1babe6 337
7c583c73
MP
338rsyncd over ssh
339
340 There are already some patches to do this.
341
92325ada
MP
342proxy authentication
343
344 Allow RSYNC_PROXY to be http://user:pass@proxy.foo:3128/, and do
345 HTTP Basic Proxy-Authentication.
346
347 Multiple schemes are possible, up to and including the insanity that
348 is NTLM, but Basic probably covers most cases.
349
350SOCKS
351
352 Add --with-socks, and then perhaps a command-line option to put them
353 on or off. This might be more reliable than LD_PRELOAD hacks.
354
27741d9f
MP
355Better statistics:
356
357 <Rasmus> mbp: hey, how about an rsync option that just gives you the
358 summary without the list of files? And perhaps gives more
359 information like the number of new files, number of changed,
360 deleted, etc. ?
361 <mbp> Rasmus: nice idea
362 <mbp> there is --stats
363 <mbp> but at the moment it's very tridge-oriented
364 <mbp> rather than user-friendly
365 <mbp> it would be nice to improve it
366 <mbp> that would also work well with --dryrun
367
e53fe9a2
MP
368TDB:
369
370 Rather than storing the file list in memory, store it in a TDB.
371
372 This *might* make memory usage lower while building the file list.
373
374 Hashtable lookup will mean files are not transmitted in order,
375 though... hm.
376
377 This would neatly eliminate one of the major post-fork shared data
378 structures.
379
380
97e1254a
MP
381chmod:
382
383 On 12 Mar 2002, Dave Dykstra <dwd@bell-labs.com> wrote:
384 > If we would add an option to do that functionality, I would vote for one
385 > that was more general which could mask off any set of permission bits and
386 > possibly add any set of bits. Perhaps a chmod-like syntax if it could be
387 > implemented simply.
388
389 I think that would be good too. For example, people uploading files
390 to a web server might like to say
391
392 rsync -avzP --chmod a+rX ./ sourcefrog.net:/home/www/sourcefrog/
393
394 Ideally the patch would implement as many of the gnu chmod semantics
395 as possible. I think the mode parser should be a separate function
396 that passes back something like (mask,set) description to the rest of
397 the program. For bonus points there would be a test case for the
398 parser.
399
36692011
MP
400 (Debian #23628)
401
97e1254a 402
3c1edccb
MP
403--diff
404
405 Allow people to specify the diff command. (Might want to use wdiff,
406 gnudiff, etc.)
407
408 Just diff the temporary file with the destination file, and delete
409 the tmp file rather than moving it into place.
410
411 Interaction with --partial.
412
413 Security interactions with daemon mode?
414
415 (Suggestion from david.e.sewell)
416
417
a628b069
MP
418Incorrect timestamps (Debian #100295)
419
420 A bit hard to believe, but apparently it happens.
6d19c674
MP
421
422
423Check "refuse options works"
424
425 We need a test case for this...
426
427 Was this broken when we changed to popt?
6479c2ed
MP
428
429
430String area code
431
432 Test whether this is actually faster than just using malloc(). If
433 it's not (anymore), throw it out.
a628b069
MP
434
435
436
a2d2e5c0
MP
437PLATFORMS ------------------------------------------------------------
438
439Win32
440
441 Don't detach, because this messes up --srvany.
442
443 http://sources.redhat.com/ml/cygwin/2001-08/msg00234.html
444
445 According to "Effective TCP/IP Programming" (??) close() on a socket
446 has incorrect behaviour on Windows -- it sends a RST packet to the
447 other side, which gives a "connection reset by peer" error. On that
448 platform we should probably do shutdown() instead. However, on Unix
449 we are correct to call close(), because shutdown() discards
450 untransmitted data.
451
0e23e41d
MP
452DEVELOPMENT ----------------------------------------------------------
453
454Splint
455
456 Build rsync with SPLINT to try to find security holes. Add
457 annotations as necessary. Keep track of the number of warnings
458 found initially, and see how many of them are real bugs, or real
459 security bugs. Knowing the percentage of likely hits would be
460 really interesting for other projects.
461
f5a95bb5
MP
462Torture test
463
464 Something that just keeps running rsync continuously over a data set
465 likely to generate problems.
466
467Cross-testing
468
469 Run current rsync versions against significant past releases.
470
43a4dc10
MP
471Memory debugger
472
3a79260d 473 jra recommends Valgrind:
43a4dc10
MP
474
475 http://devel-home.kde.org/~sewardj/
476
e9c4c301
MP
477TESTING --------------------------------------------------------------
478
479Cross-test versions
480
481 Part of the regression suite should be making sure that we don't
482 break backwards compatibility: old clients vs new servers and so
483 on. Ideally we would test the cross product of versions.
484
485 It might be sufficient to test downloads from well-known public
486 rsync servers running different versions of rsync. This will give
487 some testing and also be the most common case for having different
488 versions and not being able to upgrade.
489
490Test large files
491
492 Sparse and non-sparse
493
494Mutator program
495
496 Insert bytes, delete bytes, swap blocks, ...
497
498configure option to enable dangerous tests
499
500If tests are skipped, say why.
501
b73b51a9
MP
502Test daemon feature to disallow particular options.
503
599dc93c
MP
504Pipe program that makes slow/jerky connections.
505
76533c52
MP
506Versions of read() and write() that corrupt the stream, or abruptly fail
507
6479c2ed
MP
508Separate makefile target to run rough tests -- or perhaps just run
509them every time?
510
e9c4c301 511
7c583c73
MP
512DOCUMENTATION --------------------------------------------------------
513
514Update README
515
b73b51a9
MP
516Keep list of open issues and todos on the web site
517
518Update web site from CVS
519
a2d2e5c0
MP
520BUILD FARM -----------------------------------------------------------
521
522Add machines
523
524 AMDAHL UTS (Dave Dykstra)
525
526 Cygwin (on different versions of Win32?)
527
528 HP-UX variants (via HP?)
33d213bb 529
5aafd07b
MP
530 SCO
531
46ef7d1d
MP
532NICE -----------------------------------------------------------------
533
a2d2e5c0
MP
534--no-detach and --no-fork options
535
536 Very useful for debugging. Also good when running under a
537 daemon-monitoring process that tries to restart the service when the
538 parent exits.
539
540hang/timeout friendliness
541
50f2f002
MP
542verbose output
543
544 Indicate whether files are new, updated, or deleted
545
d834adc1
MP
546 At end of transfer, show how many files were or were not transferred
547 correctly.
548
a2d2e5c0
MP
549internationalization
550
551 Change to using gettext(). Probably need to ship this for platforms
552 that don't have it.
553
554 Solicit translations.
555
556 Does anyone care?
557
46ef7d1d
MP
558rsyncsh
559
560 Write a small emulation of interactive ftp as a Pythonn program
561 that calls rsync. Commands such as "cd", "ls", "ls *.c" etc map
562 fairly directly into rsync commands: it just needs to remember the
563 current host, directory and so on. We can probably even do
564 completion of remote filenames.