|
NAMEctm_smail , ctm_dequeue ,
ctm_rmail —
send and receive
ctm(8)
deltas via mail
SYNOPSIS
DESCRIPTIONIn conjunction with the ctm(8) command,ctm_smail ,
ctm_dequeue and ctm_rmail are
used to distribute changes to a source tree via email. The
ctm_smail utility is given a compressed
ctm delta,
and a mailing list to send it to. It splits the delta into manageable pieces,
encodes them as mail messages and sends them to the mailing list (optionally
queued to spread the mail load). Each recipient uses
ctm_rmail (either manually or automatically) to decode
and reassemble the delta, and optionally call
ctm to apply
it to the source tree. At the moment, several source trees are distributed,
and by several sites. These include the
FreeBSD-current source and CVS trees, distributed by
freefall.FreeBSD.org .
Command line arguments for
ctm-delta is the delta to be sent, and mail-alias is the mailing list to send the delta to. The mail messages are sent using sendmail(8). Command line arguments for
queuedir is the directory containing the
mail messages stored by It is safe to run Command line arguments for
The file arguments (or stdin, if there are none) are scanned for delta pieces. Multiple delta pieces can be read from a single file, so an entire maildrop can be scanned and processed with a single command. It is safe to invoke FILE FORMATFollowing are the important parts of an actual (very small) delta piece:From: owner-src-cur To: src-cur Subject: ctm-mail src-cur.0003.gz 1/4 CTM_MAIL BEGIN src-cur.0003.gz 1 4 H4sIAAAAAAACA3VU72/bNhD9bP0VByQoEiyRSZEUSQP9kKTeYCR2gDTdsGFAwB/HRogtG5K8NCj6 v4+UZSdtUQh6Rz0eee/xaF/dzx8up3/MFlDkBNrGnbttAwyo1pxoRgoiBNX/QJ5d3c9/X8DcPGGo lggkPiXngE4W1gUjKPJCYyk5MZRbIqmNW/ASglIFcdwIzTUxaAqhnCPcBqloKEkJVNDMF0Azk+Bo dDzzk0Ods/+A5gXv9YyJHjMCtJwQNeESNma7hOmXDRxn CTM_MAIL END 61065 The subject of the message always begins with “ctm-mail” followed by the name of the delta, which piece this is, and how many total pieces there are. The data are bracketed by “CTM_MAIL BEGIN” and “CTM_MAIL END” lines, duplicating the information in the subject line, plus a simple checksum. If the delta exceeds maxctmsize, then a message like this will be received instead: From: owner-src-cur To: src-cur Subject: ctm-notice src-cur.0999.gz src-cur.0999.gz is 792843 bytes. The limit is 300000 bytes. You can retrieve this delta via ftp. You are then on your own! ENVIRONMENTIf deltas are to be applied then ctm(8) and gunzip(1) must be in yourPATH .
FILES
EXIT STATUSThectm_smail , ctm_dequeue and
ctm_rmail utilities return exit status 0 for success,
and 1 for various failures. The ctm_rmail utility is
expected to be called from a mail transfer program, and thus signals failure
only when the input mail message should be bounced (preferably into your
regular maildrop, not back to the sender). In short, failure to apply a
completed delta with
ctm is not
considered an error important enough to bounce the mail, and
ctm_rmail returns an exit status of 0.
EXAMPLESTo send delta 32 of src-cur to a group of wonderful code hackers known to sendmail as src-guys, limiting the mail size to roughly 60000 bytes, you could use:ctm_smail -m 60000 /wherever/it/is/src-cur.0032.gz src-guys To decode every ctm_rmail -p ~/pieces -d ~/deltas -b /usr/ctm-src-cur $MAIL (Note that no messages are deleted by
To create a mail alias called receiver-dude that will automatically decode and assemble deltas, but not apply them, you could put the following lines in your /etc/mail/aliases file (assuming the /ctm/tmp and /ctm/deltas directories and /ctm/log file are writable by user daemon or group wheel): receiver-dude: "|ctm_rmail -p /ctm/tmp -d /ctm/deltas -l /ctm/log" owner-receiver-dude: real_dude@wherever.you.like The second line will catch failures and drop them into your regular mailbox, or wherever else you like. To apply all the deltas collected, and delete those applied, you could use: ctm_rmail -D -d /ctm/deltas -b /ctm/src-cur -l /ctm/apply.log For maximum flexibility, consider this excerpt from a procmail script: PATH=$HOME/bin:$PATH :0 w * ^Subject: ctm-mail cvs-cur | ctm_incoming together with the shell script ~/bin/ctm_incoming: #! /bin/sh PATH="$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" export PATH cd $HOME/ctm && ctm_rmail -f -p pieces -d deltas -l log -b /ctm which will deposit all
ctm deltas
in ~/ctm/deltas, apply them to the tree in
/ctm, and drop any failures into your regular mail
box. Note the SECURITYOn its own, CTM is an insecure protocol - there is no authentication performed that the changes applied to the source code were sent by a trusted party, and so care should be taken if the CTM deltas are obtained via an unauthenticated medium such as regular email. It is a relatively simple matter for an attacker to forge a CTM delta to replace or precede the legitimate one and insert malicious code into your source tree. If the legitimate delta is somehow prevented from arriving, this will go unnoticed until a later delta attempts to touch the same file, at which point the MD5 checksum will fail.To remedy this insecurity, CTM delta pieces generated by FreeBSD.org are cryptographically signed in a format compatible with the GNU Privacy Guard utility, available in /usr/ports/security/gpg, and the Pretty Good Privacy v5 utility, /usr/ports/security/pgp5. The relevant public key can be obtained by fingering ctm@FreeBSD.org. CTM deltas which are thus signed cannot be undetectably altered by an attacker. Therefore it is recommended that you make use of GPG or PGP5 to verify the signatures if you receive your CTM deltas via email. DIAGNOSTICSIn normal operation,ctm_smail will report messages
like:
ctm_smail: src-cur.0250.gz 1/2 sent to src-guys or, if queueing, ctm_smail: src-cur.0250.gz 1/2 queued for src-guys The ctm_dequeue: src-cur.0250.gz 1/2 sent The ctm_rmail: src-cur.0250.gz 1/2 stored ctm_rmail: src-cur.0250.gz 2/2 stored ctm_rmail: src-cur.0250.gz complete If any of the input files do not contain a valid delta piece,
ctm_rmail: message contains no delta and return an exit status of 1. You can use this to redirect wayward messages back into your real mailbox if your mail filter goes wonky. These messages go to stderr or to the log file. Messages from ctm(8) turn up here too. Error messages should be self explanatory. SEE ALSOctm(5), ctm(8)AUTHORSStephen McKay <mckay@FreeBSD.org>
Visit the GSP FreeBSD Man Page Interface. |