Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 clsync (0.4-1) unstable; urgency=medium
 .
   [ Dmitry Yu Okunev ]
   * A lot of fixes
 .
   [ Barak A. Pearlmutter ]
   * Merge upstream, in particular debian/ tweaks
   * don't install compile-time stuff that shouldn't be
   * bump debian standards version, no changes necessary
   * update debian/watch file, mangle upstream -rc
   * update .gitignore
   * correct some spelling errors
   * man dash hyphen slash patch
Author: Barak A. Pearlmutter <bap@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: <YYYY-MM-DD>

--- clsync-0.4.orig/TODO
+++ clsync-0.4/TODO
@@ -1,4 +1,4 @@
-0! [SECURITY] Drop privilegies. Preserve access to files via "capabilites".
+0! [SECURITY] Drop privilegies. Preserve access to files via "capabilities".
 1. Remove pthreads metainfo GC
 2. Replace g_hash_table* with "tsearch" and so on.
 3. Remove all code with "#ifdef DOXYGEN"
--- clsync-0.4.orig/main.c
+++ clsync-0.4/main.c
@@ -2749,7 +2749,7 @@ int main(int _argc, char *_argv[]) {
 
 
 #ifdef CAPABILITIES_SUPPORT
-	debug(1, "Preserving Linux capabilites");
+	debug(1, "Preserving Linux capabilities");
 
 	// Tell kernel not clear capabilities when dropping root 
 	if (prctl(PR_SET_KEEPCAPS, 1) < 0) {
--- clsync-0.4.orig/man/man1/clsync.1
+++ clsync-0.4/man/man1/clsync.1
@@ -7,7 +7,7 @@
 .SH NAME
 clsync \- live sync tool, written in GNU C
 .SH SYNOPSIS
-.B clsync [ ... ] -- [ sync\-handler\-arguments ]
+.B clsync [ ... ] \-\- [ sync\-handler\-arguments ]
 .SH DESCRIPTION
 .B clsync
 executes
@@ -48,9 +48,9 @@ simple, direct, shell, rsyncdirect, rsyn
 
 To set
 .I sync\-handler\-arguments
-in config file use '--'. An example:
+in config file use '\-\-'. An example:
 .RS
--- = -aH --exclude-from %EXCLUDE-LIST% --include-from=%INCLUDE-LIST% --exclude '*' %watch-dir%/ %destination-dir%/
+\-\- = \-aH \-\-exclude\-from %EXCLUDE\-LIST% \-\-include\-from=%INCLUDE\-LIST% \-\-exclude '*' %watch\-dir%/ %destination\-dir%/
 .RE
  
 .B \-W, \-\-watch\-dir
@@ -674,7 +674,7 @@ If you're going to setup bi\-directional
 .RE
 .B Not enough CPU
 .RS
-If rsync eats too many CPU with rechecking hashsums of files on their dry open()/close() due to some hacky script (for example "chown -R www-data:www-data" in cron) then you can use \-\-modification\-signature "dev,ino,mode,uid,gid,rdev,size,atime,mtime" (without "blksize", "blocks", "nlink" and "ctime")
+If rsync eats too many CPU with rechecking hashsums of files on their dry open()/close() due to some hacky script (for example "chown \-R www-data:www-data" in cron) then you can use \-\-modification\-signature "dev,ino,mode,uid,gid,rdev,size,atime,mtime" (without "blksize", "blocks", "nlink" and "ctime")
 .RE
 .RE
 
@@ -808,7 +808,7 @@ Is not set by default.
 .PP
 .B \-A, \-\-auto\-add\-rules\-w
 .RS
-Forces clsync to create a "w\-rule" for every non-"w-rule" (see
+Forces clsync to create a "w-rule" for every non-"w-rule" (see
 .BR RULES ).
 
 Not recommended to use in modes "rsyncdirect", "rsyncshell" and "rsyncso"
@@ -1012,7 +1012,7 @@ Directory to write clsync's instance inf
 .BR SIGNALS ")."
 The directory shouldn't exists before dumping.
 
-Is set to "/tmp/clsync-dump-%label%" by default.
+Is set to "/tmp/clsync\-dump\-%label%" by default.
 .RE
 
 .PP
@@ -1283,7 +1283,7 @@ to preserve "CAP_DAC_READ_SEARCH", "CAP_
 .BR capabilities (7)]
 Linux capability for process using
 .BR fts "(3), " inotify "(7) and " execve "(2)."
-This allows to preserve enough FS privileges to watch a file tree and execute
+This allows the preservation of enough FS privileges to watch a file tree and execute
 the
 .I sync\-handler
 with required uid and gid [see 
@@ -1411,7 +1411,7 @@ Creates a separate thread for privileged
 It's highly recommended to enable
 .B \-\-seccomp\-filter
 in this case. But that will forbid
-.BR --threading .
+.BR \-\-threading .
 .RE
 .B process
 .RS
@@ -1530,7 +1530,7 @@ Is set to "0" by default if \-\-splittin
 .RS
 .B "[Requires \-\-splitting=process]"
 
-Forbid writting or reading to/from shared memory when it shouldn't be.
+Forbid writing or reading to/from shared memory when it shouldn't be.
 .BR mprotect (2)
 is used for the protection.
 
@@ -1581,13 +1581,13 @@ Possible values:
 .RS
 .B auto
 .RS
-Creates a directory "/dev/shm/clsync-rootfs",
+Creates a directory "/dev/shm/clsync\-rootfs",
 .BR unshare "(2)-ing the mount namespace, " mount (2)-s
 the
 .I chroot\-directory
 to the directory and then
 .BR pivot_root "(2)-ing, " chroot "(2)-ing and " umount (2)-ing
-old rootfs. Directory "/dev/shm/clsync-rootfs" won't be deleted after
+old rootfs. Directory "/dev/shm/clsync\-rootfs" won't be deleted after
 .B clsync
 finish.
 .RE
@@ -1615,7 +1615,7 @@ Don't
 
 The default value is "off". If
 .B \-\-chroot
-is used then recommended value is "auto-ro".
+is used then recommended value is "auto\-ro".
 .RE
 
 .B \-\-mountpoints
@@ -1715,18 +1715,18 @@ Recommendations to improve the perfomanc
 - Disable thread/process splitting.
 .br
 - Don't use clsync rules (use rules on sync-handler side) or/and use option
-"--full-initialsync"
+"\-\-full\-initialsync"
 .br
-- Use option "-B0".
+- Use option "\-B0".
 .br
-- Use option "--cancel-syscalls=mon_stat".
+- Use option "\-\-cancel\-syscalls=mon_stat".
 .br
-- Use option "-p safe" or "-p full".
+- Use option "\-p safe" or "\-p full".
 .br
-- Disable debugging with "-d0" or better disable debugging support at all
-with "./configure" option "--enable-debug=no"
+- Disable debugging with "\-d0" or better disable debugging support at all
+with "./configure" option "\-\-enable\-debug=no"
 .br
-- Don't use option "--exclude-mount-points"
+- Don't use option "\-\-exclude\-mount\-points"
 .br
 - Free memory for disk cache
 .br
@@ -1825,7 +1825,7 @@ Default
 .I sync\-handler\-arguments
 are:
 .RS
-%INCLUDE\-LIST% %destination-dir%/
+%INCLUDE\-LIST% %destination\-dir%/
 .RE
 
 Additional substitutions:
@@ -1912,14 +1912,14 @@ Default
 are:
 .RS
 \-aH \-\-delete \-\-exclude\-from %EXCLUDE\-LIST\-PATH% \-\-include\-from
-%INCLUDE\-LIST\-PATH% --exclude='*' %watch-dir%/ %destination-dir%/
+%INCLUDE\-LIST\-PATH% \-\-exclude='*' %watch\-dir%/ %destination\-dir%/
 .RE
 if option
-.I \-\-rsync-\-prefer\-include
+.I \-\-rsync\-\-prefer\-include
 is not set and
 .RS
-\-aH \-\-delete \-\-include\-from %INCLUDE\-LIST\-PATH% --exclude='*'
-%watch-dir%/ %destination-dir%/
+\-aH \-\-delete \-\-include\-from %INCLUDE\-LIST\-PATH% \-\-exclude='*'
+%watch\-dir%/ %destination\-dir%/
 .RE
 if the option is set
 
@@ -1941,7 +1941,7 @@ Is replaced by the path of the exclude l
 .RS
 Is replaced by default
 .IR sync\-handler\-arguments ", but"
-without "%watch-dir%/ %destination-dir%/"
+without "%watch\-dir%/ %destination\-dir%/"
 .RE
 .RE
 
@@ -2032,7 +2032,7 @@ To fork the process should be used funct
 "pid_t clsyncapi_fork(ctx_t *)" instead of "pid_t fork()" to make clsync
 be able to kill the child.
 
-See example file "clsync-synchandler-rsyncso.c".
+See example file "clsync\-synchandler\-rsyncso.c".
 
 Recommended case.
 .RE
@@ -2144,7 +2144,7 @@ To fork the process should be used funct
 "pid_t clsyncapi_fork(options_t *)" instead of "pid_t fork()" to make clsync
 be able to kill the child.
 
-See example file "clsync-synchandler-so.c".
+See example file "clsync\-synchandler\-so.c".
 
 Recommended case.
 .RE
@@ -2283,7 +2283,7 @@ Syncing pwdb files and sshd_config (non-
 .br
 	+f^/ssh/sshd_config$
 .br
-	-*
+	\-*
 .RE
 
 Syncing pwdb files and sshd_config (rsync case):
@@ -2300,7 +2300,7 @@ Syncing pwdb files and sshd_config (rsyn
 .br
 	+d^/ssh$
 .br
-	-*
+	\-*
 .RE
 
 Syncing /srv/lxc tree (rsync case):
@@ -2331,7 +2331,7 @@ kills children)
 16 \- interrupts sleep()/select() and wait() [for debugging and internal uses]
 
 29 \- dump information to
-.IR dump-dir
+.IR dump\-dir
 [for debugging]
 
 If you need to kill clsync but leave children then you can use 9-th (KILL)
@@ -2508,69 +2508,69 @@ Not described yet.
 
 .B Mirroring a directory:
 .RS
-clsync -Mrsyncdirect -W/path/to/source_dir -D/path/to/destination_dir
+clsync \-Mrsyncdirect \-W/path/to/source_dir \-D/path/to/destination_dir
 .RE
 
 .B Mirroring a directory, but faster:
 .RS
-clsync -w5 -t5 -T5 -Mrsyncdirect -W/path/to/source_dir -D/path/to/destination_dir
+clsync \-w5 \-t5 \-T5 \-Mrsyncdirect \-W/path/to/source_dir \-D/path/to/destination_dir
 .RE
 
 .B Instant mirroring of a directory:
 .RS
-clsync -w0 -t0 -T0 -Mrsyncdirect -W/path/to/source_dir -D/path/to/destination_dir
+clsync \-w0 \-t0 \-T0 \-Mrsyncdirect \-W/path/to/source_dir \-D/path/to/destination_dir
 .RE
 
 .B Making two directories synchronous:
 .RS
-clsync -Mrsyncdirect --background -z /var/run/clsync0.pid --output syslog -Mrsyncdirect -W/path/to/dir1 -D/path/to/dir2 --modification-signature '*'
+clsync \-Mrsyncdirect \-\-background \-z /var/run/clsync0.pid \-\-output syslog \-Mrsyncdirect \-W/path/to/dir1 \-D/path/to/dir2 \-\-modification\-signature '*'
 .br
-clsync -Mrsyncdirect --background -z /var/run/clsync1.pid --output syslog -Mrsyncdirect -W/path/to/dir2 -D/path/to/dir1 --modification-signature '*'
+clsync \-Mrsyncdirect \-\-background \-z /var/run/clsync1.pid \-\-output syslog \-Mrsyncdirect \-W/path/to/dir2 \-D/path/to/dir1 \-\-modification\-signature '*'
 .RE
 
 .B Fixing privileges of a web-site:
 .RS
-clsync -w3 -t3 -T3 -x1 -W/var/www/site.example.org/root -Mdirect -Schown --uid 0 --gid 0 -Ysyslog -b1 --modification-signature uid,gid -- --from=root www-data:www-data %INCLUDE-LIST%
+clsync \-w3 \-t3 \-T3 \-x1 \-W/var/www/site.example.org/root \-Mdirect \-Schown \-\-uid 0 \-\-gid 0 \-Ysyslog \-b1 \-\-modification\-signature uid,gid \-\- \-\-from=root www\-data:www\-data %INCLUDE\-LIST%
 .RE
 
 .B "'Atomic' sync:"
 .RS
-clsync --exit-on-no-events --max-iterations=20 --mode=rsyncdirect -W/var/www_new -Srsync -- %RSYNC-ARGS% /var/www_new/ /var/www/
+clsync \-\-exit\-on\-no\-events \-\-max\-iterations=20 \-\-mode=rsyncdirect \-W/var/www_new \-Srsync \-\- %RSYNC\-ARGS% /var/www_new/ /var/www/
 .RE
 
 .B Moving a web-server:
 .RS
-clsync --exit-on-no-events --max-iterations=20 --pre-exit-hook=/root/stop-here.sh --exit-hook=/root/start-there.sh --mode=rsyncdirect --ignore-exitcode=23,24 --retries=3 -W /var/www -S rsync -- %RSYNC-ARGS% /var/www/ rsync://clsync@another-host/var/www/
+clsync \-\-exit\-on\-no\-events \-\-max\-iterations=20 \-\-pre\-exit\-hook=/root/stop\-here.sh \-\-exit\-hook=/root/start\-there.sh \-\-mode=rsyncdirect \-\-ignore\-exitcode=23,24 \-\-retries=3 \-W /var/www \-S rsync \-\- %RSYNC\-ARGS% /var/www/ rsync://clsync@another-host/var/www/
 .RE
 
 .B Copying files to slave-nodes using
 .BR pdcp (1):
 .RS
-clsync -Msimple -S pdcp -W /opt/global -b -Y syslog -- -a %INCLUDE-LIST% %INCLUDE-LIST%
+clsync \-Msimple \-S pdcp \-W /opt/global \-b \-Y syslog \-\- \-a %INCLUDE\-LIST% %INCLUDE\-LIST%
 .RE
 
 .B Copying files to slave-nodes using
 .BR uftp (1):
 .RS
-clsync -Mdirect -S uftp -W/opt/global --background=1 --output=syslog -- -M 248.225.233.1 %INCLUDE-LIST%
+clsync \-Mdirect \-S uftp \-W/opt/global \-\-background=1 \-\-output=syslog \-\- \-M 248.225.233.1 %INCLUDE\-LIST%
 .RE
 
 .B A dry running to see
 .BR rsync (1)
 .B arguments that clsync will use:
 .RS
-clsync -Mrsyncdirect -S echo -W/path/to/source_dir -D/path/to/destination_dir
+clsync \-Mrsyncdirect \-S echo \-W/path/to/source_dir \-D/path/to/destination_dir
 .RE
 
 .B An another dry running to look how clsync will call
 .BR pdcp (1):
 .RS
-clsync -Msimple -S echo -W /opt/global -b0 -- pdcp -a %INCLUDE-LIST% %INCLUDE-LIST%
+clsync \-Msimple \-S echo \-W /opt/global \-b0 \-\- pdcp \-a %INCLUDE\-LIST% %INCLUDE\-LIST%
 .RE
 
 More working examples you can try out in "/usr/share/doc/clsync/examples/"
 directory. Copy this directory somewhere (e.g. into "/tmp"). And try to run
-"clsync-start-rsync.sh" in there. Any files/directories modifications in
+"clsync\-start\-rsync.sh" in there. Any files/directories modifications in
 "testdir/from" will be synced to "testdir/to" in a few seconds.
 .RE
 .SH AUTHOR
--- clsync-0.4.orig/privileged.c
+++ clsync-0.4/privileged.c
@@ -386,7 +386,7 @@ int cap_enable(__u32 caps) {
 
 	cap_hdr.version = _LINUX_CAPABILITY_VERSION;
 	if (capget(&cap_hdr, &cap_dat) < 0) {
-		error("Cannot get capabilites with capget()");
+		error("Cannot get capabilities with capget()");
 		return errno;
 	}
 
@@ -402,14 +402,14 @@ int cap_enable(__u32 caps) {
 }
 
 int cap_drop(ctx_t *ctx_p, __u32 caps) {
-	debug(1, "Dropping all Linux capabilites but 0x%x", caps);
+	debug(1, "Dropping all Linux capabilities but 0x%x", caps);
 
 	struct __user_cap_header_struct	cap_hdr = {0};
 	struct __user_cap_data_struct	cap_dat = {0};
 
 	cap_hdr.version = _LINUX_CAPABILITY_VERSION;
 	if (capget(&cap_hdr, &cap_dat) < 0) {
-		error_or_debug((ctx_p->flags[CAP_PRESERVE] != CAP_PRESERVE_TRY) ? -1 : 3, "Cannot get capabilites with capget()");
+		error_or_debug((ctx_p->flags[CAP_PRESERVE] != CAP_PRESERVE_TRY) ? -1 : 3, "Cannot get capabilities with capget()");
 		return errno;
 	}
 	debug(3, "old: cap.eff == 0x%04x; cap.prm == 0x%04x; cap.inh == 0x%04x.",
