ALT Linux repositórios
S: | 2.0-alt2 |
5.0: | 1.34-alt1 |
4.1: | 1.34-alt1 |
4.0: | 1.33-alt0.1 |
3.0: | |
+backports: | 1.30-alt0.M30.0.1 |
Group :: Ferramentas de Arquivo
RPM: csync2
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: csync2-1.34-alt10.r409.patch
Download
Download
configure.ac | 3 +--
csync2.1 | 4 ++--
csync2.c | 22 +++++++++++++---------
csync2.xinetd | 8 ++++++--
4 files changed, 22 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index 173c32f..3bf95e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,8 +80,7 @@ if test "$enable_gnutls" != no
then
# Check for gnuTLS.
- AM_PATH_LIBGNUTLS(1.0.0, , [ AC_MSG_ERROR([[gnutls not found; install gnutls, gnutls-openssl and libtasn1 packages for your system or run configure with --disable-gnutls]]) ])
-
+ PKG_CHECK_MODULES(LIBGNUTLS, [gnutls >= 1.0.0])
# This is a bloody hack for fedora core
CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
LIBS="$LIBS $LIBGNUTLS_LIBS -ltasn1"
diff --git a/csync2.1 b/csync2.1
index d118963..9b3f52d 100644
--- a/csync2.1
+++ b/csync2.1
@@ -142,9 +142,9 @@ found to the specified file descriptor (when doing a -c run).
The directory names in this output are zero-terminated.
.TP
Creating key file:
-.B csync2 -k filename
+.B csync2 -k filename or csync2 --urandom -k filename
.TP
-Warning: Csync2 will refuse to do anything when a /etc/csync2.lock file is found.
+Warning: Csync2 will refuse to do anything when a /etc/csync2/csync2.lock file is found.
.SH SEE ALSO
.BR sqlite (1).
.SH AUTHOR
diff --git a/csync2.c b/csync2.c
index a7b909c..13bfd09 100644
--- a/csync2.c
+++ b/csync2.c
@@ -179,18 +179,18 @@ PACKAGE_STRING " - cluster synchronization tool, 2nd generation\n"
" The directory names in this output are zero-terminated.\n"
"\n"
"Creating key file:\n"
-" %s -k filename\n"
+" %s -k filename or %s --urandom -k filename\n"
"\n"
-"Csync2 will refuse to do anything when a " ETCDIR "/csync2.lock file is found.\n"
+"Csync2 will refuse to do anything when a " DBDIR "/csync2.lock file is found.\n"
"\n",
- cmd, cmd);
+ cmd, cmd, cmd);
exit(1);
}
-int create_keyfile(const char *filename)
+int create_keyfile(const char *filename, const char *devrand)
{
int fd = open(filename, O_WRONLY|O_CREAT|O_EXCL, 0600);
- int rand = open("/dev/random", O_RDONLY);
+ int rand = open(devrand, O_RDONLY);
char matrix[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._";
unsigned char n;
int i;
@@ -201,7 +201,7 @@ int create_keyfile(const char *filename)
return 1;
}
if ( rand == -1 ) {
- fprintf(stderr, "Can't open /dev/random: %s\n", strerror(errno));
+ fprintf(stderr, "Can't open %s: %s\n", devrand, strerror(errno));
return 1;
}
for (i=0; i<64; i++) {
@@ -290,11 +290,15 @@ int main(int argc, char ** argv)
csync_debug_out = stderr;
if ( argc==3 && !strcmp(argv[1], "-k") ) {
- return create_keyfile(argv[2]);
+ return create_keyfile(argv[2], "/dev/random");
}
- if (!access(ETCDIR "/csync2.lock", F_OK)) {
- printf("Found " ETCDIR "/csync2.lock.\n");
+ if ( argc==4 && !strcmp(argv[1], "--urandom") && !strcmp(argv[2], "-k") ) {
+ return create_keyfile(argv[3], "/dev/urandom");
+ }
+
+ if (!access(DBDIR "/csync2.lock", F_OK)) {
+ printf("Found " DBDIR "/csync2.lock.\n");
return 1;
}
diff --git a/csync2.xinetd b/csync2.xinetd
index 146d356..73d7d93 100644
--- a/csync2.xinetd
+++ b/csync2.xinetd
@@ -1,7 +1,12 @@
-# default: on
+# default: off
# description: csync2
service csync2
{
+ disable = yes
+ # don't wish to add into /etc/services
+ type = unlisted
+ protocol = tcp
+ port = 30865
flags = REUSE
socket_type = stream
wait = no
@@ -10,6 +15,5 @@ service csync2
server = /usr/sbin/csync2
server_args = -i
#log_on_failure += USERID
- disable = no
# only_from = 192.168.199.3 192.168.199.4
}