The Samba-Bugzilla – Attachment 7171 Details for
Bug 8655
link-by-hash: add 'link by hash dir' to rsyncd.conf
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add 'link by hash dir' to rsyncd.conf
0001-Add-link-by-hash-dir-to-rsyncd.conf.patch (text/plain), 4.09 KB, created by
Chris Dunlop
on 2011-12-12 06:35:14 UTC
(
hide
)
Description:
Add 'link by hash dir' to rsyncd.conf
Filename:
MIME Type:
Creator:
Chris Dunlop
Created:
2011-12-12 06:35:14 UTC
Size:
4.09 KB
patch
obsolete
>From d37f22bcf5d97f580b6f9eb9dcb03a24f5138604 Mon Sep 17 00:00:00 2001 >From: Chris Dunlop <chris@onthe.net.au> >Date: Mon, 12 Dec 2011 17:31:12 +1100 >Subject: [PATCH] Add 'link by hash dir' to rsyncd.conf > >Expand upon link-by-hash.diff to enable configuring the option on the server side. > >Signed-off-by: Chris Dunlop <chris@onthe.net.au> >--- > clientserver.c | 5 +++++ > loadparm.c | 4 ++++ > options.c | 4 ++++ > rsyncd.conf.yo | 8 ++++++++ > 4 files changed, 21 insertions(+), 0 deletions(-) > >diff --git a/clientserver.c b/clientserver.c >index d63aa96..8b93e88 100644 >--- a/clientserver.c >+++ b/clientserver.c >@@ -50,6 +50,7 @@ extern int logfile_format_has_i; > extern int logfile_format_has_o_or_i; > extern char *bind_address; > extern char *config_file; >+extern char *link_by_hash_dir; > extern char *logfile_format; > extern char *files_from; > extern char *tmpdir; >@@ -551,6 +552,10 @@ static int rsync_module(int f_in, int f_out, int i, const char *addr, const char > return -1; > } > >+ if (lp_link_by_hash_dir(i)) { >+ link_by_hash_dir = lp_link_by_hash_dir(i); >+ } >+ > if (am_daemon && am_server) { > rprintf(FLOG, "rsync allowed access on module %s from %s (%s)\n", > name, host, addr); >diff --git a/loadparm.c b/loadparm.c >index 965b771..5aed624 100644 >--- a/loadparm.c >+++ b/loadparm.c >@@ -119,6 +119,7 @@ typedef struct { > char *include; > char *include_from; > char *incoming_chmod; >+ char *link_by_hash_dir; > char *lock_file; > char *log_file; > char *log_format; >@@ -195,6 +196,7 @@ static const all_vars Defaults = { > /* include; */ NULL, > /* include_from; */ NULL, > /* incoming_chmod; */ NULL, >+ /* link_by_hash_dir; */ NULL, > /* lock_file; */ DEFAULT_LOCK_FILE, > /* log_file; */ NULL, > /* log_format; */ "%o %h [%a] %m (%u) %f %l", >@@ -336,6 +338,7 @@ static struct parm_struct parm_table[] = > {"include from", P_STRING, P_LOCAL, &Vars.l.include_from, NULL,0}, > {"include", P_STRING, P_LOCAL, &Vars.l.include, NULL,0}, > {"incoming chmod", P_STRING, P_LOCAL, &Vars.l.incoming_chmod, NULL,0}, >+ {"link by hash dir", P_STRING, P_LOCAL, &Vars.l.link_by_hash_dir, NULL,0}, > {"list", P_BOOL, P_LOCAL, &Vars.l.list, NULL,0}, > {"lock file", P_STRING, P_LOCAL, &Vars.l.lock_file, NULL,0}, > {"log file", P_STRING, P_LOCAL, &Vars.l.log_file, NULL,0}, >@@ -464,6 +467,7 @@ FN_LOCAL_STRING(lp_hosts_deny, hosts_deny) > FN_LOCAL_STRING(lp_include, include) > FN_LOCAL_STRING(lp_include_from, include_from) > FN_LOCAL_STRING(lp_incoming_chmod, incoming_chmod) >+FN_LOCAL_STRING(lp_link_by_hash_dir, link_by_hash_dir) > FN_LOCAL_STRING(lp_lock_file, lock_file) > FN_LOCAL_STRING(lp_log_file, log_file) > FN_LOCAL_STRING(lp_log_format, log_format) >diff --git a/options.c b/options.c >index 6f247b6..104148f 100644 >--- a/options.c >+++ b/options.c >@@ -1302,6 +1302,10 @@ int parse_arguments(int *argc_p, const char ***argv_p) > iconv_opt = strdup(arg); > #endif > >+ if (lp_link_by_hash_dir(module_id)) { >+ set_refuse_options("link-by-hash"); >+ } >+ > /* TODO: Call poptReadDefaultConfig; handle errors. */ > > /* The context leaks in case of an error, but if there's a >diff --git a/rsyncd.conf.yo b/rsyncd.conf.yo >index 240c63a..f47a431 100644 >--- a/rsyncd.conf.yo >+++ b/rsyncd.conf.yo >@@ -283,6 +283,14 @@ message telling them to try later. The default is 0, which means no limit. > A negative value disables the module. > See also the "lock file" parameter. > >+dit(bf(link by hash dir)) When the "link by hash dir" parameter is set >+to a non-empty string, received files will be hard linked into em(DIR), >+a link farm arranged by MD4/MD5 file hash. The result is that the system >+will only store one copy of the unique contents of each file, regardless >+of the file's name. If this parameter is set it will disable the >+bf(--link-by-hash) command-line option. The default is for this >+parameter to be unset. >+ > dit(bf(log file)) When the "log file" parameter is set to a non-empty > string, the rsync daemon will log messages to the indicated file rather > than using syslog. This is particularly useful on systems (such as AIX) >-- >1.7.0.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8655
:
7171
|
7193