bircoph 15/02/11 03:39:24 Added: clsync-0.4-unshare-configure.patch clsync-0.4-hl_locks.patch clsync-0.4-version.patch clsync-0.4-unused-deps.patch clsync-0.4-gio.patch clsync.confd clsync.conf clsync-0.4-direct_mode.patch clsync-0.4-unset_env.patch clsync.initd clsync-0.4-unshare-ifdef.patch clsync-0.4-handler_path.patch Log: Initial version ported from bircoph overlay. Nice lsyncd replacement. Have fun! Signed-off-by: Andrew Savchenko <birc...@gentoo.org> (Portage version: 2.2.15/cvs/Linux i686, signed Manifest commit with key 565953B95372756C)
Revision Changes Path 1.1 app-admin/clsync/files/clsync-0.4-unshare-configure.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unshare-configure.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unshare-configure.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-unshare-configure.patch =================================================================== commit a13f929cfe4a7fad58c7d814a139efff091601e0 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Tue Jan 27 15:51:18 2015 +0300 "unshare()" support is configurable now diff --git a/configure.ac b/configure.ac index f474478..059ade0 100644 --- a/configure.ac +++ b/configure.ac @@ -87,6 +87,17 @@ AS_HELP_STRING(--enable-socket-library, [build libclsync socket library, default: no])) AM_CONDITIONAL([LIBCLSYNC], [test "x$enable_socket_library" = "xyes"]) +dnl --enable-unshare +AC_ARG_ENABLE(unshare, +AS_HELP_STRING(--enable-unshare, +[enable support of unshare(), default: yes]), [], [enable_unshare="yes"]) + +HAVE_UNSHARE=0 +AS_IF([ test "x$enable_unshare" = "xyes" ], +[ + AC_CHECK_FUNC([unshare], [HAVE_UNSHARE=1], [AC_MSG_FAILURE([Cannot find function unshare()])]) +]) + dnl --enable-highload-locks AC_ARG_ENABLE(highload-locks, AS_HELP_STRING(--enable-highload-locks, @@ -155,9 +166,6 @@ AC_CHECK_FUNC([getmntent], [HAVE_GETMNTENT=1]) dnl searching for pivot_root AC_CHECK_FUNC([pivot_root], [HAVE_PIVOTROOT=1]) -dnl searching for unshare -AC_CHECK_FUNC([unshare], [HAVE_UNSHARE=1]) - dnl libcgroup check AC_ARG_WITH(libcgroup, AS_HELP_STRING(--with-libcgroup, 1.1 app-admin/clsync/files/clsync-0.4-hl_locks.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-hl_locks.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-hl_locks.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-hl_locks.patch =================================================================== commit 76c75f8180a7e7592da927e8b4c8f5f067470d05 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Wed Jan 28 12:19:11 2015 +0300 [hl_locks] A try to fix a segfault on one core PC Thanks for the bugreport to: Andrew A Savchenko <birc...@gentoo.org> diff --git a/privileged.c b/privileged.c index fafd5b7..668a536 100644 --- a/privileged.c +++ b/privileged.c @@ -1680,11 +1680,6 @@ int privileged_init(ctx_t *ctx_p) #endif #ifdef CAPABILITIES_SUPPORT -# ifdef HL_LOCKS - if (ncpus == 1) - hl_shutdown(HLLOCK_HANDLER); -# endif - if (ctx_p->flags[SPLITTING] == SM_OFF) { #endif @@ -1792,6 +1787,12 @@ int privileged_init(ctx_t *ctx_p) default: critical("Invalid ctx_p->flags[SPLITTING]: %i", ctx_p->flags[SPLITTING]); } + +# ifdef HL_LOCKS + if (ncpus == 1) + hl_shutdown(HLLOCK_HANDLER); +# endif + critical_on(!helper_isalive()); # ifdef UNSHARE_SUPPORT 1.1 app-admin/clsync/files/clsync-0.4-version.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-version.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-version.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-version.patch =================================================================== commit e9eeb552896a3ac3f4f1e9d72ecab6a200f3c70c Author: Andrew Savchenko <birc...@gmail.com> Date: Tue Jan 27 21:54:21 2015 +0300 update package string diff --git a/configure.ac b/configure.ac index 45f5a23..3e0b3cc 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.59]) -AC_INIT([clsync],[0.3],[Dmitry Yu Okunev <dyoku...@ut.mephi.ru>],,[https://github.com/xaionaro/clsync]) +AC_INIT([clsync],[0.4],[Dmitry Yu Okunev <dyoku...@ut.mephi.ru>],,[https://github.com/xaionaro/clsync]) AC_CONFIG_SRCDIR([sync.c]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.11 foreign -Wall -Wno-portability]) 1.1 app-admin/clsync/files/clsync-0.4-unused-deps.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unused-deps.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unused-deps.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-unused-deps.patch =================================================================== Adapted commit 756ae28750b514473ae235218d466dc6fa960c30 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Thu Jan 29 15:17:39 2015 +0300 [configure.ac] Removed dependency on libseccomp; renamed "--with-libseccomp" -> "--enable-seccomp", "--with-capabilities" -> "--enable-capabilities" --- clsync-0.4/configure.ac.orig 2015-02-11 01:52:54.104682884 +0300 +++ clsync-0.4/configure.ac 2015-02-11 01:58:07.397580398 +0300 @@ -145,6 +145,51 @@ ) AS_IF([test $paranoid -eq 2], [CPPFLAGS="${CPPFLAGS} -DVERYPARANOID"]) +dnl searching for seccomp +AC_ARG_ENABLE(seccomp, + AS_HELP_STRING(--enable-seccomp, + [Enable seccomp support be able to forbid extra syscalls; values: no, check, yes; default: check]), + , + [enable_seccomp=check] +) + +case "$enable_seccomp" in + yes) + AC_CHECK_TYPES([struct seccomp_data], [HAVE_SECCOMP=1], [AC_MSG_FAILURE([Cannot find valid linux/seccomp.h])], [[#include <linux/seccomp.h>]]) + ;; + check) + AC_CHECK_TYPES([struct seccomp_data], [HAVE_SECCOMP=1], , [[#include <linux/seccomp.h>]]) + ;; +esac + +dnl capabilities check +AC_ARG_ENABLE(capabilities, + AS_HELP_STRING(--enable-capabilities, + [Enable linux capabilities support; values: no, check, yes; default: check]), + , + [enable_capabilities=check] +) + +case "$enable_capabilities" in + yes) + AC_CHECK_FUNC([capset], + [ + AC_CHECK_HEADER(sys/capability.h, [HAVE_CAPABILITIES=2], [AC_MSG_FAILURE([Cannot find sys/capability.h])]) + ], + [ + AC_MSG_FAILURE([There is no capabilities support on this system]) + ] + ) + ;; + check) + AC_CHECK_FUNC([capset], + [ + AC_CHECK_HEADER(sys/capability.h, [HAVE_CAPABILITIES=2]) + ] + ) + ;; +esac + # Checks for programs. AC_PROG_CC_C99 AC_PROG_INSTALL @@ -201,34 +246,6 @@ ;; esac -dnl capabilities check -AC_ARG_WITH(capabilities, - AS_HELP_STRING(--with-capabilities, - [Enable linux capabilities support; values: no, check, yes; default: check]), - [], - [with_capabilities=check] -) - -case "$with_capabilities" in - yes) - AC_CHECK_FUNC([capset], - [ - AC_CHECK_HEADER(sys/capability.h, [HAVE_CAPABILITIES=2], [AC_MSG_FAILURE([Cannot find sys/capability.h])]) - ], - [ - AC_MSG_FAILURE([There is no capabilities support on this system]) - ] - ) - ;; - check) - AC_CHECK_FUNC([capset], - [ - AC_CHECK_HEADER(sys/capability.h, [HAVE_CAPABILITIES=2]) - ] - ) - ;; -esac - dnl tre check #AC_ARG_WITH(tre, @@ -433,31 +450,6 @@ AS_IF([test "$HAVE_INOTIFY" != ""], [AC_CHECK_FUNC([inotify_init1], [], [INOTIFY_OLD=1])]) -dnl searching for seccomp -AC_ARG_WITH(libseccomp, - AS_HELP_STRING(--with-libseccomp, - [Enable seccomp support be able to forbid extra syscalls; values: no, check, yes; default: check]), - [], - [with_libseccomp=check] -) - -case "$with_libseccomp" in - yes) - AC_CHECK_TYPES([scmp_filter_ctx], [], [AC_MSG_FAILURE([Cannot find valid seccomp.h])], [[#include <seccomp.h>]]) - AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [], [AC_MSG_FAILURE([Cannot find valid seccomp.h])], [[#include <seccomp.h>]]) - AC_CHECK_TYPES([struct seccomp_data], [HAVE_SECCOMP=1], [AC_MSG_FAILURE([Cannot find valid linux/seccomp.h])], [[#include <linux/seccomp.h>]]) - ;; - check) - AC_CHECK_TYPES([scmp_filter_ctx], [ - AC_CHECK_DECLS([seccomp_syscall_resolve_name_arch], [ - AC_CHECK_TYPES([struct seccomp_data], [HAVE_SECCOMP=1], [], [[#include <linux/seccomp.h>]]) - ], [], [[#include <seccomp.h>]]) - ], [], [[#include <seccomp.h>]]) - ;; -esac -AS_IF([test "$HAVE_CAPABILITIES" != ""], [ -]) - AM_CONDITIONAL([HAVE_KQUEUE], [test "x$HAVE_KQUEUE" != "x"]) AM_CONDITIONAL([HAVE_INOTIFY], [test "x$HAVE_INOTIFY" != "x"]) AM_CONDITIONAL([INOTIFY_OLD], [test "x$INOTIFY_OLD" != "x"]) diff --git a/privileged.c b/privileged.c index 668a536..0e773cc 100644 --- a/privileged.c +++ b/privileged.c @@ -59,7 +59,7 @@ #include "privileged.h" #ifdef SECCOMP_SUPPORT -# include <seccomp.h> // __NR_* +# include <syscall.h> // __NR_* # include <sys/prctl.h> // prctl() # include <linux/filter.h> // struct sock_filter # include <linux/seccomp.h> // SECCOMP_RET_* 1.1 app-admin/clsync/files/clsync-0.4-gio.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-gio.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-gio.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-gio.patch =================================================================== commit 4eea85337a3358baae0b4f0626d63a9626778a01 Author: Andrew Savchenko <birc...@gmail.com> Date: Wed Jan 28 02:50:36 2015 +0300 Add GIO to the list of allowed file monitors. This allows to compile clsync ONLY with GIO support. diff --git a/configure.ac b/configure.ac index f497c67..a3f0324 100644 --- a/configure.ac +++ b/configure.ac @@ -262,7 +262,7 @@ dnl tre check # ;; #esac -dnl kqueue/inotify/bsm +dnl kqueue/inotify/gio/bsm AC_ARG_WITH(kqueue, AS_HELP_STRING(--with-kqueue, @@ -476,7 +476,9 @@ AM_CONDITIONAL([HAVE_SECCOMP], [test "x$HAVE_SECCOMP" != "x"]) AM_CONDITIONAL([HAVE_TRE], [test "x$HAVE_TRE" != "x"]) AM_CONDITIONAL([HAVE_LIBCGROUP], [test "x$HAVE_LIBCGROUP" != "x"]) -AS_IF([test "$HAVE_KQUEUE" = '' -a "$HAVE_INOTIFY" = '' -a "$HAVE_FANOTIFY" = '' -a "$HAVE_BSM" = '' ], [AC_MSG_FAILURE([kqueue, inotify and bsm are not supported on this system])]) +AS_IF([test "$HAVE_KQUEUE" = '' -a "$HAVE_INOTIFY" = '' -a "$HAVE_FANOTIFY" = '' -a "$HAVE_BSM" = '' -a "$HAVE_GIO" = ''], +[AC_MSG_FAILURE([At least one monitoring engine must be enabled! +Available (depending on system): inotify, kqueue, gio, bsm])]) LIBS="${GLIB_LIBS} ${LIBS}" AM_CPPFLAGS="${GLIB_CFLAGS}" 1.1 app-admin/clsync/files/clsync.confd file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.confd?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.confd?rev=1.1&content-type=text/plain Index: clsync.confd =================================================================== # /etc/conf.d/clsync: config file for /etc/init.d/clsync # config file, default is /etc/clsync/clsync.conf. # to disable set to /dev/null #CLSYNC_CONF="/etc/clsync/clsync.conf" # clsync options, have precedence over config file, # see man clsync and $docdir/examples for details #CLSYNC_OPTS="" # Example of direct rsync usage: #CLSYNC_OPTS="--lists-dir /tmp/clsync --mode rsyncshell #--watch-dir /source/dir --sync-handler /usr/bin/rsync #--rules-file /etc/clsync/rules --distination-dir /destination/dir" # Change clsync nice level (default is unset) #CLSYNC_NICE="0" # Change clsync ionice level (default is unset) #CLSYNC_IONICE="2:7" 1.1 app-admin/clsync/files/clsync.conf file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.conf?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.conf?rev=1.1&content-type=text/plain Index: clsync.conf =================================================================== # clsync system configuration file # # General recommendations: # 1. Put --dir-lists on tmpfs. # 2. Use --uid and --gid to drop privileges whenever possible. # 3. Keeep your clsync rules and sync scripts in /etc/clsync/. [default] # Put your options here, see clsync man pages for a list of valid options. # Also check examples directory (/usr/share/doc/clsync-*/examples). # #watch-dir = /what/dir/to/sync #sync-handler = /etc/clsync/action.sh #rules-dir = /etc/clsync/rules #lists-dir = /tmp/clsync #threading = safe #delay-sync = 5 #delay-collect = 5 1.1 app-admin/clsync/files/clsync-0.4-direct_mode.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-direct_mode.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-direct_mode.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-direct_mode.patch =================================================================== commit 1fe2a05438de390dc12a653bc50ddf591fa79733 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Wed Jan 28 11:39:09 2015 +0300 Fixed the path '' in direct mode. '' -> '.' Thanks for bugreport to: Andrew A Savchenko <birc...@gentoo.org> diff --git a/sync.c b/sync.c index b6d3341..490ea39 100644 --- a/sync.c +++ b/sync.c @@ -1959,6 +1959,25 @@ int fileischanged(ctx_t *ctx_p, indexes_t *indexes_p, const char *path_rel, stat return 1; } +static inline int sync_indexes_fpath2ei_addfixed(ctx_t *ctx_p, indexes_t *indexes_p, const char *fpath, eventinfo_t *evinfo) { + static const char fpath_dot[] = "."; + const char *fpath_fixed; + + fpath_fixed = fpath; + switch (ctx_p->flags[MODE]) { + case MODE_DIRECT: + + // If fpath is empty (that means CWD) then assign it to "." + if (!*fpath) + fpath_fixed = fpath_dot; + break; + default: + break; + } + + return indexes_fpath2ei_add(indexes_p, strdup(fpath_fixed), evinfo); +} + int sync_prequeue_loadmark ( int monitored, @@ -2145,7 +2164,8 @@ int sync_prequeue_loadmark ); if (isnew) - indexes_fpath2ei_add(indexes_p, strdup(path_rel), evinfo); + // Fix the path (if required) and call indexes_fpath2ei_add() to remeber the new object to be synced + sync_indexes_fpath2ei_addfixed(ctx_p, indexes_p, path_rel, evinfo); return 0; } @@ -2288,7 +2308,9 @@ void _sync_idle_dosync_collectedevents(gpointer fpath_gp, gpointer evinfo_gp, gp if (isnew) { debug(4, "Collecting \"%s\"", fpath); - indexes_fpath2ei_add(indexes_p, strdup(fpath), evinfo_idx); + + // Fix the path (if required) and call indexes_fpath2ei_add() to remeber the new object to be synced + sync_indexes_fpath2ei_addfixed(ctx_p, indexes_p, fpath, evinfo_idx); } else free(fpath); 1.1 app-admin/clsync/files/clsync-0.4-unset_env.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unset_env.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unset_env.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-unset_env.patch =================================================================== commit 596f79fa65af66afdff4cf24b9135935bf511108 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Wed Jan 28 14:27:51 2015 +0300 Fixed a segfault on non-set "HOME" environment variable diff --git a/main.c b/main.c index 792f1e4..176e1f4 100644 --- a/main.c +++ b/main.c @@ -1731,18 +1731,18 @@ int configs_parse(ctx_t *ctx_p, paramsource_t paramsource) { char **config_path_p = config_paths, *config_path_real = xmalloc(PATH_MAX); size_t config_path_real_size=PATH_MAX; - char *homedir = getenv("HOME"); - size_t homedir_len = strlen(homedir); + char *homedir = getenv("HOME"); + size_t homedir_len = (homedir == NULL ? 0 :strlen(homedir)); - while(*config_path_p != NULL) { + while (*config_path_p != NULL) { size_t config_path_len = strlen(*config_path_p); - if(config_path_len+homedir_len+3 > config_path_real_size) { + if (config_path_len+homedir_len+3 > config_path_real_size) { config_path_real_size = config_path_len+homedir_len+3; config_path_real = xmalloc(config_path_real_size); } - if(*config_path_p[0] != '/') { + if ((*config_path_p[0] != '/') && (homedir_len >= 0)) { memcpy(config_path_real, homedir, homedir_len); config_path_real[homedir_len] = '/'; memcpy(&config_path_real[homedir_len+1], *config_path_p, config_path_len+1); @@ -1750,7 +1750,7 @@ int configs_parse(ctx_t *ctx_p, paramsource_t paramsource) { memcpy(config_path_real, *config_path_p, config_path_len+1); debug(1, "Trying config-file \"%s\" (case #1)", config_path_real); - if(!g_key_file_load_from_file(gkf, config_path_real, G_KEY_FILE_NONE, NULL)) { + if (!g_key_file_load_from_file(gkf, config_path_real, G_KEY_FILE_NONE, NULL)) { debug(1, "Cannot open/parse file \"%s\"", config_path_real); config_path_p++; continue; 1.1 app-admin/clsync/files/clsync.initd file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.initd?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync.initd?rev=1.1&content-type=text/plain Index: clsync.initd =================================================================== #!/sbin/runscript # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-admin/clsync/files/clsync.initd,v 1.1 2015/02/11 03:39:24 bircoph Exp $ [[ -n "${CLSYNC_CONF}" ]] && conffile="--config-file ${CLSYNC_CONF}" [[ -n "${CLSYNC_NICE}" ]] && cmd_nice="--nice ${CLSYNC_NICE}" [[ -n "${CLSYNC_IONICE}" ]] && cmd_ionice="--ionice ${CLSYNC_IONICE}" command="/usr/bin/clsync" pidfile="/var/run/${SVCNAME}.pid" command_args="--background --output=syslog --pid-file=${pidfile} \ ${conffile} ${CLSYNC_OPTS}" start_stop_daemon_args="${cmd_nice} ${cmd_ionice}" depend() { use net } 1.1 app-admin/clsync/files/clsync-0.4-unshare-ifdef.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unshare-ifdef.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-unshare-ifdef.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-unshare-ifdef.patch =================================================================== commit a437518de6813202ab9cef124a6ca085d3eb555d Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Tue Jan 27 18:56:02 2015 +0300 Added missed "#ifdef"-s for unshare() diff --git a/privileged.c b/privileged.c index 4b35514..fafd5b7 100644 --- a/privileged.c +++ b/privileged.c @@ -1747,7 +1747,9 @@ int privileged_init(ctx_t *ctx_p) SAFE ( pthread_mutex_lock(pthread_mutex_runner_p), return errno;); +# ifdef UNSHARE_SUPPORT unshare(CLONE_NEWIPC); +# endif switch (ctx_p->flags[SPLITTING]) { case SM_THREAD: { @@ -1792,11 +1794,13 @@ int privileged_init(ctx_t *ctx_p) } critical_on(!helper_isalive()); +# ifdef UNSHARE_SUPPORT // The rest routines if (ctx_p->flags[DETACH_NETWORK] == DN_NONPRIVILEGED) { SAFE ( cap_enable(CAP_TO_MASK(CAP_SYS_ADMIN)), return errno; ); SAFE ( unshare(CLONE_NEWNET), return errno; ); } +# endif SAFE ( cap_drop(ctx_p, 0), return errno; ); debug(4, "Waiting for the privileged thread to get prepared"); 1.1 app-admin/clsync/files/clsync-0.4-handler_path.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-handler_path.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/clsync/files/clsync-0.4-handler_path.patch?rev=1.1&content-type=text/plain Index: clsync-0.4-handler_path.patch =================================================================== commit a747384216597df71c99453dc5161100e1b41181 Author: Dmitry Yu Okunev <dyoku...@ut.mephi.ru> Date: Wed Jan 28 11:46:57 2015 +0300 Fixed setting sync-handler without absoulte path For example "-Secho" diff --git a/main.c b/main.c index 53e71ae..792f1e4 100644 --- a/main.c +++ b/main.c @@ -2526,12 +2526,16 @@ int main(int _argc, char *_argv[]) { if (ctx_p->handlerfpath != NULL) { char *rhandlerfpath = realpath(ctx_p->handlerfpath, NULL); +/* if (rhandlerfpath == NULL) { error("Got error while realpath() on \"%s\" [#0].", ctx_p->handlerfpath); ret = errno; } debug(5, "rhandlerfpath == \"%s\"", rhandlerfpath); - ctx_p->handlerfpath = rhandlerfpath; + ctx_p->handlerfpath = rhandlerfpath;*/ + + if (rhandlerfpath != NULL) + ctx_p->handlerfpath = rhandlerfpath; }