clsync
ctx.h
Go to the documentation of this file.
1 /*
2  clsync - file tree sync utility based on inotify
3 
4  Copyright (C) 2013 Dmitry Yu Okunev <dyokunev@ut.mephi.ru> 0x8E30679C
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 
21 #ifndef __CLSYNC_CTX_H
22 #define __CLSYNC_CTX_H
23 
24 #include <regex.h>
25 #ifdef CAPABILITIES_SUPPORT
26 # include <sys/capability.h> // __u32
27 #endif
28 
29 #define MAX_BLOCKTHREADS (1<<4)
30 
31 #define register_blockthread(thread) {\
32  critical_on (ctx_p->blockthread_count >= MAX_BLOCKTHREADS);\
33  ctx_p->blockthread[ctx_p->blockthread_count++] = pthread_self();\
34  debug(3, "register_blockthread(): ctx_p->blockthread_count -> %i", ctx_p->blockthread_count);\
35  }
36 
37 #define OPTION_FLAGS (1<<10)
38 #define OPTION_LONGOPTONLY (1<<9)
39 #define OPTION_CONFIGONLY (1<<8)
40 #define NOTOPTION (3<<8)
41 enum flags_enum {
42  WATCHDIR = 'W',
43  SYNCHANDLER = 'S',
44  RULESFILE = 'R',
45  DESTDIR = 'D',
46  SOCKETPATH = 's',
47 
48  HELP = 'h',
49  CONFIGFILE = 'H',
50  CONFIGBLOCK = 'K',
51  BACKGROUND = 'b',
52  UID = 'u',
53  GID = 'g',
54  CAP_PRESERVE = 'C',
55  THREADING = 'p',
56  RETRIES = 'r',
59  PIDFILE = 'z',
60  CLUSTERIFACE = 'c',
67  DELAY = 't',
68  BFILEDELAY = 'T',
69  SYNCDELAY = 'w',
71  DEBUG = 'd',
72  QUIET = 'q',
73  VERBOSE = 'v',
74  OUTLISTSDIR = 'L',
75  AUTORULESW = 'A',
76  MODE = 'M',
78  DONTUNLINK = 'U',
79  INITFULL = 'F',
80  SYNCTIMEOUT = 'k',
81  LABEL = 'l',
82  SHOW_VERSION = 'V',
83 
134 };
135 typedef enum flags_enum flags_t;
136 
138  DN_OFF = 0,
141 };
143 
145  PW_OFF = 0,
149 };
151 
157 };
159 
160 enum mode_id {
169 };
170 typedef enum mode_id mode_id_t;
171 
172 enum queue_id {
177 
180 };
181 typedef enum queue_id queue_id_t;
182 
186 };
188 
190  RA_NONE = 0x00,
191  RA_MONITOR = 0x01,
192  RA_SYNC = 0x02,
193  RA_WALK = 0x04,
194  RA_ALL = 0x0f,
195 };
197 
198 // signals (man 7 signal)
204 };
205 
206 struct rule {
207  int num;
208  regex_t expr;
209  mode_t objtype;
212 };
213 typedef struct rule rule_t;
214 
215 struct queueinfo {
216  unsigned int collectdelay;
217  time_t stime;
218 };
219 typedef struct queueinfo queueinfo_t;
220 
221 struct api_functs {
226 };
227 typedef struct api_functs api_functs_t;
228 
230  int ( *wait ) ( struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *tv_p );
231  int ( *handle ) ( struct ctx *ctx_p, struct indexes *indexes_p );
232  int ( *add_watch_dir ) ( struct ctx *ctx_p, struct indexes *indexes_p, const char *const accpath );
233 };
234 
235 enum shflags {
236  SHFL_NONE = 0x00,
241 };
242 typedef enum shflags shflags_t;
243 
244 enum shargsid {
248 };
249 
251  char *v[MAXARGUMENTS];
252  int c;
254 };
256 
257 #define STATE_STARTING(state_p) (state_p == NULL)
271 };
272 typedef enum state_enum state_t;
273 
274 static char *const status_descr[] = {
275  [STATE_EXIT] = "exiting",
276  [STATE_STARTING] = "starting",
277  [STATE_RUNNING] = "running",
278  [STATE_SYNCHANDLER_ERR] = "synchandler error",
279  [STATE_REHASH] = "rehashing",
280  [STATE_PREEXIT] = "preexit",
281  [STATE_LASTSYNC] = "lastsync",
282  [STATE_TERM] = "terminating",
283  [STATE_THREAD_GC] = "thread gc",
284  [STATE_INITSYNC] = "initsync",
285  [STATE_HOLDON] = "hold on",
286  NULL
287 };
288 
291  STAT_FIELD_DEV = 0x0001,
292  STAT_FIELD_INO = 0x0002,
293  STAT_FIELD_MODE = 0x0004,
295  STAT_FIELD_UID = 0x0010,
296  STAT_FIELD_GID = 0x0020,
297  STAT_FIELD_RDEV = 0x0040,
298  STAT_FIELD_SIZE = 0x0080,
304 
305  STAT_FIELD_ALL = 0x1ff7,
306 };
307 
309  CSC_RESET = 0x00,
310  CSC_MON_STAT = 0x01,
311 };
312 
313 #define CAP_PRESERVE_TRY (1<<16)
314 
315 struct ctx {
316 #ifndef LIBCLSYNC
317  volatile state_t state;
318  pid_t pid;
319  char pid_str[65];
320  size_t pid_str_len;
321  uid_t uid;
322  gid_t gid;
327 #ifdef CAPABILITIES_SUPPORT
328  __u32 caps;
329 #endif
330  pid_t child_pid[MAXCHILDREN]; // Used only for non-pthread mode
331  int children; // Used only for non-pthread mode
332  uint32_t iteration_num;
334  size_t rules_count;
335  dev_t st_dev;
336 #endif
340 #ifndef LIBCLSYNC
341  char *config_path;
342  const char *config_block;
344  char *label;
345  char *watchdir;
346  char *pidfile;
347  char *standbyfile;
350  char *destdir;
351  char *destproto;
354  char *statusfile;
355  char *socketpath;
356  char *dump_path;
357 #ifdef CGROUP_SUPPORT
358  char *cg_groupname;
359 #endif
360  int socket;
361  mode_t socketmod;
362  uid_t socketuid;
363  gid_t socketgid;
364 #ifdef CLUSTER_SUPPORT
365  char *cluster_iface;
366  char *cluster_mcastipaddr;
367  char *cluster_nodename;
368  uint32_t cluster_nodename_len;
369  uint16_t cluster_mcastipport;
370  uint16_t cluster_hash_dl_min;
371  uint16_t cluster_hash_dl_max;
372  uint16_t cluster_scan_dl_max;
373  unsigned int cluster_timeout;
374 #endif
375  size_t watchdirlen;
376  size_t destdirlen;
377  size_t watchdirsize;
378  size_t destdirsize;
381  short int watchdir_dirlevel;
385  char *rulfpath;
386  size_t rulfpathsize;
387  char *listoutdir;
389  int retries;
391  unsigned int syncdelay;
392  queueinfo_t _queues[QUEUE_MAX]; // TODO: remove this from here
393  unsigned int rsyncinclimit;
394  time_t synctime;
395  unsigned int synctimeout;
396  sigset_t *sigset;
397  char isignoredexitcode[ ( 1 << 8 )];
400 
401  char *chroot_dir;
402 
403 #ifdef CAPABILITIES_SUPPORT
404  char *permitted_hookfile[MAXPERMITTEDHOOKFILES + 1];
405  int permitted_hookfiles;
406 #endif
407 
408 #ifdef UNSHARE_SUPPORT
409 # ifdef GETMNTENT_SUPPORT
410  char *mountpoint[MAXMOUNTPOINTS + 1];
411  int mountpoints;
412 # endif
413 #endif
414 
417 #endif // ifndef LIBCLSYNC
418  void *indexes_p;
419  void *fsmondata;
420 };
421 typedef struct ctx ctx_t;
422 
423 #endif
424 
CONFIGBLOCK
@ CONFIGBLOCK
Definition: ctx.h:50
MODSIGN
@ MODSIGN
Definition: ctx.h:127
ctx::iteration_num
uint32_t iteration_num
Definition: ctx.h:332
CONFIGFILE
@ CONFIGFILE
Definition: ctx.h:49
ctx::config_block
const char * config_block
Definition: ctx.h:342
UID
@ UID
Definition: ctx.h:52
rule::num
int num
Definition: ctx.h:207
DEBUG
@ DEBUG
Definition: ctx.h:71
FORGET_PRIVTHREAD_INFO
@ FORGET_PRIVTHREAD_INFO
Definition: ctx.h:120
CAPS_INHERIT
@ CAPS_INHERIT
Definition: ctx.h:113
api_funct_init
int(* api_funct_init)(struct ctx *, struct indexes *)
Definition: clsync.h:51
ctx::watchdirsize
size_t watchdirsize
Definition: ctx.h:377
STATE_HOLDON
@ STATE_HOLDON
Definition: ctx.h:269
SHM_MPROTECT
@ SHM_MPROTECT
Definition: ctx.h:126
syscall_bitmask
syscall_bitmask
Definition: ctx.h:308
ctx
Definition: ctx.h:315
QUEUE_LOCKWAIT
@ QUEUE_LOCKWAIT
Definition: ctx.h:176
DELAY
@ DELAY
Definition: ctx.h:67
flags_enum
flags_enum
Definition: ctx.h:41
mode_id_t
enum mode_id mode_id_t
Definition: ctx.h:170
DN_OFF
@ DN_OFF
Definition: ctx.h:138
api_funct_rsync
int(* api_funct_rsync)(const char *inclist, const char *exclist)
Definition: clsync.h:53
ctx::children
int children
Definition: ctx.h:331
SIGUSR_THREAD_GC
@ SIGUSR_THREAD_GC
Definition: ctx.h:200
QUEUE_BIGFILE
@ QUEUE_BIGFILE
Definition: ctx.h:174
SYNCTIMEOUT
@ SYNCTIMEOUT
Definition: ctx.h:80
EXITONSYNCSKIP
@ EXITONSYNCSKIP
Definition: ctx.h:129
MAXRULES
#define MAXRULES
Definition: configuration.h:10
STAT_FIELD_NLINK
@ STAT_FIELD_NLINK
Definition: ctx.h:294
ctx::socketmod
mode_t socketmod
Definition: ctx.h:361
ctx::destdir
char * destdir
Definition: ctx.h:350
STAT_FIELD_MTIME
@ STAT_FIELD_MTIME
Definition: ctx.h:302
SECURESPLITTING
@ SECURESPLITTING
Definition: ctx.h:121
CONFIGBLOCKINHERITS
@ CONFIGBLOCKINHERITS
Definition: ctx.h:103
CLUSTERSDLMAX
@ CLUSTERSDLMAX
Definition: ctx.h:95
ctx::bfilethreshold
size_t bfilethreshold
Definition: ctx.h:390
RSYNCPREFERINCLUDE
@ RSYNCPREFERINCLUDE
Definition: ctx.h:86
api_funct_deinit
int(* api_funct_deinit)()
Definition: clsync.h:54
MAXARGUMENTS
#define MAXARGUMENTS
Definition: configuration.h:13
SHFL_EXCLUDE_LIST_PATH
@ SHFL_EXCLUDE_LIST_PATH
Definition: ctx.h:240
notifyenginefuncts::wait
int(* wait)(struct ctx *ctx_p, struct indexes *indexes_p, struct timeval *tv_p)
Definition: ctx.h:230
ctx::pid_str_len
size_t pid_str_len
Definition: ctx.h:320
api_functs::deinit
api_funct_deinit deinit
Definition: ctx.h:225
DETACH_IPC
@ DETACH_IPC
Definition: ctx.h:130
shargsid
shargsid
Definition: ctx.h:244
ctx::fsmondata
void * fsmondata
Definition: ctx.h:419
rule::mask
ruleaction_t mask
Definition: ctx.h:211
notifyenginefuncts::add_watch_dir
int(* add_watch_dir)(struct ctx *ctx_p, struct indexes *indexes_p, const char *const accpath)
Definition: ctx.h:232
OUTPUT_METHOD
@ OUTPUT_METHOD
Definition: ctx.h:57
AUTORULESW
@ AUTORULESW
Definition: ctx.h:75
STATE_UNKNOWN
@ STATE_UNKNOWN
Definition: ctx.h:270
ctx::watchdirlen
size_t watchdirlen
Definition: ctx.h:375
IGNOREEXITCODE
@ IGNOREEXITCODE
Definition: ctx.h:77
STAT_FIELD_CTIME
@ STAT_FIELD_CTIME
Definition: ctx.h:303
OPTION_LONGOPTONLY
#define OPTION_LONGOPTONLY
Definition: ctx.h:38
PRIVILEGEDUID
@ PRIVILEGEDUID
Definition: ctx.h:131
MODE_SHELL
@ MODE_SHELL
Definition: ctx.h:164
indexes
Definition: indexes.h:34
ctx::pidfile
char * pidfile
Definition: ctx.h:346
queueinfo::stime
time_t stime
Definition: ctx.h:217
synchandler_args::v
char * v[MAXARGUMENTS]
Definition: ctx.h:251
rule::perm
ruleaction_t perm
Definition: ctx.h:210
STATE_EXIT
@ STATE_EXIT
Definition: ctx.h:259
MOUNTPOINTS
@ MOUNTPOINTS
Definition: ctx.h:109
MODE_SO
@ MODE_SO
Definition: ctx.h:168
ctx::flags_set
int flags_set[(1<< 10)]
Definition: ctx.h:339
STATE_REHASH
@ STATE_REHASH
Definition: ctx.h:263
api_functs
Definition: ctx.h:221
STANDBYFILE
@ STANDBYFILE
Definition: ctx.h:93
EXITONNOEVENTS
@ EXITONNOEVENTS
Definition: ctx.h:92
synchandler_args::c
int c
Definition: ctx.h:252
STATE_RUNNING
@ STATE_RUNNING
Definition: ctx.h:261
STAT_FIELD_BLKSIZE
@ STAT_FIELD_BLKSIZE
Definition: ctx.h:299
FORBIDDEVICES
@ FORBIDDEVICES
Definition: ctx.h:123
ctx::synchandler_argf
shflags_t synchandler_argf
Definition: ctx.h:416
queue_id_t
enum queue_id queue_id_t
Definition: ctx.h:181
ctx::destproto
char * destproto
Definition: ctx.h:351
RA_ALL
@ RA_ALL
Definition: ctx.h:194
api_funct_sync
int(* api_funct_sync)(int n, api_eventinfo_t *)
Definition: clsync.h:52
CSC_RESET
@ CSC_RESET
Definition: ctx.h:309
STATUSFILE
@ STATUSFILE
Definition: ctx.h:89
STAT_FIELD_UID
@ STAT_FIELD_UID
Definition: ctx.h:295
DETACH_MISCELLANEA
@ DETACH_MISCELLANEA
Definition: ctx.h:117
ctx::dump_path
char * dump_path
Definition: ctx.h:356
ctx::pid
pid_t pid
Definition: ctx.h:318
notifyenginefuncts
Definition: ctx.h:229
STATE_PREEXIT
@ STATE_PREEXIT
Definition: ctx.h:264
PRIVILEGEDGID
@ PRIVILEGEDGID
Definition: ctx.h:132
stat_fields
stat_fields
Definition: ctx.h:289
QUEUE_INSTANT
@ QUEUE_INSTANT
Definition: ctx.h:175
ctx::flags
int flags[(1<< 10)]
Definition: ctx.h:338
SHFL_INCLUDE_LIST_PATH
@ SHFL_INCLUDE_LIST_PATH
Definition: ctx.h:239
STATE_INITSYNC
@ STATE_INITSYNC
Definition: ctx.h:268
STAT_FIELD_RESET
@ STAT_FIELD_RESET
Definition: ctx.h:290
SIGUSR_BLOPINT
@ SIGUSR_BLOPINT
Definition: ctx.h:202
state_t
enum state_enum state_t
Definition: ctx.h:272
CAP_PRESERVE
@ CAP_PRESERVE
Definition: ctx.h:54
SYNCDELAY
@ SYNCDELAY
Definition: ctx.h:69
CSC_MON_STAT
@ CSC_MON_STAT
Definition: ctx.h:310
QUEUE_AUTO
@ QUEUE_AUTO
Definition: ctx.h:179
EXCLUDEMOUNTPOINTS
@ EXCLUDEMOUNTPOINTS
Definition: ctx.h:58
SOFTEXITSYNC
@ SOFTEXITSYNC
Definition: ctx.h:133
api_functs::sync
api_funct_sync sync
Definition: ctx.h:223
ctx::rulfpathsize
size_t rulfpathsize
Definition: ctx.h:386
PW_AUTO
@ PW_AUTO
Definition: ctx.h:147
ctx::gid
gid_t gid
Definition: ctx.h:322
queueinfo::collectdelay
unsigned int collectdelay
Definition: ctx.h:216
ctx::rules_count
size_t rules_count
Definition: ctx.h:334
ctx::rulfpath
char * rulfpath
Definition: ctx.h:385
SIGUSR_INITSYNC
@ SIGUSR_INITSYNC
Definition: ctx.h:201
CLUSTERMCASTIPPORT
@ CLUSTERMCASTIPPORT
Definition: ctx.h:62
SOCKETPATH
@ SOCKETPATH
Definition: ctx.h:46
CHECK_EXECVP_ARGS
@ CHECK_EXECVP_ARGS
Definition: ctx.h:114
MODE_RSYNCSO
@ MODE_RSYNCSO
Definition: ctx.h:167
CG_GROUPNAME
@ CG_GROUPNAME
Definition: ctx.h:124
ctx::flags_values_raw
char * flags_values_raw[(1<< 10)]
Definition: ctx.h:337
ctx::synchandler_uid
uid_t synchandler_uid
Definition: ctx.h:325
CANCEL_SYSCALLS
@ CANCEL_SYSCALLS
Definition: ctx.h:128
MODE_UNSET
@ MODE_UNSET
Definition: ctx.h:161
ctx::socketgid
gid_t socketgid
Definition: ctx.h:363
ctx::customsignal
char * customsignal[MAXSIGNALNUM+1]
Definition: ctx.h:343
detachnetwork_way
detachnetwork_way
Definition: ctx.h:137
SYNCHANDLERUID
@ SYNCHANDLERUID
Definition: ctx.h:111
ctx::synchandler_gid
gid_t synchandler_gid
Definition: ctx.h:326
SIGUSR_DUMP
@ SIGUSR_DUMP
Definition: ctx.h:203
detachnetwork_way_t
enum detachnetwork_way detachnetwork_way_t
Definition: ctx.h:142
SOCKETOWN
@ SOCKETOWN
Definition: ctx.h:99
MODE_RSYNCSHELL
@ MODE_RSYNCSHELL
Definition: ctx.h:165
IGNOREFAILURES
@ IGNOREFAILURES
Definition: ctx.h:101
STAT_FIELD_ATIME
@ STAT_FIELD_ATIME
Definition: ctx.h:301
ctx::pid_str
char pid_str[65]
Definition: ctx.h:319
PW_AUTORO
@ PW_AUTORO
Definition: ctx.h:148
RA_WALK
@ RA_WALK
Definition: ctx.h:193
mode_id
mode_id
Definition: ctx.h:160
CI_DONTTOUCH
@ CI_DONTTOUCH
Definition: ctx.h:153
CLUSTERHDLMIN
@ CLUSTERHDLMIN
Definition: ctx.h:65
ctx::retries
int retries
Definition: ctx.h:389
capsinherit_t
enum capsinherit capsinherit_t
Definition: ctx.h:158
SYNCHANDLERGID
@ SYNCHANDLERGID
Definition: ctx.h:112
ctx::destdirwslashsize
size_t destdirwslashsize
Definition: ctx.h:380
STAT_FIELD_DEV
@ STAT_FIELD_DEV
Definition: ctx.h:291
CLUSTERTIMEOUT
@ CLUSTERTIMEOUT
Definition: ctx.h:63
SHARGS_INITIAL
@ SHARGS_INITIAL
Definition: ctx.h:246
ctx::blockthread_count
size_t blockthread_count
Definition: ctx.h:399
MAXMOUNTPOINTS
#define MAXMOUNTPOINTS
Definition: configuration.h:36
DN_NONPRIVILEGED
@ DN_NONPRIVILEGED
Definition: ctx.h:139
SOCKETMOD
@ SOCKETMOD
Definition: ctx.h:98
ctx::label
char * label
Definition: ctx.h:344
CLUSTERIFACE
@ CLUSTERIFACE
Definition: ctx.h:60
ctx::synctimeout
unsigned int synctimeout
Definition: ctx.h:395
ctx::notifyenginefunct
struct notifyenginefuncts notifyenginefunct
Definition: ctx.h:388
ctx::isignoredexitcode
char isignoredexitcode[(1<< 8)]
Definition: ctx.h:397
ctx::destdirsize
size_t destdirsize
Definition: ctx.h:378
ctx::destdirwslash
char * destdirwslash
Definition: ctx.h:353
api_functs::init
api_funct_init init
Definition: ctx.h:222
MODE_SIMPLE
@ MODE_SIMPLE
Definition: ctx.h:162
MONITOR
@ MONITOR
Definition: ctx.h:104
RA_MONITOR
@ RA_MONITOR
Definition: ctx.h:191
LABEL
@ LABEL
Definition: ctx.h:81
ctx::handlerfpath
char * handlerfpath
Definition: ctx.h:382
OPTION_FLAGS
#define OPTION_FLAGS
Definition: ctx.h:37
STAT_FIELD_INO
@ STAT_FIELD_INO
Definition: ctx.h:292
ctx::config_path
char * config_path
Definition: ctx.h:341
QUEUE_MAX
@ QUEUE_MAX
Definition: ctx.h:178
MODE
@ MODE
Definition: ctx.h:76
ctx::blockthread
pthread_t blockthread[(1<< 4)]
Definition: ctx.h:398
MODE_DIRECT
@ MODE_DIRECT
Definition: ctx.h:163
SPLITTING
@ SPLITTING
Definition: ctx.h:110
DN_EVERYWHERE
@ DN_EVERYWHERE
Definition: ctx.h:140
ctx::uid
uid_t uid
Definition: ctx.h:321
MAX_BLOCKTHREADS
#define MAX_BLOCKTHREADS
Definition: ctx.h:29
GID
@ GID
Definition: ctx.h:53
PIVOT_ROOT
@ PIVOT_ROOT
Definition: ctx.h:115
QUIET
@ QUIET
Definition: ctx.h:72
VERBOSE
@ VERBOSE
Definition: ctx.h:73
DONTUNLINK
@ DONTUNLINK
Definition: ctx.h:78
ONLYINITSYNC
@ ONLYINITSYNC
Definition: ctx.h:91
RETRIES
@ RETRIES
Definition: ctx.h:56
ctx::sigset
sigset_t * sigset
Definition: ctx.h:396
rule::objtype
mode_t objtype
Definition: ctx.h:209
STAT_FIELD_SIZE
@ STAT_FIELD_SIZE
Definition: ctx.h:298
ruleaction_t
enum ruleaction_enum ruleaction_t
Definition: ctx.h:196
SYNCHANDLERARGS0
@ SYNCHANDLERARGS0
Definition: ctx.h:105
RSYNCINCLIMIT
@ RSYNCINCLIMIT
Definition: ctx.h:85
INITFULL
@ INITFULL
Definition: ctx.h:79
notifyenginefuncts::handle
int(* handle)(struct ctx *ctx_p, struct indexes *indexes_p)
Definition: ctx.h:231
sigusr_enum
sigusr_enum
Definition: ctx.h:199
ctx::watchdir_dirlevel
short int watchdir_dirlevel
Definition: ctx.h:381
MAXSIGNALNUM
#define MAXSIGNALNUM
Definition: configuration.h:18
pivotroot_way_t
enum pivotroot_way pivotroot_way_t
Definition: ctx.h:150
HELP
@ HELP
Definition: ctx.h:48
CI_CLSYNC
@ CI_CLSYNC
Definition: ctx.h:155
ctx::rules
rule_t rules[MAXRULES]
Definition: ctx.h:333
api_functs::rsync
api_funct_rsync rsync
Definition: ctx.h:224
RA_NONE
@ RA_NONE
Definition: ctx.h:190
THREADING
@ THREADING
Definition: ctx.h:55
MODE_RSYNCDIRECT
@ MODE_RSYNCDIRECT
Definition: ctx.h:166
PERMIT_MPROTECT
@ PERMIT_MPROTECT
Definition: ctx.h:125
ctx::_queues
queueinfo_t _queues[QUEUE_MAX]
Definition: ctx.h:392
PIDFILE
@ PIDFILE
Definition: ctx.h:59
SHFL_INCLUDE_LIST
@ SHFL_INCLUDE_LIST
Definition: ctx.h:238
SYNCHANDLERARGS1
@ SYNCHANDLERARGS1
Definition: ctx.h:106
PREEXITHOOK
@ PREEXITHOOK
Definition: ctx.h:96
rule
Definition: ctx.h:206
ctx::chroot_dir
char * chroot_dir
Definition: ctx.h:401
ctx::watchdir
char * watchdir
Definition: ctx.h:345
rule::expr
regex_t expr
Definition: ctx.h:208
CUSTOMSIGNALS
@ CUSTOMSIGNALS
Definition: ctx.h:107
STAT_FIELD_BLOCKS
@ STAT_FIELD_BLOCKS
Definition: ctx.h:300
CLUSTERHDLMAX
@ CLUSTERHDLMAX
Definition: ctx.h:66
RS_PERMIT
@ RS_PERMIT
Definition: ctx.h:185
MAXCHILDREN
#define MAXCHILDREN
Definition: configuration.h:34
DESTDIR
@ DESTDIR
Definition: ctx.h:45
shflags_t
enum shflags shflags_t
Definition: ctx.h:242
RA_SYNC
@ RA_SYNC
Definition: ctx.h:192
pivotroot_way
pivotroot_way
Definition: ctx.h:144
capsinherit
capsinherit
Definition: ctx.h:152
CLUSTERNODENAME
@ CLUSTERNODENAME
Definition: ctx.h:64
ctx::preexithookfile
char * preexithookfile
Definition: ctx.h:349
CLUSTERMCASTIPADDR
@ CLUSTERMCASTIPADDR
Definition: ctx.h:61
ctx::synctime
time_t synctime
Definition: ctx.h:394
ONEFILESYSTEM
@ ONEFILESYSTEM
Definition: ctx.h:88
STAT_FIELD_RDEV
@ STAT_FIELD_RDEV
Definition: ctx.h:297
ctx::listoutdir
char * listoutdir
Definition: ctx.h:387
OUTLISTSDIR
@ OUTLISTSDIR
Definition: ctx.h:74
ruleactionsign_t
enum ruleactionsign_enum ruleactionsign_t
Definition: ctx.h:187
ctx::statusfile
char * statusfile
Definition: ctx.h:354
status_descr
static char *const status_descr[]
Definition: ctx.h:274
BFILETHRESHOLD
@ BFILETHRESHOLD
Definition: ctx.h:70
shflags
shflags
Definition: ctx.h:235
ctx::exithookfile
char * exithookfile
Definition: ctx.h:348
MAXPERMITTEDHOOKFILES
#define MAXPERMITTEDHOOKFILES
Definition: configuration.h:37
ctx::privileged_uid
uid_t privileged_uid
Definition: ctx.h:323
SHARGS_MAX
@ SHARGS_MAX
Definition: ctx.h:247
synchandler_args
Definition: ctx.h:250
ctx::handler_handle
void * handler_handle
Definition: ctx.h:383
SOCKETAUTH
@ SOCKETAUTH
Definition: ctx.h:97
ctx::destdirlen
size_t destdirlen
Definition: ctx.h:376
ctx::st_dev
dev_t st_dev
Definition: ctx.h:335
ctx::socketuid
uid_t socketuid
Definition: ctx.h:362
BFILEDELAY
@ BFILEDELAY
Definition: ctx.h:68
queue_id
queue_id
Definition: ctx.h:172
ctx::watchdirwslashsize
size_t watchdirwslashsize
Definition: ctx.h:379
ruleactionsign_enum
ruleactionsign_enum
Definition: ctx.h:183
ctx::child_pid
pid_t child_pid[MAXCHILDREN]
Definition: ctx.h:330
ctx::handler_funct
api_functs_t handler_funct
Definition: ctx.h:384
STATE_LASTSYNC
@ STATE_LASTSYNC
Definition: ctx.h:265
STAT_FIELD_ALL
@ STAT_FIELD_ALL
Definition: ctx.h:305
DETACH_NETWORK
@ DETACH_NETWORK
Definition: ctx.h:116
EXITHOOK
@ EXITHOOK
Definition: ctx.h:94
STAT_FIELD_GID
@ STAT_FIELD_GID
Definition: ctx.h:296
ruleaction_enum
ruleaction_enum
Definition: ctx.h:189
SHFL_RSYNC_ARGS
@ SHFL_RSYNC_ARGS
Definition: ctx.h:237
STATE_TERM
@ STATE_TERM
Definition: ctx.h:266
synchandler_args::isexpanded
char isexpanded[MAXARGUMENTS]
Definition: ctx.h:253
SKIPINITSYNC
@ SKIPINITSYNC
Definition: ctx.h:90
ctx::rsyncinclimit
unsigned int rsyncinclimit
Definition: ctx.h:393
MAXITERATIONS
@ MAXITERATIONS
Definition: ctx.h:100
HAVERECURSIVESYNC
@ HAVERECURSIVESYNC
Definition: ctx.h:84
FTS_EXPERIMENTAL_OPTIMIZATION
@ FTS_EXPERIMENTAL_OPTIMIZATION
Definition: ctx.h:122
SHFL_NONE
@ SHFL_NONE
Definition: ctx.h:236
STATE_THREAD_GC
@ STATE_THREAD_GC
Definition: ctx.h:267
queueinfo
Definition: ctx.h:215
STAT_FIELD_MODE
@ STAT_FIELD_MODE
Definition: ctx.h:293
state_enum
state_enum
Definition: ctx.h:258
ctx::standbyfile
char * standbyfile
Definition: ctx.h:347
SYNCLISTSIMPLIFY
@ SYNCLISTSIMPLIFY
Definition: ctx.h:87
SECCOMP_FILTER
@ SECCOMP_FILTER
Definition: ctx.h:119
ADDPERMITTEDHOOKFILES
@ ADDPERMITTEDHOOKFILES
Definition: ctx.h:118
BACKGROUND
@ BACKGROUND
Definition: ctx.h:51
PW_DIRECT
@ PW_DIRECT
Definition: ctx.h:146
SYNCHANDLER
@ SYNCHANDLER
Definition: ctx.h:43
SHOW_VERSION
@ SHOW_VERSION
Definition: ctx.h:82
ctx::socket
int socket
Definition: ctx.h:360
ctx::watchdirwslash
char * watchdirwslash
Definition: ctx.h:352
WATCHDIR
@ WATCHDIR
Definition: ctx.h:42
ctx::state
volatile state_t state
Definition: ctx.h:317
SHARGS_PRIMARY
@ SHARGS_PRIMARY
Definition: ctx.h:245
STATE_STARTING
#define STATE_STARTING(state_p)
Definition: ctx.h:257
flags_t
enum flags_enum flags_t
Definition: ctx.h:135
PW_OFF
@ PW_OFF
Definition: ctx.h:145
RULESFILE
@ RULESFILE
Definition: ctx.h:44
ctx::socketpath
char * socketpath
Definition: ctx.h:355
DUMPDIR
@ DUMPDIR
Definition: ctx.h:102
QUEUE_NORMAL
@ QUEUE_NORMAL
Definition: ctx.h:173
ctx::privileged_gid
gid_t privileged_gid
Definition: ctx.h:324
CHROOT
@ CHROOT
Definition: ctx.h:108
STATE_SYNCHANDLER_ERR
@ STATE_SYNCHANDLER_ERR
Definition: ctx.h:262
CI_EMPTY
@ CI_EMPTY
Definition: ctx.h:156
ctx::syncdelay
unsigned int syncdelay
Definition: ctx.h:391
ctx_p
ctx_t * ctx_p
Definition: mon_kqueue.c:85
CI_PERMITTED
@ CI_PERMITTED
Definition: ctx.h:154
RS_REJECT
@ RS_REJECT
Definition: ctx.h:184